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("hrl_pr2_arms") roslib.load_manifest("hrl_generic_arms") roslib.load_manifest("hrl_lib") roslib.load_manifest("hrl_msgs") roslib.load_manifest("ar_pose") import math, time, copy import numpy as np import tf, rospy, actionlib import hrl_lib.transforms as hrl_tr import tf.transformations as tf_trans import hrl_pr2_arms.pr2_controller_switcher as pr2cs import hrl_pr2_arms.pr2_arm as pr2arm import hrl_generic_arms.ep_trajectory_controller as eptc from actionlib_msgs.msg import * from pr2_controllers_msgs.msg import * from ar_pose.msg import ARMarkers from std_msgs.msg import String, Bool from hrl_msgs.msg import StringArray class head(): def __init__(self): # rospy.init_node('move_the_head', anonymous=True) self.client = actionlib.SimpleActionClient('/head_traj_controller/point_head_action', PointHeadAction) self.client.wait_for_server() self.goal = PointHeadGoal() def set_pose(self, pos): self.goal.target.header.frame_id = 'torso_lift_link' self.goal.target.point.x = pos[0] self.goal.target.point.y = pos[1] self.goal.target.point.z = pos[2] self.goal.min_duration = rospy.Duration(3.) rospy.logout('Sending Head Goal') self.client.send_goal(self.goal) self.client.wait_for_result() if self.client.get_state() == GoalStatus.SUCCEEDED: print "Succeeded" else: print "Failed" class torso(): def __init__(self): self.client = actionlib.SimpleActionClient('/torso_controller/position_joint_action', SingleJointPositionAction) self.client.wait_for_server() self.pos = SingleJointPositionGoal() def down(self): # self.pos.position = 0.01 self.pos.position = 0.15 self.pos.min_duration = rospy.Duration(2.) self.pos.max_velocity = 1. rospy.logout('Sending torso down') self.client.send_goal(self.pos) self.client.wait_for_result() if self.client.get_state() == GoalStatus.SUCCEEDED: print "Succeeded" else: print "Failed" class gripper(): def __init__(self): self.r_client = actionlib.SimpleActionClient('r_gripper_controller/gripper_action', Pr2GripperCommandAction) self.r_client.wait_for_server() self.l_client = actionlib.SimpleActionClient('l_gripper_controller/gripper_action', Pr2GripperCommandAction) self.r_client.wait_for_server() self.state = Pr2GripperCommandGoal() def Open(self, arm='left_arm'): if arm == 'left_arm': client = self.l_client elif arm == 'right_arm': client = self.r_client self.state.command.position = .07 self.state.command.max_effort = -1. rospy.logout('Open the gripper') client.send_goal(self.state) client.wait_for_result() if client.get_state() == GoalStatus.SUCCEEDED: print "Succeeded" else: print "Failed" def Close(self, arm='left_arm'): if arm == 'left_arm': client = self.l_client elif arm == 'right_arm': client = self.r_client self.state.command.position = 0. self.state.command.max_effort = 50. rospy.logout('Close the gripper') client.send_goal(self.state) client.wait_for_result() if client.get_state() == GoalStatus.SUCCEEDED: print "Succeeded" else: print "Failed" class ar_manipulation(): def __init__(self): rospy.init_node("ar_manipulation") # rospy.Subscriber("/ar_pose_markers", ARMarkers, self.read_markers_cb) # rospy.Subscriber("/ar_object_name", String, self.marker_lookup_cb) rospy.Subscriber("/ar_object_name", StringArray, self.marker_lookup_cb) rospy.Subscriber("/put_back_tool", String, self.put_back_tool_cb) self.pub_rate = rospy.Rate(10) self.torso = torso() self.head = head() self.gripper = gripper() self.tf_listener = tf.TransformListener() self.cs = pr2cs.ControllerSwitcher() self.pr2_init = False self.search_tag = False self.found_tag = False self.grasp_object = False # Load JTcontroller self.r_arm_cart = pr2arm.create_pr2_arm('r', pr2arm.PR2ArmJTranspose, controller_name="%s_cart", timeout=0) self.l_arm_cart = pr2arm.create_pr2_arm('l', pr2arm.PR2ArmJTranspose, controller_name="%s_cart", timeout=0) # Load Joint space controller self.r_arm = pr2arm.create_pr2_arm('r', pr2arm.PR2ArmJointTrajectory, controller_name="%s_arm_controller", timeout=0) self.l_arm = pr2arm.create_pr2_arm('l', pr2arm.PR2ArmJointTrajectory, controller_name="%s_arm_controller", timeout=0) self.epc = eptc.EPC('linear_move') self.time_step = 1/20. def marker_lookup_cb(self,msg): self.tool = msg.data[0] if self.tool == 'shaver' or self.tool == 'scratcher': rospy.logout('Receive request to find tag for '+self.tool) self.marker_frame = '/ar_'+self.tool self.arm = msg.data[1] self.search_tag = True else: print 'no valid marker found' def put_back_tool_cb(self,msg): duration=10. self.arm = msg.data self.switch_arm() self.arm_controller.wait_for_ep() if self.grasp_object: rospy.logout("Putting back the object") ep_cur = self.arm_controller.get_ep() ep1 = copy.deepcopy(self.tool_ep) ep1[0][2] +=.2 self.epc_move_arm(self.arm_controller, ep_cur, ep1, duration) self.epc_move_arm(self.arm_controller, ep1, self.tool_ep, duration) self.gripper.Open(self.arm) time.sleep(2.) self.epc_move_arm(self.arm_controller, self.tool_ep, ep1, duration) self.grasp_object = False def switch_arm(self): if self.arm == 'left_arm': side = 'l' self.arm_controller = self.l_arm_cart elif self.arm == 'right_arm': side = 'r' self.arm_controller = self.r_arm_cart with self.arm_controller.lock: self.arm_controller.ep = None self.cs.carefree_switch(side, '%s_cart', # "$(find hrl_pr2_arms)/params/j_transpose_params_low.yaml") "$(find hrl_pr2_arms)/params/j_transpose_params_high.yaml") def get_angles(self): self.r_angle = self.r_arm.get_joint_angles() self.l_angle = self.l_arm.get_joint_angles() def epc_move_arm(self, arm, ep1, ep2, duration=10.): self.t_vals = eptc.min_jerk_traj(duration/self.time_step) traj = arm.interpolate_ep(ep1, ep2, self.t_vals) tc = eptc.EPTrajectoryControl(arm, traj) self.epc.epc_motion(tc, self.time_step) def setup_pr2_init_pose(self): rospy.logout('Initializing the Robot..'+self.tool) self.head.set_pose([0.15,0.,0.]) self.torso.down() self.get_angles() duration=5. self.t_vals = eptc.min_jerk_traj(duration/self.time_step) self.r_ep =np.array([-1.397, 0.375, -1.740, -2.122, -1.966, -1.680, -2.491]) self.l_ep =np.array([1.397, 0.375, 1.740, -2.122, 1.966, -1.680, -3.926]) # self.r_ep =np.array([-1.397, 0.375, -1.740, -2.122, -1.966, -1.680, .651]) # self.l_ep =np.array([1.397, 0.375, 1.740, -2.122, 1.966, -1.680, -.784]) self.cs.carefree_switch('r', '%s_arm_controller') self.cs.carefree_switch('l', '%s_arm_controller') self.r_arm.wait_for_ep() self.l_arm.wait_for_ep() self.epc_move_arm(self.r_arm, self.r_angle, self.r_ep, duration) self.epc_move_arm(self.l_arm, self.l_angle, self.l_ep, duration) self.pr2_init = True def detect_artag(self): try: rospy.logout("Finding the AR tag..") self.pub_rate.sleep() (self.ar_pos, rot) = self.tf_listener.lookupTransform("/torso_lift_link", self.marker_frame, rospy.Time(0)) self.pub_rate.sleep() gripper_rot = hrl_tr.rotY(math.pi/2) #gripper facing -z direction self.ar_rot = hrl_tr.quaternion_to_matrix(rot)*gripper_rot rospy.logout("Found AR tag!\nPosition: "+pplist(self.ar_pos)+"\nQuaterion: "+pplist(rot)) self.ar_ep = [] self.ar_ep.append(np.matrix(self.ar_pos).T) self.ar_ep.append(self.ar_rot) self.found_tag = True except: rospy.logout('AARtagDetect: Transform failed for '+self.tool) return False def fetch_tool(self, duration=5.): rospy.logout("Moving the "+self.arm+" to fetch the object") self.switch_arm() self.arm_controller.wait_for_ep() ep_cur = self.arm_controller.get_ep() ep1 = copy.deepcopy(self.ar_ep) ep1[0][2]=ep_cur[0][2]+.1 self.epc_move_arm(self.arm_controller, ep_cur, ep1, 10) self.gripper.Open(self.arm) time.sleep(2.) self.tool_ep = copy.deepcopy(self.ar_ep) # self.tool_ep[1] = np.mat(tf_trans.euler_matrix(0, np.pi/2, 0))[:3,:3] # Kinect on Monty has not been calibrated! #Offset due to Kinect error self.tool_ep[0][0]-= .02 # self.tool_ep[0][1]+= .02 self.tool_ep[0][2]+= .025 # self.tool_ep[0][2]-= .05 self.epc_move_arm(self.arm_controller, ep1, self.tool_ep, 15) self.gripper.Close(self.arm) time.sleep(2.) self.epc_move_arm(self.arm_controller, self.tool_ep, ep1, 15) self.found_tag = False self.search_tag = False self.pr2_init = False self.grasp_object = True def pplist(list): return ' '.join(['%2.3f'%x for x in list]) if __name__ == "__main__": arm = ar_manipulation() # arm.get_angles() while not rospy.is_shutdown(): if arm.search_tag: if not arm.pr2_init: arm.setup_pr2_init_pose() arm.detect_artag() if arm.found_tag: arm.fetch_tool()
ajibawa-2023/Python-Code-Large/train/row_99639
206
299
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0067, 0.0033, 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_99639:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.01, 0.0033, 0, 0.66, 0.0417, 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_pr2_arms\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0134, 0.0033, 0, 0.66, 0.0833, 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_generic_arms\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0167, 0.0033, 0, 0.66, 0.125, 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_lib\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0201, 0.0033, 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(\"hrl_msgs\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0234, 0.0033, 0, 0.66, 0.2083, 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(\"ar_pose\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Import_L9_C0", "label": "math import math, time, copy", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0301, 0.0033, 0, 0.66, 0.25, 526, 0, 3, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math", "time", "copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math, time, copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Import_L10_C0", "label": "numpy import np", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0334, 0.0033, 0, 0.66, 0.2917, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Import_L11_C0", "label": "tf import tf, rospy, actionlib", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0368, 0.0033, 0, 0.66, 0.3333, 951, 0, 3, 0, 0, 951, 0, 0], "semantic": {"name": "tf", "arg_names": [], "import_names": ["tf", "rospy", "actionlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf, rospy, actionlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Import_L12_C0", "label": "hrl_lib.transforms import hrl_tr", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0401, 0.0033, 0, 0.66, 0.375, 82, 0, 1, 0, 0, 82, 0, 0], "semantic": {"name": "hrl_lib.transforms", "arg_names": [], "import_names": ["hrl_tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.transforms as hrl_tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Import_L13_C0", "label": "tf.transformations import tf_trans", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 0.0033, 0, 0.66, 0.4167, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tf_trans"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tf_trans"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Import_L14_C0", "label": "hrl_pr2_arms.pr2_controller_switcher import pr2cs", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0468, 0.0033, 0, 0.66, 0.4583, 395, 0, 1, 0, 0, 395, 0, 0], "semantic": {"name": "hrl_pr2_arms.pr2_controller_switcher", "arg_names": [], "import_names": ["pr2cs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_pr2_arms.pr2_controller_switcher as pr2cs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Import_L15_C0", "label": "hrl_pr2_arms.pr2_arm import pr2arm", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0502, 0.0033, 0, 0.66, 0.5, 253, 0, 1, 0, 0, 253, 0, 0], "semantic": {"name": "hrl_pr2_arms.pr2_arm", "arg_names": [], "import_names": ["pr2arm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_pr2_arms.pr2_arm as pr2arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Import_L16_C0", "label": "hrl_generic_arms.ep_trajectory_controller import eptc", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0535, 0.0033, 0, 0.66, 0.5417, 641, 0, 1, 0, 0, 641, 0, 0], "semantic": {"name": "hrl_generic_arms.ep_trajectory_controller", "arg_names": [], "import_names": ["eptc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_generic_arms.ep_trajectory_controller as eptc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:ImportFrom_L18_C0", "label": "from actionlib_msgs.msg import *", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0602, 0.0033, 0, 0.66, 0.5833, 245, 0, 1, 0, 0, 245, 0, 0], "semantic": {"name": "actionlib_msgs.msg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from actionlib_msgs.msg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:ImportFrom_L19_C0", "label": "from pr2_controllers_msgs.msg import *", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0635, 0.0033, 0, 0.66, 0.625, 457, 0, 1, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:ImportFrom_L20_C0", "label": "from ar_pose.msg import ARMarkers", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0669, 0.0033, 0, 0.66, 0.6667, 554, 0, 1, 0, 0, 554, 0, 0], "semantic": {"name": "ar_pose.msg", "arg_names": [], "import_names": ["ARMarkers"], "rhs_call_name": "", "annotation": ""}, "snippet": "from ar_pose.msg import ARMarkers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:ImportFrom_L21_C0", "label": "from std_msgs.msg import String, Bool", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0702, 0.0033, 0, 0.66, 0.7083, 366, 0, 2, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["String", "Bool"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import String, Bool"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:ImportFrom_L22_C0", "label": "from hrl_msgs.msg import StringArray", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0736, 0.0033, 0, 0.66, 0.75, 513, 0, 1, 0, 0, 513, 0, 0], "semantic": {"name": "hrl_msgs.msg", "arg_names": [], "import_names": ["StringArray"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_msgs.msg import StringArray"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L25_C0", "label": "head", "type": "class", "loc": [25, 46], "level": 0, "parent": null, "vector": [3, 0, 0.1187, 0.0736, 0, 0.66, 0.7917, 217, 0, 2, 0, 0, 0, 0, 10], "semantic": {"name": "head", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class head():\n def __init__(self):\n #\trospy.init_node('move_the_head', anonymous=True)\n self.client = actionlib.SimpleActionClient('/head_traj_controller/point_head_action', \n PointHeadAction)\n self.client.wait_for_server()\n self.goal = PointHeadGoal()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L26_C4", "label": "__init__", "type": "function", "loc": [26, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L25_C0", "vector": [2, 1, 0.0953, 0.0201, 1, 0.33, 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 #\trospy.init_node('move_the_head', anonymous=True)\n self.client = actionlib.SimpleActionClient('/head_traj_controller/point_head_action', \n PointHeadAction)\n self.client.wait_for_server()\n self.goal = PointHeadGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L28_C8", "label": "self.client = SimpleActionClient()", "type": "assigned_variable", "loc": [28, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L26_C4", "vector": [14, 2, 0.0953, 0.0067, 2, 0.98, 0.0, 349, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.client = actionlib.SimpleActionClient('/head_traj_controller/point_head_action', \n PointHeadAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L30_C8", "label": "wait_for_server()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L26_C4", "vector": [8, 2, 0.1003, 0.0033, 2, 0.98, 0.5, 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.client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L31_C8", "label": "self.goal = PointHeadGoal()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L26_C4", "vector": [14, 2, 0.1037, 0.0033, 2, 0.98, 1.0, 143, 3, 0, 0, 0, 479, 10, 1], "semantic": {"name": "self.goal", "arg_names": [], "import_names": [], "rhs_call_name": "PointHeadGoal", "annotation": ""}, "snippet": " self.goal = PointHeadGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L33_C4", "label": "set_pose", "type": "function", "loc": [33, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L25_C0", "vector": [2, 1, 0.1321, 0.0468, 1, 0.33, 1.0, 371, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "set_pose", "arg_names": ["self", "pos"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_pose(self, pos):\n self.goal.target.header.frame_id = 'torso_lift_link'\n self.goal.target.point.x = pos[0]\n self.goal.target.point.y = pos[1]\n self.goal.target.point.z = pos[2]\n self.goal.min_duration = rospy.Duration(3.)\n rospy.logout('Sending Head Goal')\n self.client.send_goal(self.goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L34_C8", "label": "self.goal.target.header.frame_id =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L33_C4", "vector": [14, 2, 0.1137, 0.0033, 2, 0.81, 0.0, 413, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.goal.target.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.goal.target.header.frame_id = 'torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L35_C8", "label": "self.goal.target.point.x =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L33_C4", "vector": [14, 2, 0.1171, 0.0033, 2, 0.81, 0.125, 785, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.goal.target.point.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.goal.target.point.x = pos[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L36_C8", "label": "self.goal.target.point.y =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L33_C4", "vector": [14, 2, 0.1204, 0.0033, 2, 0.81, 0.25, 853, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.goal.target.point.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.goal.target.point.y = pos[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L37_C8", "label": "self.goal.target.point.z =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L33_C4", "vector": [14, 2, 0.1237, 0.0033, 2, 0.81, 0.375, 227, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.goal.target.point.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.goal.target.point.z = pos[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L38_C8", "label": "self.goal.min_duration = Duration()", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L33_C4", "vector": [14, 2, 0.1271, 0.0033, 2, 0.81, 0.5, 446, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "self.goal.min_duration", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " self.goal.min_duration = rospy.Duration(3.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L39_C8", "label": "logout()", "type": "expression", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L33_C4", "vector": [8, 2, 0.1304, 0.0033, 2, 0.81, 0.625, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('Sending Head Goal')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L40_C8", "label": "send_goal()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L33_C4", "vector": [8, 2, 0.1338, 0.0033, 2, 0.81, 0.75, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.client.send_goal(self.goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L41_C8", "label": "wait_for_result()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L33_C4", "vector": [8, 2, 0.1371, 0.0033, 2, 0.81, 0.875, 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.client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L43_C8", "label": "if", "type": "if", "loc": [43, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L33_C4", "vector": [4, 2, 0.1488, 0.0134, 2, 0.81, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.client.get_state() == GoalStatus.SUCCEEDED:\n print(\"Succeeded\")\n else:\n print(\"Failed\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L44_C12", "label": "print()", "type": "expression", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L43_C8", "vector": [8, 3, 0.1472, 0.0033, 3, 0.25, 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_99639:Expr_L46_C12", "label": "print()", "type": "expression", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L43_C8", "vector": [8, 3, 0.1538, 0.0033, 3, 0.25, 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_99639:ClassDef_L49_C0", "label": "torso", "type": "class", "loc": [49, 68], "level": 0, "parent": null, "vector": [3, 0, 0.1957, 0.0669, 0, 0.66, 0.8333, 128, 0, 2, 0, 0, 0, 0, 10], "semantic": {"name": "torso", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class torso():\n def __init__(self):\n self.client = actionlib.SimpleActionClient('/torso_controller/position_joint_action',\n SingleJointPositionAction)\n self.client.wait_for_server()\n self.pos = SingleJointPositionGoal()\n\n def down(self):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L50_C4", "label": "__init__", "type": "function", "loc": [50, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L49_C0", "vector": [2, 1, 0.1739, 0.0167, 1, 0.59, 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 self.client = actionlib.SimpleActionClient('/torso_controller/position_joint_action',\n SingleJointPositionAction)\n self.client.wait_for_server()\n self.pos = SingleJointPositionGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L51_C8", "label": "self.client = SimpleActionClient()", "type": "assigned_variable", "loc": [51, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L50_C4", "vector": [14, 2, 0.1722, 0.0067, 2, 0.6, 0.0, 349, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.client = actionlib.SimpleActionClient('/torso_controller/position_joint_action',\n SingleJointPositionAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L53_C8", "label": "wait_for_server()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L50_C4", "vector": [8, 2, 0.1773, 0.0033, 2, 0.6, 0.5, 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.client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L54_C8", "label": "self.pos = SingleJointPositionGoal()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L50_C4", "vector": [14, 2, 0.1806, 0.0033, 2, 0.6, 1.0, 283, 3, 0, 0, 0, 974, 10, 1], "semantic": {"name": "self.pos", "arg_names": [], "import_names": [], "rhs_call_name": "SingleJointPositionGoal", "annotation": ""}, "snippet": " self.pos = SingleJointPositionGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L56_C4", "label": "down", "type": "function", "loc": [56, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L49_C0", "vector": [2, 1, 0.2074, 0.0435, 1, 0.59, 1.0, 315, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "down", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def down(self):\n #\t\tself.pos.position = 0.01\n self.pos.position = 0.15\n self.pos.min_duration = rospy.Duration(2.)\n self.pos.max_velocity = 1.\n rospy.logout('Sending torso down')\n self.client.send_goal(self.pos)\n self.client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L58_C8", "label": "self.pos.position =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L56_C4", "vector": [14, 2, 0.194, 0.0033, 2, 0.2, 0.0, 283, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.pos.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pos.position = 0.15"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L59_C8", "label": "self.pos.min_duration = Duration()", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L56_C4", "vector": [14, 2, 0.1973, 0.0033, 2, 0.2, 0.1667, 592, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "self.pos.min_duration", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " self.pos.min_duration = rospy.Duration(2.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L60_C8", "label": "self.pos.max_velocity =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L56_C4", "vector": [14, 2, 0.2007, 0.0033, 2, 0.2, 0.3333, 265, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.pos.max_velocity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pos.max_velocity = 1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L61_C8", "label": "logout()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L56_C4", "vector": [8, 2, 0.204, 0.0033, 2, 0.2, 0.5, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('Sending torso down')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L62_C8", "label": "send_goal()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L56_C4", "vector": [8, 2, 0.2074, 0.0033, 2, 0.2, 0.6667, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.client.send_goal(self.pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L63_C8", "label": "wait_for_result()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L56_C4", "vector": [8, 2, 0.2107, 0.0033, 2, 0.2, 0.8333, 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.client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L65_C8", "label": "if", "type": "if", "loc": [65, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L56_C4", "vector": [4, 2, 0.2224, 0.0134, 2, 0.2, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.client.get_state() == GoalStatus.SUCCEEDED:\n print(\"Succeeded\")\n else:\n print(\"Failed\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L66_C12", "label": "print()", "type": "expression", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L65_C8", "vector": [8, 3, 0.2207, 0.0033, 3, 0.16, 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_99639:Expr_L68_C12", "label": "print()", "type": "expression", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L65_C8", "vector": [8, 3, 0.2274, 0.0033, 3, 0.16, 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_99639:ClassDef_L71_C0", "label": "gripper", "type": "class", "loc": [71, 112], "level": 0, "parent": null, "vector": [3, 0, 0.306, 0.1405, 0, 0.66, 0.875, 378, 0, 3, 0, 0, 0, 0, 17], "semantic": {"name": "gripper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class gripper():\n def __init__(self):\n self.r_client = actionlib.SimpleActionClient('r_gripper_controller/gripper_action',\n Pr2GripperCommandAction)\n self.r_client.wait_for_server()\n self.l_client = actionlib.SimpleActionClient('l_gripper_controller/gripper_action',\n Pr2GripperCommandAction)\n self.r_client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L72_C4", "label": "__init__", "type": "function", "loc": [72, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L71_C0", "vector": [2, 1, 0.2525, 0.0268, 1, 0.85, 0.0, 555, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.r_client = actionlib.SimpleActionClient('r_gripper_controller/gripper_action',\n Pr2GripperCommandAction)\n self.r_client.wait_for_server()\n self.l_client = actionlib.SimpleActionClient('l_gripper_controller/gripper_action',\n Pr2GripperCommandAction)\n self.r_client.wait_for_server()\n self.state = Pr2GripperCommandGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L73_C8", "label": "self.r_client = SimpleActionClient()", "type": "assigned_variable", "loc": [73, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L72_C4", "vector": [14, 2, 0.2458, 0.0067, 2, 0.94, 0.0, 186, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.r_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.r_client = actionlib.SimpleActionClient('r_gripper_controller/gripper_action',\n Pr2GripperCommandAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L75_C8", "label": "wait_for_server()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L72_C4", "vector": [8, 2, 0.2508, 0.0033, 2, 0.94, 0.25, 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.r_client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L76_C8", "label": "self.l_client = SimpleActionClient()", "type": "assigned_variable", "loc": [76, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L72_C4", "vector": [14, 2, 0.2559, 0.0067, 2, 0.94, 0.5, 191, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.l_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.l_client = actionlib.SimpleActionClient('l_gripper_controller/gripper_action',\n Pr2GripperCommandAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L78_C8", "label": "wait_for_server()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L72_C4", "vector": [8, 2, 0.2609, 0.0033, 2, 0.94, 0.75, 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.r_client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L79_C8", "label": "self.state = Pr2GripperCommandGoal()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L72_C4", "vector": [14, 2, 0.2642, 0.0033, 2, 0.94, 1.0, 765, 3, 0, 0, 0, 981, 10, 1], "semantic": {"name": "self.state", "arg_names": [], "import_names": [], "rhs_call_name": "Pr2GripperCommandGoal", "annotation": ""}, "snippet": " self.state = Pr2GripperCommandGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L81_C4", "label": "Open", "type": "function", "loc": [81, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L71_C0", "vector": [2, 1, 0.2943, 0.0502, 1, 0.85, 0.5, 362, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "Open", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def Open(self, arm='left_arm'):\n if arm == 'left_arm':\n client = self.l_client\n elif arm == 'right_arm':\n client = self.r_client\n\n self.state.command.position = .07\n self.state.command.max_effort = -1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L82_C8", "label": "if", "type": "if", "loc": [82, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L81_C4", "vector": [4, 2, 0.2793, 0.0134, 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 arm == 'left_arm':\n client = self.l_client\n elif arm == 'right_arm':\n client = self.r_client"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L83_C12", "label": "client =", "type": "assigned_variable", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L82_C8", "vector": [14, 3, 0.2776, 0.0033, 3, 0.41, 0.0, 608, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " client = self.l_client"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L84_C8", "label": "if", "type": "if", "loc": [84, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L82_C8", "vector": [4, 3, 0.2826, 0.0067, 3, 0.41, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif arm == 'right_arm':\n client = self.r_client"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L85_C12", "label": "client =", "type": "assigned_variable", "loc": [85, 85], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L84_C8", "vector": [14, 4, 0.2843, 0.0033, 4, 0.02, 0.0, 608, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " client = self.r_client"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L87_C8", "label": "self.state.command.position =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L81_C4", "vector": [14, 2, 0.291, 0.0033, 2, 0.43, 0.1667, 150, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.state.command.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.state.command.position = .07"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L88_C8", "label": "self.state.command.max_effort =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L81_C4", "vector": [14, 2, 0.2943, 0.0033, 2, 0.43, 0.3333, 480, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.state.command.max_effort", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.state.command.max_effort = -1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L89_C8", "label": "logout()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L81_C4", "vector": [8, 2, 0.2977, 0.0033, 2, 0.43, 0.5, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('Open the gripper')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L90_C8", "label": "send_goal()", "type": "expression", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L81_C4", "vector": [8, 2, 0.301, 0.0033, 2, 0.43, 0.6667, 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(self.state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L91_C8", "label": "wait_for_result()", "type": "expression", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L81_C4", "vector": [8, 2, 0.3043, 0.0033, 2, 0.43, 0.8333, 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_99639:If_L92_C8", "label": "if", "type": "if", "loc": [92, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L81_C4", "vector": [4, 2, 0.3127, 0.0134, 2, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if client.get_state() == GoalStatus.SUCCEEDED:\n print(\"Succeeded\")\n else:\n print(\"Failed\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L93_C12", "label": "print()", "type": "expression", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L92_C8", "vector": [8, 3, 0.311, 0.0033, 3, 0.5, 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_99639:Expr_L95_C12", "label": "print()", "type": "expression", "loc": [95, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L92_C8", "vector": [8, 3, 0.3177, 0.0033, 3, 0.5, 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_99639:FunctionDef_L98_C4", "label": "Close", "type": "function", "loc": [98, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L71_C0", "vector": [2, 1, 0.3512, 0.0502, 1, 0.85, 1.0, 52, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "Close", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def Close(self, arm='left_arm'):\t\n if arm == 'left_arm':\n client = self.l_client\n elif arm == 'right_arm':\n client = self.r_client\n\n self.state.command.position = 0.\n self.state.command.max_effort = 50."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L99_C8", "label": "if", "type": "if", "loc": [99, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L98_C4", "vector": [4, 2, 0.3361, 0.0134, 2, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'left_arm':\n client = self.l_client\n elif arm == 'right_arm':\n client = self.r_client"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L100_C12", "label": "client =", "type": "assigned_variable", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L99_C8", "vector": [14, 3, 0.3344, 0.0033, 3, 0.71, 0.0, 608, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " client = self.l_client"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L101_C8", "label": "if", "type": "if", "loc": [101, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L99_C8", "vector": [4, 3, 0.3395, 0.0067, 3, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif arm == 'right_arm':\n client = self.r_client"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L102_C12", "label": "client =", "type": "assigned_variable", "loc": [102, 102], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L101_C8", "vector": [14, 4, 0.3411, 0.0033, 4, 0.16, 0.0, 608, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " client = self.r_client"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L104_C8", "label": "self.state.command.position =", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L98_C4", "vector": [14, 2, 0.3478, 0.0033, 2, 0.73, 0.1667, 150, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.state.command.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.state.command.position = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L105_C8", "label": "self.state.command.max_effort =", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L98_C4", "vector": [14, 2, 0.3512, 0.0033, 2, 0.73, 0.3333, 480, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.state.command.max_effort", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.state.command.max_effort = 50."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L106_C8", "label": "logout()", "type": "expression", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L98_C4", "vector": [8, 2, 0.3545, 0.0033, 2, 0.73, 0.5, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('Close the gripper')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L107_C8", "label": "send_goal()", "type": "expression", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L98_C4", "vector": [8, 2, 0.3579, 0.0033, 2, 0.73, 0.6667, 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(self.state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L108_C8", "label": "wait_for_result()", "type": "expression", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L98_C4", "vector": [8, 2, 0.3612, 0.0033, 2, 0.73, 0.8333, 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_99639:If_L109_C8", "label": "if", "type": "if", "loc": [109, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L98_C4", "vector": [4, 2, 0.3696, 0.0134, 2, 0.73, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if client.get_state() == GoalStatus.SUCCEEDED:\n print(\"Succeeded\")\n else:\n print(\"Failed\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L110_C12", "label": "print()", "type": "expression", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L109_C8", "vector": [8, 3, 0.3679, 0.0033, 3, 0.19, 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_99639:Expr_L112_C12", "label": "print()", "type": "expression", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L109_C8", "vector": [8, 3, 0.3746, 0.0033, 3, 0.19, 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_99639:ClassDef_L115_C0", "label": "ar_manipulation", "type": "class", "loc": [115, 279], "level": 0, "parent": null, "vector": [3, 0, 0.6589, 0.5518, 0, 0.66, 0.9167, 262, 0, 9, 0, 0, 0, 0, 73], "semantic": {"name": "ar_manipulation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ar_manipulation():\n def __init__(self):\n rospy.init_node(\"ar_manipulation\")\n#\t\trospy.Subscriber(\"/ar_pose_markers\", ARMarkers, self.read_markers_cb)\n#\t\trospy.Subscriber(\"/ar_object_name\", String, self.marker_lookup_cb)\n rospy.Subscriber(\"/ar_object_name\", StringArray, self.marker_lookup_cb)\n rospy.Subscriber(\"/put_back_tool\", String, self.put_back_tool_cb)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "label": "__init__", "type": "function", "loc": [116, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L115_C0", "vector": [2, 1, 0.4415, 0.1104, 1, 0.46, 0.0, 555, 0, 1, 0, 0, 0, 0, 14], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n rospy.init_node(\"ar_manipulation\")\n#\t\trospy.Subscriber(\"/ar_pose_markers\", ARMarkers, self.read_markers_cb)\n#\t\trospy.Subscriber(\"/ar_object_name\", String, self.marker_lookup_cb)\n rospy.Subscriber(\"/ar_object_name\", StringArray, self.marker_lookup_cb)\n rospy.Subscriber(\"/put_back_tool\", String, self.put_back_tool_cb)\n\n self.pub_rate = rospy.Rate(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L117_C8", "label": "init_node()", "type": "expression", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "vector": [8, 2, 0.3913, 0.0033, 2, 0.2, 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(\"ar_manipulation\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L120_C8", "label": "Subscriber()", "type": "expression", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "vector": [8, 2, 0.4013, 0.0033, 2, 0.2, 0.0556, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber(\"/ar_object_name\", StringArray, self.marker_lookup_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L121_C8", "label": "Subscriber()", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "vector": [8, 2, 0.4047, 0.0033, 2, 0.2, 0.1111, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber(\"/put_back_tool\", String, self.put_back_tool_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L123_C8", "label": "self.pub_rate = Rate()", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "vector": [14, 2, 0.4114, 0.0033, 2, 0.2, 0.1667, 680, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "self.pub_rate", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " self.pub_rate = rospy.Rate(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L124_C8", "label": "self.torso = torso()", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "vector": [14, 2, 0.4147, 0.0033, 2, 0.2, 0.2222, 30, 3, 0, 0, 0, 128, 10, 1], "semantic": {"name": "self.torso", "arg_names": [], "import_names": [], "rhs_call_name": "torso", "annotation": ""}, "snippet": " self.torso = torso()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L125_C8", "label": "self.head = head()", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "vector": [14, 2, 0.4181, 0.0033, 2, 0.2, 0.2778, 35, 3, 0, 0, 0, 217, 10, 1], "semantic": {"name": "self.head", "arg_names": [], "import_names": [], "rhs_call_name": "head", "annotation": ""}, "snippet": " self.head = head()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L126_C8", "label": "self.gripper = gripper()", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "vector": [14, 2, 0.4214, 0.0033, 2, 0.2, 0.3333, 233, 3, 0, 0, 0, 378, 10, 1], "semantic": {"name": "self.gripper", "arg_names": [], "import_names": [], "rhs_call_name": "gripper", "annotation": ""}, "snippet": " self.gripper = gripper()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L127_C8", "label": "self.tf_listener = TransformListener()", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "vector": [14, 2, 0.4247, 0.0033, 2, 0.2, 0.3889, 639, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tf_listener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.tf_listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L128_C8", "label": "self.cs = ControllerSwitcher()", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "vector": [14, 2, 0.4281, 0.0033, 2, 0.2, 0.4444, 23, 3, 0, 0, 0, 961, 10, 1], "semantic": {"name": "self.cs", "arg_names": [], "import_names": [], "rhs_call_name": "ControllerSwitcher", "annotation": ""}, "snippet": " self.cs = pr2cs.ControllerSwitcher()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L129_C8", "label": "self.pr2_init =", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "vector": [14, 2, 0.4314, 0.0033, 2, 0.2, 0.5, 725, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.pr2_init", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pr2_init = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L130_C8", "label": "self.search_tag =", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "vector": [14, 2, 0.4348, 0.0033, 2, 0.2, 0.5556, 96, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.search_tag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.search_tag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L131_C8", "label": "self.found_tag =", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "vector": [14, 2, 0.4381, 0.0033, 2, 0.2, 0.6111, 141, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.found_tag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.found_tag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L132_C8", "label": "self.grasp_object =", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "vector": [14, 2, 0.4415, 0.0033, 2, 0.2, 0.6667, 743, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.grasp_object", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grasp_object = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L135_C8", "label": "self.r_arm_cart = create_pr2_arm()", "type": "assigned_variable", "loc": [135, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "vector": [14, 2, 0.4532, 0.0067, 2, 0.2, 0.7222, 750, 3, 4, 0, 0, 318, 10, 1], "semantic": {"name": "self.r_arm_cart", "arg_names": [], "import_names": [], "rhs_call_name": "create_pr2_arm", "annotation": ""}, "snippet": " self.r_arm_cart = pr2arm.create_pr2_arm('r', pr2arm.PR2ArmJTranspose,\n controller_name=\"%s_cart\", timeout=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L137_C8", "label": "self.l_arm_cart = create_pr2_arm()", "type": "assigned_variable", "loc": [137, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "vector": [14, 2, 0.4599, 0.0067, 2, 0.2, 0.7778, 774, 3, 4, 0, 0, 318, 10, 1], "semantic": {"name": "self.l_arm_cart", "arg_names": [], "import_names": [], "rhs_call_name": "create_pr2_arm", "annotation": ""}, "snippet": " self.l_arm_cart = pr2arm.create_pr2_arm('l', pr2arm.PR2ArmJTranspose,\n controller_name=\"%s_cart\", timeout=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L140_C8", "label": "self.r_arm = create_pr2_arm()", "type": "assigned_variable", "loc": [140, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "vector": [14, 2, 0.4716, 0.01, 2, 0.2, 0.8333, 958, 3, 4, 0, 0, 318, 10, 1], "semantic": {"name": "self.r_arm", "arg_names": [], "import_names": [], "rhs_call_name": "create_pr2_arm", "annotation": ""}, "snippet": " self.r_arm = pr2arm.create_pr2_arm('r', pr2arm.PR2ArmJointTrajectory,\n controller_name=\"%s_arm_controller\",\n timeout=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L143_C8", "label": "self.l_arm = create_pr2_arm()", "type": "assigned_variable", "loc": [143, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "vector": [14, 2, 0.4816, 0.01, 2, 0.2, 0.8889, 509, 3, 4, 0, 0, 318, 10, 1], "semantic": {"name": "self.l_arm", "arg_names": [], "import_names": [], "rhs_call_name": "create_pr2_arm", "annotation": ""}, "snippet": " self.l_arm = pr2arm.create_pr2_arm('l', pr2arm.PR2ArmJointTrajectory,\n controller_name=\"%s_arm_controller\",\n timeout=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L147_C8", "label": "self.epc = EPC()", "type": "assigned_variable", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "vector": [14, 2, 0.4916, 0.0033, 2, 0.2, 0.9444, 319, 3, 1, 0, 0, 417, 10, 1], "semantic": {"name": "self.epc", "arg_names": [], "import_names": [], "rhs_call_name": "EPC", "annotation": ""}, "snippet": " self.epc = eptc.EPC('linear_move')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L148_C8", "label": "self.time_step =", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "vector": [14, 2, 0.495, 0.0033, 2, 0.2, 1.0, 358, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.time_step", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.time_step = 1/20."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L151_C4", "label": "marker_lookup_cb", "type": "function", "loc": [151, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L115_C0", "vector": [2, 1, 0.5184, 0.0301, 1, 0.46, 0.125, 347, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "marker_lookup_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def marker_lookup_cb(self,msg):\n self.tool = msg.data[0]\n if self.tool == 'shaver' or self.tool == 'scratcher':\n rospy.logout('Receive request to find tag for '+self.tool)\n self.marker_frame = '/ar_'+self.tool\n self.arm = msg.data[1]\n self.search_tag = True\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L152_C8", "label": "self.tool =", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L151_C4", "vector": [14, 2, 0.5084, 0.0033, 2, 0.87, 0.0, 328, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tool", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tool = msg.data[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L153_C8", "label": "if", "type": "if", "loc": [153, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L151_C4", "vector": [4, 2, 0.5217, 0.0234, 2, 0.87, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.tool == 'shaver' or self.tool == 'scratcher':\n rospy.logout('Receive request to find tag for '+self.tool)\n self.marker_frame = '/ar_'+self.tool\n self.arm = msg.data[1]\n self.search_tag = True\n else:\n print('no valid marker found')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L154_C12", "label": "logout()", "type": "expression", "loc": [154, 154], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L153_C8", "vector": [8, 3, 0.5151, 0.0033, 3, 0.14, 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('Receive request to find tag for '+self.tool)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L155_C12", "label": "self.marker_frame =", "type": "assigned_variable", "loc": [155, 155], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L153_C8", "vector": [14, 3, 0.5184, 0.0033, 3, 0.14, 0.25, 695, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.marker_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.marker_frame = '/ar_'+self.tool"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L156_C12", "label": "self.arm =", "type": "assigned_variable", "loc": [156, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L153_C8", "vector": [14, 3, 0.5217, 0.0033, 3, 0.14, 0.5, 720, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm = msg.data[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L157_C12", "label": "self.search_tag =", "type": "assigned_variable", "loc": [157, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L153_C8", "vector": [14, 3, 0.5251, 0.0033, 3, 0.14, 0.75, 96, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.search_tag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.search_tag = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L159_C12", "label": "print()", "type": "expression", "loc": [159, 159], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L153_C8", "vector": [8, 3, 0.5318, 0.0033, 3, 0.14, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('no valid marker found')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L162_C4", "label": "put_back_tool_cb", "type": "function", "loc": [162, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L115_C0", "vector": [2, 1, 0.5686, 0.0569, 1, 0.46, 0.25, 822, 0, 2, 0, 0, 0, 0, 10], "semantic": {"name": "put_back_tool_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def put_back_tool_cb(self,msg):\n duration=10.\n self.arm = msg.data\n self.switch_arm()\n self.arm_controller.wait_for_ep()\n\n if self.grasp_object:\n rospy.logout(\"Putting back the object\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L163_C8", "label": "duration =", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L162_C4", "vector": [14, 2, 0.5452, 0.0033, 2, 0.64, 0.0, 242, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "duration", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " duration=10."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L164_C8", "label": "self.arm =", "type": "assigned_variable", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L162_C4", "vector": [14, 2, 0.5485, 0.0033, 2, 0.64, 0.25, 720, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm = msg.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L165_C8", "label": "switch_arm()", "type": "expression", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L162_C4", "vector": [8, 2, 0.5518, 0.0033, 2, 0.64, 0.5, 858, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "switch_arm", "arg_names": [], "import_names": [], "rhs_call_name": "switch_arm", "annotation": ""}, "snippet": " self.switch_arm()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L166_C8", "label": "wait_for_ep()", "type": "expression", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L162_C4", "vector": [8, 2, 0.5552, 0.0033, 2, 0.64, 0.75, 645, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_ep", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_ep", "annotation": ""}, "snippet": " self.arm_controller.wait_for_ep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L168_C8", "label": "if", "type": "if", "loc": [168, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L162_C4", "vector": [4, 2, 0.5786, 0.0368, 2, 0.64, 1.0, 0, 7, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.grasp_object:\n rospy.logout(\"Putting back the object\")\n ep_cur = self.arm_controller.get_ep()\n ep1 = copy.deepcopy(self.tool_ep)\n ep1[0][2] +=.2\n self.epc_move_arm(self.arm_controller, ep_cur, ep1, duration)\n self.epc_move_arm(self.arm_controller, ep1, self.tool_ep, duration)\n self.gripper.Open(self.arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L169_C12", "label": "logout()", "type": "expression", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L168_C8", "vector": [8, 3, 0.5652, 0.0033, 3, 0.3, 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(\"Putting back the object\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L170_C12", "label": "ep_cur = get_ep()", "type": "assigned_variable", "loc": [170, 170], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L168_C8", "vector": [14, 3, 0.5686, 0.0033, 3, 0.3, 0.125, 940, 3, 0, 0, 0, 563, 10, 1], "semantic": {"name": "ep_cur", "arg_names": [], "import_names": [], "rhs_call_name": "get_ep", "annotation": ""}, "snippet": " ep_cur = self.arm_controller.get_ep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L171_C12", "label": "ep1 = deepcopy()", "type": "assigned_variable", "loc": [171, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L168_C8", "vector": [14, 3, 0.5719, 0.0033, 3, 0.3, 0.25, 831, 3, 1, 0, 0, 44, 10, 1], "semantic": {"name": "ep1", "arg_names": [], "import_names": [], "rhs_call_name": "deepcopy", "annotation": ""}, "snippet": " ep1 = copy.deepcopy(self.tool_ep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L173_C12", "label": "epc_move_arm()", "type": "expression", "loc": [173, 173], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L168_C8", "vector": [8, 3, 0.5786, 0.0033, 3, 0.3, 0.375, 135, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "epc_move_arm", "arg_names": [], "import_names": [], "rhs_call_name": "epc_move_arm", "annotation": ""}, "snippet": " self.epc_move_arm(self.arm_controller, ep_cur, ep1, duration)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L174_C12", "label": "epc_move_arm()", "type": "expression", "loc": [174, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L168_C8", "vector": [8, 3, 0.5819, 0.0033, 3, 0.3, 0.5, 135, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "epc_move_arm", "arg_names": [], "import_names": [], "rhs_call_name": "epc_move_arm", "annotation": ""}, "snippet": " self.epc_move_arm(self.arm_controller, ep1, self.tool_ep, duration)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L175_C12", "label": "Open()", "type": "expression", "loc": [175, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L168_C8", "vector": [8, 3, 0.5853, 0.0033, 3, 0.3, 0.625, 362, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Open", "arg_names": [], "import_names": [], "rhs_call_name": "Open", "annotation": ""}, "snippet": " self.gripper.Open(self.arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L176_C12", "label": "sleep()", "type": "expression", "loc": [176, 176], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L168_C8", "vector": [8, 3, 0.5886, 0.0033, 3, 0.3, 0.75, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(2.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L177_C12", "label": "epc_move_arm()", "type": "expression", "loc": [177, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L168_C8", "vector": [8, 3, 0.592, 0.0033, 3, 0.3, 0.875, 135, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "epc_move_arm", "arg_names": [], "import_names": [], "rhs_call_name": "epc_move_arm", "annotation": ""}, "snippet": " self.epc_move_arm(self.arm_controller, self.tool_ep, ep1, duration)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L178_C12", "label": "self.grasp_object =", "type": "assigned_variable", "loc": [178, 178], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L168_C8", "vector": [14, 3, 0.5953, 0.0033, 3, 0.3, 1.0, 743, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.grasp_object", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grasp_object = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L181_C4", "label": "switch_arm", "type": "function", "loc": [181, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L115_C0", "vector": [2, 1, 0.6254, 0.0435, 1, 0.46, 0.375, 858, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "switch_arm", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def switch_arm(self):\n if self.arm == 'left_arm':\n side = 'l'\n self.arm_controller = self.l_arm_cart\n elif self.arm == 'right_arm':\n side = 'r'\n self.arm_controller = self.r_arm_cart\t\n with self.arm_controller.lock:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L182_C8", "label": "if", "type": "if", "loc": [182, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L181_C4", "vector": [4, 2, 0.6171, 0.0201, 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 self.arm == 'left_arm':\n side = 'l'\n self.arm_controller = self.l_arm_cart\n elif self.arm == 'right_arm':\n side = 'r'\n self.arm_controller = self.r_arm_cart\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L183_C12", "label": "side =", "type": "assigned_variable", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L182_C8", "vector": [14, 3, 0.612, 0.0033, 3, 0.6, 0.0, 814, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "side", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " side = 'l'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L184_C12", "label": "self.arm_controller =", "type": "assigned_variable", "loc": [184, 184], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L182_C8", "vector": [14, 3, 0.6154, 0.0033, 3, 0.6, 0.5, 562, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arm_controller", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_controller = self.l_arm_cart"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L185_C8", "label": "if", "type": "if", "loc": [185, 187], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L182_C8", "vector": [4, 3, 0.6221, 0.01, 3, 0.6, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.arm == 'right_arm':\n side = 'r'\n self.arm_controller = self.r_arm_cart\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L186_C12", "label": "side =", "type": "assigned_variable", "loc": [186, 186], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L185_C8", "vector": [14, 4, 0.6221, 0.0033, 4, 0.9, 0.0, 814, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "side", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " side = 'r'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L187_C12", "label": "self.arm_controller =", "type": "assigned_variable", "loc": [187, 187], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L185_C8", "vector": [14, 4, 0.6254, 0.0033, 4, 0.9, 1.0, 562, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arm_controller", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_controller = self.r_arm_cart\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L189_C12", "label": "self.arm_controller.ep =", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L181_C4", "vector": [14, 2, 0.6321, 0.0033, 2, 0.08, 0.0, 681, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.arm_controller.ep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_controller.ep = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L191_C8", "label": "carefree_switch()", "type": "expression", "loc": [191, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L181_C4", "vector": [8, 2, 0.6421, 0.01, 2, 0.08, 1.0, 300, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "carefree_switch", "arg_names": [], "import_names": [], "rhs_call_name": "carefree_switch", "annotation": ""}, "snippet": " self.cs.carefree_switch(side, '%s_cart', \n #\t\t\t\"$(find hrl_pr2_arms)/params/j_transpose_params_low.yaml\")\n \"$(find hrl_pr2_arms)/params/j_transpose_params_high.yaml\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L196_C4", "label": "get_angles", "type": "function", "loc": [196, 198], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L115_C0", "vector": [2, 1, 0.6589, 0.01, 1, 0.46, 0.5, 352, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "get_angles", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_angles(self):\n self.r_angle = self.r_arm.get_joint_angles()\n self.l_angle = self.l_arm.get_joint_angles()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L197_C8", "label": "self.r_angle = get_joint_angles()", "type": "assigned_variable", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L196_C4", "vector": [14, 2, 0.6589, 0.0033, 2, 0.24, 0.0, 649, 3, 0, 0, 0, 820, 10, 1], "semantic": {"name": "self.r_angle", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " self.r_angle = self.r_arm.get_joint_angles()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L198_C8", "label": "self.l_angle = get_joint_angles()", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L196_C4", "vector": [14, 2, 0.6622, 0.0033, 2, 0.24, 1.0, 234, 3, 0, 0, 0, 820, 10, 1], "semantic": {"name": "self.l_angle", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " self.l_angle = self.l_arm.get_joint_angles()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L201_C4", "label": "epc_move_arm", "type": "function", "loc": [201, 205], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L115_C0", "vector": [2, 1, 0.6789, 0.0167, 1, 0.46, 0.625, 135, 0, 5, 0, 0, 0, 0, 4], "semantic": {"name": "epc_move_arm", "arg_names": ["self", "arm", "ep1", "ep2", "duration"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def epc_move_arm(self, arm, ep1, ep2, duration=10.):\n self.t_vals = eptc.min_jerk_traj(duration/self.time_step)\n traj = arm.interpolate_ep(ep1, ep2, self.t_vals)\n tc = eptc.EPTrajectoryControl(arm, traj)\n self.epc.epc_motion(tc, self.time_step)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L202_C8", "label": "self.t_vals = min_jerk_traj()", "type": "assigned_variable", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L201_C4", "vector": [14, 2, 0.6756, 0.0033, 2, 0.85, 0.0, 290, 3, 1, 0, 0, 636, 10, 1], "semantic": {"name": "self.t_vals", "arg_names": [], "import_names": [], "rhs_call_name": "min_jerk_traj", "annotation": ""}, "snippet": " self.t_vals = eptc.min_jerk_traj(duration/self.time_step)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L203_C8", "label": "traj = interpolate_ep()", "type": "assigned_variable", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L201_C4", "vector": [14, 2, 0.6789, 0.0033, 2, 0.85, 0.3333, 742, 3, 3, 0, 0, 794, 10, 1], "semantic": {"name": "traj", "arg_names": [], "import_names": [], "rhs_call_name": "interpolate_ep", "annotation": ""}, "snippet": " traj = arm.interpolate_ep(ep1, ep2, self.t_vals)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L204_C8", "label": "tc = EPTrajectoryControl()", "type": "assigned_variable", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L201_C4", "vector": [14, 2, 0.6823, 0.0033, 2, 0.85, 0.6667, 375, 3, 2, 0, 0, 391, 10, 1], "semantic": {"name": "tc", "arg_names": [], "import_names": [], "rhs_call_name": "EPTrajectoryControl", "annotation": ""}, "snippet": " tc = eptc.EPTrajectoryControl(arm, traj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L205_C8", "label": "epc_motion()", "type": "expression", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L201_C4", "vector": [8, 2, 0.6856, 0.0033, 2, 0.85, 1.0, 938, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "epc_motion", "arg_names": [], "import_names": [], "rhs_call_name": "epc_motion", "annotation": ""}, "snippet": " self.epc.epc_motion(tc, self.time_step)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "label": "setup_pr2_init_pose", "type": "function", "loc": [208, 226], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L115_C0", "vector": [2, 1, 0.7258, 0.0635, 1, 0.46, 0.75, 106, 0, 1, 0, 0, 0, 0, 13], "semantic": {"name": "setup_pr2_init_pose", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setup_pr2_init_pose(self):\n rospy.logout('Initializing the Robot..'+self.tool)\n self.head.set_pose([0.15,0.,0.])\n self.torso.down()\n self.get_angles()\n duration=5.\n self.t_vals = eptc.min_jerk_traj(duration/self.time_step)\n self.r_ep =np.array([-1.397, 0.375, -1.740, -2.122, -1.966, -1.680, -2.491])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L209_C8", "label": "logout()", "type": "expression", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "vector": [8, 2, 0.699, 0.0033, 2, 0.37, 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('Initializing the Robot..'+self.tool)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L210_C8", "label": "set_pose()", "type": "expression", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "vector": [8, 2, 0.7023, 0.0033, 2, 0.37, 0.0714, 371, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_pose", "arg_names": [], "import_names": [], "rhs_call_name": "set_pose", "annotation": ""}, "snippet": " self.head.set_pose([0.15,0.,0.])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L211_C8", "label": "down()", "type": "expression", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "vector": [8, 2, 0.7057, 0.0033, 2, 0.37, 0.1429, 315, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "down", "arg_names": [], "import_names": [], "rhs_call_name": "down", "annotation": ""}, "snippet": " self.torso.down()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L212_C8", "label": "get_angles()", "type": "expression", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "vector": [8, 2, 0.709, 0.0033, 2, 0.37, 0.2143, 352, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "get_angles", "arg_names": [], "import_names": [], "rhs_call_name": "get_angles", "annotation": ""}, "snippet": " self.get_angles()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L213_C8", "label": "duration =", "type": "assigned_variable", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "vector": [14, 2, 0.7124, 0.0033, 2, 0.37, 0.2857, 242, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "duration", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " duration=5."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L214_C8", "label": "self.t_vals = min_jerk_traj()", "type": "assigned_variable", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "vector": [14, 2, 0.7157, 0.0033, 2, 0.37, 0.3571, 290, 3, 1, 0, 0, 636, 10, 1], "semantic": {"name": "self.t_vals", "arg_names": [], "import_names": [], "rhs_call_name": "min_jerk_traj", "annotation": ""}, "snippet": " self.t_vals = eptc.min_jerk_traj(duration/self.time_step)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L215_C8", "label": "self.r_ep = array()", "type": "assigned_variable", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "vector": [14, 2, 0.7191, 0.0033, 2, 0.37, 0.4286, 760, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "self.r_ep", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " self.r_ep =np.array([-1.397, 0.375, -1.740, -2.122, -1.966, -1.680, -2.491])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L216_C8", "label": "self.l_ep = array()", "type": "assigned_variable", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "vector": [14, 2, 0.7224, 0.0033, 2, 0.37, 0.5, 514, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "self.l_ep", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " self.l_ep =np.array([1.397, 0.375, 1.740, -2.122, 1.966, -1.680, -3.926])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L220_C8", "label": "carefree_switch()", "type": "expression", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "vector": [8, 2, 0.7358, 0.0033, 2, 0.37, 0.5714, 300, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "carefree_switch", "arg_names": [], "import_names": [], "rhs_call_name": "carefree_switch", "annotation": ""}, "snippet": " self.cs.carefree_switch('r', '%s_arm_controller')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L221_C8", "label": "carefree_switch()", "type": "expression", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "vector": [8, 2, 0.7391, 0.0033, 2, 0.37, 0.6429, 300, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "carefree_switch", "arg_names": [], "import_names": [], "rhs_call_name": "carefree_switch", "annotation": ""}, "snippet": " self.cs.carefree_switch('l', '%s_arm_controller')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L222_C8", "label": "wait_for_ep()", "type": "expression", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "vector": [8, 2, 0.7425, 0.0033, 2, 0.37, 0.7143, 645, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_ep", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_ep", "annotation": ""}, "snippet": " self.r_arm.wait_for_ep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L223_C8", "label": "wait_for_ep()", "type": "expression", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "vector": [8, 2, 0.7458, 0.0033, 2, 0.37, 0.7857, 645, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_ep", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_ep", "annotation": ""}, "snippet": " self.l_arm.wait_for_ep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L224_C8", "label": "epc_move_arm()", "type": "expression", "loc": [224, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "vector": [8, 2, 0.7492, 0.0033, 2, 0.37, 0.8571, 135, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "epc_move_arm", "arg_names": [], "import_names": [], "rhs_call_name": "epc_move_arm", "annotation": ""}, "snippet": " self.epc_move_arm(self.r_arm, self.r_angle, self.r_ep, duration)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L225_C8", "label": "epc_move_arm()", "type": "expression", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "vector": [8, 2, 0.7525, 0.0033, 2, 0.37, 0.9286, 135, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "epc_move_arm", "arg_names": [], "import_names": [], "rhs_call_name": "epc_move_arm", "annotation": ""}, "snippet": " self.epc_move_arm(self.l_arm, self.l_angle, self.l_ep, duration)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L226_C8", "label": "self.pr2_init =", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "vector": [14, 2, 0.7559, 0.0033, 2, 0.37, 1.0, 725, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.pr2_init", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pr2_init = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L229_C4", "label": "detect_artag", "type": "function", "loc": [229, 246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L115_C0", "vector": [2, 1, 0.7943, 0.0602, 1, 0.46, 0.875, 172, 0, 1, 1, 0, 0, 0, 14], "semantic": {"name": "detect_artag", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def detect_artag(self):\n try:\n rospy.logout(\"Finding the AR tag..\")\n self.pub_rate.sleep()\n (self.ar_pos, rot) = self.tf_listener.lookupTransform(\"/torso_lift_link\",\n self.marker_frame, rospy.Time(0))\n self.pub_rate.sleep()\n gripper_rot = hrl_tr.rotY(math.pi/2)\t#gripper facing -z direction"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "label": "try", "type": "try", "loc": [230, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L229_C4", "vector": [7, 2, 0.796, 0.0569, 2, 0.13, 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(\"Finding the AR tag..\")\n self.pub_rate.sleep()\n (self.ar_pos, rot) = self.tf_listener.lookupTransform(\"/torso_lift_link\",\n self.marker_frame, rospy.Time(0))\n self.pub_rate.sleep()\n gripper_rot = hrl_tr.rotY(math.pi/2)\t#gripper facing -z direction\n self.ar_rot = hrl_tr.quaternion_to_matrix(rot)*gripper_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L231_C12", "label": "logout()", "type": "expression", "loc": [231, 231], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "vector": [8, 3, 0.7726, 0.0033, 3, 0.91, 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(\"Finding the AR tag..\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L232_C12", "label": "sleep()", "type": "expression", "loc": [232, 232], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "vector": [8, 3, 0.7759, 0.0033, 3, 0.91, 0.1, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " self.pub_rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L233_C12", "label": "rot = lookupTransform()", "type": "assigned_variable", "loc": [233, 234], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "vector": [14, 3, 0.7809, 0.0067, 3, 0.91, 0.2, 812, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " (self.ar_pos, rot) = self.tf_listener.lookupTransform(\"/torso_lift_link\",\n self.marker_frame, rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L235_C12", "label": "sleep()", "type": "expression", "loc": [235, 235], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "vector": [8, 3, 0.786, 0.0033, 3, 0.91, 0.3, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " self.pub_rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L236_C12", "label": "gripper_rot = rotY()", "type": "assigned_variable", "loc": [236, 236], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "vector": [14, 3, 0.7893, 0.0033, 3, 0.91, 0.4, 541, 3, 1, 0, 0, 649, 10, 1], "semantic": {"name": "gripper_rot", "arg_names": [], "import_names": [], "rhs_call_name": "rotY", "annotation": ""}, "snippet": " gripper_rot = hrl_tr.rotY(math.pi/2)\t#gripper facing -z direction"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L237_C12", "label": "self.ar_rot =", "type": "assigned_variable", "loc": [237, 237], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "vector": [14, 3, 0.7926, 0.0033, 3, 0.91, 0.5, 303, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.ar_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ar_rot = hrl_tr.quaternion_to_matrix(rot)*gripper_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L239_C12", "label": "logout()", "type": "expression", "loc": [239, 239], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "vector": [8, 3, 0.7993, 0.0033, 3, 0.91, 0.6, 525, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout(\"Found AR tag!\\nPosition: \"+pplist(self.ar_pos)+\"\\nQuaterion: \"+pplist(rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L240_C12", "label": "self.ar_ep =", "type": "assigned_variable", "loc": [240, 240], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "vector": [14, 3, 0.8027, 0.0033, 3, 0.91, 0.7, 813, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ar_ep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ar_ep = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L241_C12", "label": "append()", "type": "expression", "loc": [241, 241], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "vector": [8, 3, 0.806, 0.0033, 3, 0.91, 0.8, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.ar_ep.append(np.matrix(self.ar_pos).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L242_C12", "label": "append()", "type": "expression", "loc": [242, 242], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "vector": [8, 3, 0.8094, 0.0033, 3, 0.91, 0.9, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.ar_ep.append(self.ar_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L243_C12", "label": "self.found_tag =", "type": "assigned_variable", "loc": [243, 243], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "vector": [14, 3, 0.8127, 0.0033, 3, 0.91, 1.0, 141, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.found_tag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.found_tag = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L245_C12", "label": "logout()", "type": "expression", "loc": [245, 245], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "vector": [8, 3, 0.8194, 0.0033, 3, 0.91, 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('AARtagDetect: Transform failed for '+self.tool)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Return_L246_C12", "label": "return", "type": "return", "loc": [246, 246], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "vector": [13, 3, 0.8227, 0.0033, 3, 0.91, 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_99639:FunctionDef_L249_C4", "label": "fetch_tool", "type": "function", "loc": [249, 279], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L115_C0", "vector": [2, 1, 0.8829, 0.1037, 1, 0.46, 1.0, 937, 0, 2, 0, 0, 0, 0, 13], "semantic": {"name": "fetch_tool", "arg_names": ["self", "duration"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def fetch_tool(self, duration=5.):\n rospy.logout(\"Moving the \"+self.arm+\" to fetch the object\")\n self.switch_arm()\n self.arm_controller.wait_for_ep()\n ep_cur = self.arm_controller.get_ep()\n ep1 = copy.deepcopy(self.ar_ep)\n ep1[0][2]=ep_cur[0][2]+.1\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L250_C8", "label": "logout()", "type": "expression", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "vector": [8, 2, 0.8361, 0.0033, 2, 0.14, 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(\"Moving the \"+self.arm+\" to fetch the object\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L251_C8", "label": "switch_arm()", "type": "expression", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "vector": [8, 2, 0.8395, 0.0033, 2, 0.14, 0.0588, 858, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "switch_arm", "arg_names": [], "import_names": [], "rhs_call_name": "switch_arm", "annotation": ""}, "snippet": " self.switch_arm()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L252_C8", "label": "wait_for_ep()", "type": "expression", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "vector": [8, 2, 0.8428, 0.0033, 2, 0.14, 0.1176, 645, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_ep", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_ep", "annotation": ""}, "snippet": " self.arm_controller.wait_for_ep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L253_C8", "label": "ep_cur = get_ep()", "type": "assigned_variable", "loc": [253, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "vector": [14, 2, 0.8462, 0.0033, 2, 0.14, 0.1765, 940, 3, 0, 0, 0, 563, 10, 1], "semantic": {"name": "ep_cur", "arg_names": [], "import_names": [], "rhs_call_name": "get_ep", "annotation": ""}, "snippet": " ep_cur = self.arm_controller.get_ep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L254_C8", "label": "ep1 = deepcopy()", "type": "assigned_variable", "loc": [254, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "vector": [14, 2, 0.8495, 0.0033, 2, 0.14, 0.2353, 831, 3, 1, 0, 0, 44, 10, 1], "semantic": {"name": "ep1", "arg_names": [], "import_names": [], "rhs_call_name": "deepcopy", "annotation": ""}, "snippet": " ep1 = copy.deepcopy(self.ar_ep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L255_C8", "label": "assign", "type": "assigned_variable", "loc": [255, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "vector": [14, 2, 0.8528, 0.0033, 2, 0.14, 0.2941, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ep1[0][2]=ep_cur[0][2]+.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L257_C8", "label": "epc_move_arm()", "type": "expression", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "vector": [8, 2, 0.8595, 0.0033, 2, 0.14, 0.3529, 135, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "epc_move_arm", "arg_names": [], "import_names": [], "rhs_call_name": "epc_move_arm", "annotation": ""}, "snippet": " self.epc_move_arm(self.arm_controller, ep_cur, ep1, 10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L258_C8", "label": "Open()", "type": "expression", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "vector": [8, 2, 0.8629, 0.0033, 2, 0.14, 0.4118, 362, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Open", "arg_names": [], "import_names": [], "rhs_call_name": "Open", "annotation": ""}, "snippet": " self.gripper.Open(self.arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L259_C8", "label": "sleep()", "type": "expression", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "vector": [8, 2, 0.8662, 0.0033, 2, 0.14, 0.4706, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(2.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L261_C8", "label": "self.tool_ep = deepcopy()", "type": "assigned_variable", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "vector": [14, 2, 0.8729, 0.0033, 2, 0.14, 0.5294, 513, 3, 1, 0, 0, 44, 10, 1], "semantic": {"name": "self.tool_ep", "arg_names": [], "import_names": [], "rhs_call_name": "deepcopy", "annotation": ""}, "snippet": " self.tool_ep = copy.deepcopy(self.ar_ep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L271_C8", "label": "epc_move_arm()", "type": "expression", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "vector": [8, 2, 0.9064, 0.0033, 2, 0.14, 0.5882, 135, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "epc_move_arm", "arg_names": [], "import_names": [], "rhs_call_name": "epc_move_arm", "annotation": ""}, "snippet": " self.epc_move_arm(self.arm_controller, ep1, self.tool_ep, 15)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L272_C8", "label": "Close()", "type": "expression", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "vector": [8, 2, 0.9097, 0.0033, 2, 0.14, 0.6471, 52, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Close", "arg_names": [], "import_names": [], "rhs_call_name": "Close", "annotation": ""}, "snippet": " self.gripper.Close(self.arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L273_C8", "label": "sleep()", "type": "expression", "loc": [273, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "vector": [8, 2, 0.913, 0.0033, 2, 0.14, 0.7059, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(2.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L274_C8", "label": "epc_move_arm()", "type": "expression", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "vector": [8, 2, 0.9164, 0.0033, 2, 0.14, 0.7647, 135, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "epc_move_arm", "arg_names": [], "import_names": [], "rhs_call_name": "epc_move_arm", "annotation": ""}, "snippet": " self.epc_move_arm(self.arm_controller, self.tool_ep, ep1, 15)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L276_C8", "label": "self.found_tag =", "type": "assigned_variable", "loc": [276, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "vector": [14, 2, 0.9231, 0.0033, 2, 0.14, 0.8235, 141, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.found_tag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.found_tag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L277_C8", "label": "self.search_tag =", "type": "assigned_variable", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "vector": [14, 2, 0.9264, 0.0033, 2, 0.14, 0.8824, 96, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.search_tag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.search_tag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L278_C8", "label": "self.pr2_init =", "type": "assigned_variable", "loc": [278, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "vector": [14, 2, 0.9298, 0.0033, 2, 0.14, 0.9412, 725, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.pr2_init", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pr2_init = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L279_C8", "label": "self.grasp_object =", "type": "assigned_variable", "loc": [279, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "vector": [14, 2, 0.9331, 0.0033, 2, 0.14, 1.0, 743, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.grasp_object", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grasp_object = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L282_C0", "label": "pplist", "type": "function", "loc": [282, 283], "level": 0, "parent": null, "vector": [2, 0, 0.9448, 0.0067, 0, 0.66, 0.9583, 233, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "pplist", "arg_names": ["list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pplist(list):\n return ' '.join(['%2.3f'%x for x in list])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Return_L283_C4", "label": "return", "type": "return", "loc": [283, 283], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L282_C0", "vector": [13, 1, 0.9465, 0.0033, 1, 0.6, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ' '.join(['%2.3f'%x for x in list])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L286_C0", "label": "if", "type": "if", "loc": [286, 295], "level": 0, "parent": null, "vector": [4, 0, 0.9716, 0.0334, 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 arm = ar_manipulation()\n#\tarm.get_angles()\n while not rospy.is_shutdown():\n if arm.search_tag:\n if not arm.pr2_init:\n arm.setup_pr2_init_pose()\n arm.detect_artag()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L287_C4", "label": "arm = ar_manipulation()", "type": "assigned_variable", "loc": [287, 287], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L286_C0", "vector": [14, 1, 0.9599, 0.0033, 1, 0.92, 0.0, 413, 3, 0, 0, 0, 262, 10, 1], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "ar_manipulation", "annotation": ""}, "snippet": " arm = ar_manipulation()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:While_L289_C4", "label": "while", "type": "while", "loc": [289, 295], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L286_C0", "vector": [5, 1, 0.9766, 0.0234, 1, 0.92, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n if arm.search_tag:\n if not arm.pr2_init:\n arm.setup_pr2_init_pose()\n arm.detect_artag()\n if arm.found_tag:\n arm.fetch_tool()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L290_C8", "label": "if", "type": "if", "loc": [290, 295], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:While_L289_C4", "vector": [4, 2, 0.9783, 0.0201, 2, 0.65, 0.0, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm.search_tag:\n if not arm.pr2_init:\n arm.setup_pr2_init_pose()\n arm.detect_artag()\n if arm.found_tag:\n arm.fetch_tool()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L291_C12", "label": "if", "type": "if", "loc": [291, 292], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L290_C8", "vector": [4, 3, 0.9749, 0.0067, 3, 0.15, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not arm.pr2_init:\n arm.setup_pr2_init_pose()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L292_C16", "label": "setup_pr2_init_pose()", "type": "expression", "loc": [292, 292], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L291_C12", "vector": [8, 4, 0.9766, 0.0033, 4, 0.31, 0.0, 106, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "setup_pr2_init_pose", "arg_names": [], "import_names": [], "rhs_call_name": "setup_pr2_init_pose", "annotation": ""}, "snippet": " arm.setup_pr2_init_pose()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L293_C12", "label": "detect_artag()", "type": "expression", "loc": [293, 293], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L290_C8", "vector": [8, 3, 0.9799, 0.0033, 3, 0.15, 0.5, 172, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "detect_artag", "arg_names": [], "import_names": [], "rhs_call_name": "detect_artag", "annotation": ""}, "snippet": " arm.detect_artag()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L294_C12", "label": "if", "type": "if", "loc": [294, 295], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L290_C8", "vector": [4, 3, 0.9849, 0.0067, 3, 0.15, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm.found_tag:\n arm.fetch_tool()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L295_C16", "label": "fetch_tool()", "type": "expression", "loc": [295, 295], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L294_C12", "vector": [8, 4, 0.9866, 0.0033, 4, 0.11, 0.0, 937, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fetch_tool", "arg_names": [], "import_names": [], "rhs_call_name": "fetch_tool", "annotation": ""}, "snippet": " arm.fetch_tool()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L84_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L101_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L153_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L154_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L153_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L153_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L153_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L153_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L159_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L170_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L173_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L174_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L175_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L176_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L177_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L178_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L182_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L183_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L182_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L184_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L182_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L185_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L186_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L185_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L187_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L189_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L201_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L224_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L229_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L229_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L231_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L232_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L233_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L235_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L236_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L237_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L239_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L240_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L241_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L242_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L243_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L245_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:Try_L230_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Return_L246_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:ClassDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L254_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:FunctionDef_L282_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Return_L283_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L286_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Assign_L287_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L286_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:While_L289_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:While_L289_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L290_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L290_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L291_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L291_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L292_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L290_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L293_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L290_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L294_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99639:If_L294_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99639:Expr_L295_C16"}]
#!/usr/bin/python import roslib roslib.load_manifest('tf') roslib.load_manifest('rospy') roslib.load_manifest('geometry_msgs') roslib.load_manifest('hrl_lib') import rospy, optparse, math, time import numpy as np import tf import tf.transformations as tr import cPickle as pkl import hrl_lib.transforms as hrl_tr import hrl_lib.util as ut from geometry_msgs.msg import TransformStamped def log_parse(): parser = optparse.OptionParser('Input the source frame name \ and the target frame name') parser.add_option("-s", "--source", action="store", type="string",\ dest="source_frame", default="l_gripper_tool_frame") parser.add_option("-t", "--target" , action="store", type="string",\ dest="target_frame",default="base_link") (options, args) = parser.parse_args() return options.source_frame, options.target_frame class tf_frame_publisher(): def __init__(self): self.source_frame, self.target_frame = log_parse() self.pub = rospy.Publisher('/frame/'+self.source_frame,\ TransformStamped) rospy.init_node('pub_tf_'+self.source_frame, anonymous = True) self.tflistener = tf.TransformListener() self.pos = np.matrix([0.,0.,0.]).T self.rot = np.matrix([0.,0.,0.]).T self.init_rot = np.matrix([0.,0.,0.]).T self.quat = [0.,0.,0.,0.] self.tf = TransformStamped() def listen_pub(self): while not rospy.is_shutdown(): p, q = self.tflistener.lookupTransform(self.target_frame,\ self.source_frame, rospy.Time(0)) self.tf.header.frame_id = '/'+self.target_frame self.tf.header.stamp = rospy.Time.now() self.tf.child_frame_id = '/'+self.source_frame self.tf.transform.translation.x = p[0] self.tf.transform.translation.y = p[1] self.tf.transform.translation.z = p[2] self.tf.transform.rotation.x = q[0] self.tf.transform.rotation.y = q[1] self.tf.transform.rotation.z = q[2] self.tf.transform.rotation.w = q[3] self.pub.publish(self.tf) rospy.sleep(1/100.) if __name__ == '__main__': frame = tf_frame_publisher() rospy.sleep(1) try: frame.listen_pub() except rospy.ROSInterruptException: pass
ajibawa-2023/Python-Code-Large/train/row_99640
50
68
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0441, 0.0147, 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_99640:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0588, 0.0147, 0, 0.66, 0.0667, 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_99640:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0735, 0.0147, 0, 0.66, 0.1333, 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('rospy')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0882, 0.0147, 0, 0.66, 0.2, 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_99640:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.1029, 0.0147, 0, 0.66, 0.2667, 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_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Import_L8_C0", "label": "rospy import rospy, optparse, math\u2026", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1176, 0.0147, 0, 0.66, 0.3333, 164, 0, 4, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy", "optparse", "math", "time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy, optparse, math, time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Import_L9_C0", "label": "numpy import np", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1324, 0.0147, 0, 0.66, 0.4, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Import_L10_C0", "label": "tf import tf", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1471, 0.0147, 0, 0.66, 0.4667, 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_99640:Import_L11_C0", "label": "tf.transformations import tr", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1618, 0.0147, 0, 0.66, 0.5333, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Import_L12_C0", "label": "cPickle import pkl", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1765, 0.0147, 0, 0.66, 0.6, 279, 0, 1, 0, 0, 279, 0, 0], "semantic": {"name": "cPickle", "arg_names": [], "import_names": ["pkl"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cPickle as pkl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Import_L13_C0", "label": "hrl_lib.transforms import hrl_tr", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1912, 0.0147, 0, 0.66, 0.6667, 82, 0, 1, 0, 0, 82, 0, 0], "semantic": {"name": "hrl_lib.transforms", "arg_names": [], "import_names": ["hrl_tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.transforms as hrl_tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Import_L14_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.2059, 0.0147, 0, 0.66, 0.7333, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:ImportFrom_L16_C0", "label": "from geometry_msgs.msg import TransformStamped", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.2353, 0.0147, 0, 0.66, 0.8, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["TransformStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import TransformStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L18_C0", "label": "log_parse", "type": "function", "loc": [18, 28], "level": 0, "parent": null, "vector": [2, 0, 0.3382, 0.1618, 0, 0.66, 0.8667, 657, 0, 0, 1, 0, 0, 0, 4], "semantic": {"name": "log_parse", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def log_parse():\n\tparser = optparse.OptionParser('Input the source frame name \\\n\t\tand the target frame name')\n\n\tparser.add_option(\"-s\", \"--source\", action=\"store\", type=\"string\",\\\n\t\tdest=\"source_frame\", default=\"l_gripper_tool_frame\")\n\tparser.add_option(\"-t\", \"--target\" , action=\"store\", type=\"string\",\\\n\t\tdest=\"target_frame\",default=\"base_link\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L19_C1", "label": "parser = OptionParser()", "type": "assigned_variable", "loc": [19, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L18_C0", "vector": [14, 1, 0.2868, 0.0294, 1, 0.55, 0.0, 968, 3, 1, 0, 0, 894, 10, 1], "semantic": {"name": "parser", "arg_names": [], "import_names": [], "rhs_call_name": "OptionParser", "annotation": ""}, "snippet": "\tparser = optparse.OptionParser('Input the source frame name \\\n\t\tand the target frame name')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Expr_L22_C1", "label": "add_option()", "type": "expression", "loc": [22, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L18_C0", "vector": [8, 1, 0.3309, 0.0294, 1, 0.55, 0.25, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": "\tparser.add_option(\"-s\", \"--source\", action=\"store\", type=\"string\",\\\n\t\tdest=\"source_frame\", default=\"l_gripper_tool_frame\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Expr_L24_C1", "label": "add_option()", "type": "expression", "loc": [24, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L18_C0", "vector": [8, 1, 0.3603, 0.0294, 1, 0.55, 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": "\tparser.add_option(\"-t\", \"--target\" , action=\"store\", type=\"string\",\\\n\t\tdest=\"target_frame\",default=\"base_link\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L26_C1", "label": "options, args = parse_args()", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L18_C0", "vector": [14, 1, 0.3824, 0.0147, 1, 0.55, 0.75, 584, 3, 0, 0, 0, 187, 10, 1], "semantic": {"name": "options, args", "arg_names": [], "import_names": [], "rhs_call_name": "parse_args", "annotation": ""}, "snippet": "\t(options, args) = parser.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Return_L28_C1", "label": "return", "type": "return", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L18_C0", "vector": [13, 1, 0.4118, 0.0147, 1, 0.55, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn options.source_frame, options.target_frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:ClassDef_L31_C0", "label": "tf_frame_publisher", "type": "class", "loc": [31, 60], "level": 0, "parent": null, "vector": [3, 0, 0.6691, 0.4412, 0, 0.66, 0.9333, 797, 0, 2, 0, 0, 0, 0, 14], "semantic": {"name": "tf_frame_publisher", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class tf_frame_publisher():\n\tdef __init__(self):\n\t\tself.source_frame, self.target_frame = log_parse()\n\t\tself.pub = rospy.Publisher('/frame/'+self.source_frame,\\\n\t\t\t\tTransformStamped)\n\t\trospy.init_node('pub_tf_'+self.source_frame, anonymous = True)\n\t\tself.tflistener = tf.TransformListener()\n\t\tself.pos = np.matrix([0.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L32_C1", "label": "__init__", "type": "function", "loc": [32, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:ClassDef_L31_C0", "vector": [2, 1, 0.5441, 0.1618, 1, 0.03, 0.0, 555, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.source_frame, self.target_frame = log_parse()\n\t\tself.pub = rospy.Publisher('/frame/'+self.source_frame,\\\n\t\t\t\tTransformStamped)\n\t\trospy.init_node('pub_tf_'+self.source_frame, anonymous = True)\n\t\tself.tflistener = tf.TransformListener()\n\t\tself.pos = np.matrix([0.,0.,0.]).T\n\t\tself.rot = np.matrix([0.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L33_C2", "label": " = log_parse()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L32_C1", "vector": [14, 2, 0.4853, 0.0147, 2, 0.67, 0.0, 0, 3, 0, 0, 0, 657, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "log_parse", "annotation": ""}, "snippet": "\t\tself.source_frame, self.target_frame = log_parse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L34_C2", "label": "self.pub = Publisher()", "type": "assigned_variable", "loc": [34, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L32_C1", "vector": [14, 2, 0.5074, 0.0294, 2, 0.67, 0.125, 86, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "\t\tself.pub = rospy.Publisher('/frame/'+self.source_frame,\\\n\t\t\t\tTransformStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Expr_L36_C2", "label": "init_node()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L32_C1", "vector": [8, 2, 0.5294, 0.0147, 2, 0.67, 0.25, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": "\t\trospy.init_node('pub_tf_'+self.source_frame, anonymous = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L37_C2", "label": "self.tflistener = TransformListener()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L32_C1", "vector": [14, 2, 0.5441, 0.0147, 2, 0.67, 0.375, 50, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tflistener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": "\t\tself.tflistener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L38_C2", "label": "self.pos =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L32_C1", "vector": [14, 2, 0.5588, 0.0147, 2, 0.67, 0.5, 283, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.pos = np.matrix([0.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L39_C2", "label": "self.rot =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L32_C1", "vector": [14, 2, 0.5735, 0.0147, 2, 0.67, 0.625, 678, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.rot = np.matrix([0.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L40_C2", "label": "self.init_rot =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L32_C1", "vector": [14, 2, 0.5882, 0.0147, 2, 0.67, 0.75, 454, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.init_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.init_rot = np.matrix([0.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L41_C2", "label": "self.quat =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L32_C1", "vector": [14, 2, 0.6029, 0.0147, 2, 0.67, 0.875, 691, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.quat = [0.,0.,0.,0.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L42_C2", "label": "self.tf = TransformStamped()", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L32_C1", "vector": [14, 2, 0.6176, 0.0147, 2, 0.67, 1.0, 342, 3, 0, 0, 0, 717, 10, 1], "semantic": {"name": "self.tf", "arg_names": [], "import_names": [], "rhs_call_name": "TransformStamped", "annotation": ""}, "snippet": "\t\tself.tf = TransformStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L45_C1", "label": "listen_pub", "type": "function", "loc": [45, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:ClassDef_L31_C0", "vector": [2, 1, 0.7721, 0.2353, 1, 0.03, 1.0, 104, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "listen_pub", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef listen_pub(self):\n\t\twhile not rospy.is_shutdown():\n\t\t\tp, q = self.tflistener.lookupTransform(self.target_frame,\\\n\t\t\t\t\tself.source_frame, rospy.Time(0))\n\t\t\tself.tf.header.frame_id = '/'+self.target_frame\n\t\t\tself.tf.header.stamp = rospy.Time.now()\n\t\t\tself.tf.child_frame_id = '/'+self.source_frame\t\t\n\t\t\tself.tf.transform.translation.x = p[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "label": "while", "type": "while", "loc": [46, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L45_C1", "vector": [5, 2, 0.7794, 0.2206, 2, 0.9, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\twhile not rospy.is_shutdown():\n\t\t\tp, q = self.tflistener.lookupTransform(self.target_frame,\\\n\t\t\t\t\tself.source_frame, rospy.Time(0))\n\t\t\tself.tf.header.frame_id = '/'+self.target_frame\n\t\t\tself.tf.header.stamp = rospy.Time.now()\n\t\t\tself.tf.child_frame_id = '/'+self.source_frame\t\t\n\t\t\tself.tf.transform.translation.x = p[0]\n\t\t\tself.tf.transform.translation.y = p[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L47_C3", "label": "p, q = lookupTransform()", "type": "assigned_variable", "loc": [47, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "vector": [14, 3, 0.6985, 0.0294, 3, 0.89, 0.0, 213, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "p, q", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": "\t\t\tp, q = self.tflistener.lookupTransform(self.target_frame,\\\n\t\t\t\t\tself.source_frame, rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L49_C3", "label": "self.tf.header.frame_id =", "type": "assigned_variable", "loc": [49, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "vector": [14, 3, 0.7206, 0.0147, 3, 0.89, 0.0833, 725, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tf.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.tf.header.frame_id = '/'+self.target_frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L50_C3", "label": "self.tf.header.stamp = now()", "type": "assigned_variable", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "vector": [14, 3, 0.7353, 0.0147, 3, 0.89, 0.1667, 831, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "self.tf.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": "\t\t\tself.tf.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L51_C3", "label": "self.tf.child_frame_id =", "type": "assigned_variable", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "vector": [14, 3, 0.75, 0.0147, 3, 0.89, 0.25, 679, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tf.child_frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.tf.child_frame_id = '/'+self.source_frame\t\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L52_C3", "label": "self.tf.transform.translation.x =", "type": "assigned_variable", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "vector": [14, 3, 0.7647, 0.0147, 3, 0.89, 0.3333, 996, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tf.transform.translation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.tf.transform.translation.x = p[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L53_C3", "label": "self.tf.transform.translation.y =", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "vector": [14, 3, 0.7794, 0.0147, 3, 0.89, 0.4167, 939, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tf.transform.translation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.tf.transform.translation.y = p[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L54_C3", "label": "self.tf.transform.translation.z =", "type": "assigned_variable", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "vector": [14, 3, 0.7941, 0.0147, 3, 0.89, 0.5, 769, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tf.transform.translation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.tf.transform.translation.z = p[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L55_C3", "label": "self.tf.transform.rotation.x =", "type": "assigned_variable", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "vector": [14, 3, 0.8088, 0.0147, 3, 0.89, 0.5833, 915, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tf.transform.rotation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.tf.transform.rotation.x = q[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L56_C3", "label": "self.tf.transform.rotation.y =", "type": "assigned_variable", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "vector": [14, 3, 0.8235, 0.0147, 3, 0.89, 0.6667, 186, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tf.transform.rotation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.tf.transform.rotation.y = q[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L57_C3", "label": "self.tf.transform.rotation.z =", "type": "assigned_variable", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "vector": [14, 3, 0.8382, 0.0147, 3, 0.89, 0.75, 108, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tf.transform.rotation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.tf.transform.rotation.z = q[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L58_C3", "label": "self.tf.transform.rotation.w =", "type": "assigned_variable", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "vector": [14, 3, 0.8529, 0.0147, 3, 0.89, 0.8333, 899, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tf.transform.rotation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.tf.transform.rotation.w = q[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Expr_L59_C3", "label": "publish()", "type": "expression", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "vector": [8, 3, 0.8676, 0.0147, 3, 0.89, 0.9167, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": "\t\t\tself.pub.publish(self.tf)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Expr_L60_C3", "label": "sleep()", "type": "expression", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "vector": [8, 3, 0.8824, 0.0147, 3, 0.89, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": "\t\t\trospy.sleep(1/100.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:If_L62_C0", "label": "if", "type": "if", "loc": [62, 67], "level": 0, "parent": null, "vector": [4, 0, 0.9485, 0.0882, 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\tframe = tf_frame_publisher()\n\trospy.sleep(1)\n\ttry:\n\t\tframe.listen_pub()\n\texcept rospy.ROSInterruptException: pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L63_C1", "label": "frame = tf_frame_publisher()", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:If_L62_C0", "vector": [14, 1, 0.9265, 0.0147, 1, 0.6, 0.0, 313, 3, 0, 0, 0, 797, 10, 1], "semantic": {"name": "frame", "arg_names": [], "import_names": [], "rhs_call_name": "tf_frame_publisher", "annotation": ""}, "snippet": "\tframe = tf_frame_publisher()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Expr_L64_C1", "label": "sleep()", "type": "expression", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:If_L62_C0", "vector": [8, 1, 0.9412, 0.0147, 1, 0.6, 0.5, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": "\trospy.sleep(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Try_L65_C1", "label": "try", "type": "try", "loc": [65, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:If_L62_C0", "vector": [7, 1, 0.9706, 0.0441, 1, 0.6, 1.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\ttry:\n\t\tframe.listen_pub()\n\texcept rospy.ROSInterruptException: pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99640:Expr_L66_C2", "label": "listen_pub()", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99640:Try_L65_C1", "vector": [8, 2, 0.9706, 0.0147, 2, 0.38, 0.0, 104, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "listen_pub", "arg_names": [], "import_names": [], "rhs_call_name": "listen_pub", "annotation": ""}, "snippet": "\t\tframe.listen_pub()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L19_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Expr_L22_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Expr_L24_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L26_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Return_L28_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L32_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L32_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L32_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L34_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L32_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Expr_L36_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L32_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L37_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L32_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L38_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L32_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L39_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L32_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L40_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L32_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L41_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L32_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L42_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L45_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:FunctionDef_L45_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L47_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L49_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L50_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L51_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L52_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L53_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L54_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L55_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L56_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L57_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L58_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Expr_L59_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:While_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Expr_L60_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:If_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Assign_L63_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:If_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Expr_L64_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:If_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Try_L65_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99640:Try_L65_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99640:Expr_L66_C2"}]
#!/usr/bin/python import roslib roslib.load_manifest('tf') roslib.load_manifest('rospy') roslib.load_manifest('adl_pr2_log') roslib.load_manifest('geometry_msgs') import rospy, optparse, math, time import numpy as np import tf from hrl_lib.msg import WrenchPoseArrayStamped from geometry_msgs.msg import WrenchStamped from geometry_msgs.msg import Pose def log_parse(): parser = optparse.OptionParser('Input the source frame name \ and the target frame name') parser.add_option("-t", "--tool", action="store", type="string",\ dest="tool_frame", default="l_gripper_tool_frame") (options, args) = parser.parse_args() return options.tool_frame class posearray_wrench_publisher(): def __init__(self): self.tool_frame = '/'+log_parse() self.head_frame = '/ellipse_frame' # self.head_frame = '/'+log_parse() self.torso_frame = '/torso_lift_link' self.base_frame = '/base_link' ft_topic = '/netft_gravity_zeroing/wrench_zeroed' rospy.init_node('adl_poses_wrench', anonymous = True) self.pub = rospy.Publisher('/adl_wrench_posearray',\ WrenchPoseArrayStamped) self.tflistener = tf.TransformListener() self.force_sub = rospy.Subscriber(ft_topic, WrenchStamped, self.force_cb) self.msg = WrenchPoseArrayStamped() self.tool_pose = Pose() self.head_pose = Pose() self.torso_pose = Pose() def force_cb(self, f_msg): self.msg.wrench = f_msg.wrench def pose_wrench_pub(self): while not rospy.is_shutdown(): self.tool_p, self.tool_q = self.tflistener.lookupTransform\ (self.base_frame, self.tool_frame, rospy.Time(0)) self.head_p, self.head_q = self.tflistener.lookupTransform\ (self.base_frame, self.head_frame, rospy.Time(0)) self.torso_p, self.torso_q = self.tflistener.lookupTransform\ (self.base_frame, self.torso_frame, rospy.Time(0)) self.msg.header.stamp = rospy.Time.now() self.msg.header.frame_id = self.base_frame self.msg.poses = [] # poses[0] is the tool frame self.tool_pose.position.x = self.tool_p[0] self.tool_pose.position.y = self.tool_p[1] self.tool_pose.position.z = self.tool_p[2] self.tool_pose.orientation.x = self.tool_q[0] self.tool_pose.orientation.y = self.tool_q[1] self.tool_pose.orientation.z = self.tool_q[2] self.tool_pose.orientation.w = self.tool_q[3] self.msg.poses.append(self.tool_pose) # poses[1] is the head frame self.head_pose.position.x = self.head_p[0] self.head_pose.position.y = self.head_p[1] self.head_pose.position.z = self.head_p[2] self.head_pose.orientation.x = self.head_q[0] self.head_pose.orientation.y = self.head_q[1] self.head_pose.orientation.z = self.head_q[2] self.head_pose.orientation.w = self.head_q[3] self.msg.poses.append(self.head_pose) # poses[2] is the tool frame self.torso_pose.position.x = self.torso_p[0] self.torso_pose.position.y = self.torso_p[1] self.torso_pose.position.z = self.torso_p[2] self.torso_pose.orientation.x = self.torso_q[0] self.torso_pose.orientation.y = self.torso_q[1] self.torso_pose.orientation.z = self.torso_q[2] self.torso_pose.orientation.w = self.torso_q[3] self.msg.poses.append(self.torso_pose) self.pub.publish(self.msg) # print '\nwrench:\n ', self.msg.wrench # print '\ntool_pose:\n ', self.msg.poses[0] rospy.sleep(1/100.) if __name__ == '__main__': data = posearray_wrench_publisher() rospy.sleep(1) try: data.pose_wrench_pub() except rospy.ROSInterruptException: pass
ajibawa-2023/Python-Code-Large/train/row_99641
72
104
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0288, 0.0096, 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_99641:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0385, 0.0096, 0, 0.66, 0.0769, 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_99641:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0481, 0.0096, 0, 0.66, 0.1538, 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('rospy')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0577, 0.0096, 0, 0.66, 0.2308, 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('adl_pr2_log')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0673, 0.0096, 0, 0.66, 0.3077, 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_99641:Import_L8_C0", "label": "rospy import rospy, optparse, math\u2026", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0096, 0, 0.66, 0.3846, 164, 0, 4, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy", "optparse", "math", "time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy, optparse, math, time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Import_L9_C0", "label": "numpy import np", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0865, 0.0096, 0, 0.66, 0.4615, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Import_L10_C0", "label": "tf import tf", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0962, 0.0096, 0, 0.66, 0.5385, 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_99641:ImportFrom_L11_C0", "label": "from hrl_lib.msg import WrenchPoseArrayStamped", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1058, 0.0096, 0, 0.66, 0.6154, 842, 0, 1, 0, 0, 842, 0, 0], "semantic": {"name": "hrl_lib.msg", "arg_names": [], "import_names": ["WrenchPoseArrayStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_lib.msg import WrenchPoseArrayStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:ImportFrom_L12_C0", "label": "from geometry_msgs.msg import WrenchStamped", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1154, 0.0096, 0, 0.66, 0.6923, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["WrenchStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import WrenchStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:ImportFrom_L13_C0", "label": "from geometry_msgs.msg import Pose", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.0096, 0, 0.66, 0.7692, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Pose"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L17_C0", "label": "log_parse", "type": "function", "loc": [17, 25], "level": 0, "parent": null, "vector": [2, 0, 0.2019, 0.0865, 0, 0.66, 0.8462, 657, 0, 0, 1, 0, 0, 0, 3], "semantic": {"name": "log_parse", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def log_parse():\n\tparser = optparse.OptionParser('Input the source frame name \\\n\t\tand the target frame name')\n\n\tparser.add_option(\"-t\", \"--tool\", action=\"store\", type=\"string\",\\\n\t\tdest=\"tool_frame\", default=\"l_gripper_tool_frame\")\n\t(options, args) = parser.parse_args()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L18_C1", "label": "parser = OptionParser()", "type": "assigned_variable", "loc": [18, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L17_C0", "vector": [14, 1, 0.1779, 0.0192, 1, 0.82, 0.0, 968, 3, 1, 0, 0, 894, 10, 1], "semantic": {"name": "parser", "arg_names": [], "import_names": [], "rhs_call_name": "OptionParser", "annotation": ""}, "snippet": "\tparser = optparse.OptionParser('Input the source frame name \\\n\t\tand the target frame name')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Expr_L21_C1", "label": "add_option()", "type": "expression", "loc": [21, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L17_C0", "vector": [8, 1, 0.2067, 0.0192, 1, 0.82, 0.3333, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": "\tparser.add_option(\"-t\", \"--tool\", action=\"store\", type=\"string\",\\\n\t\tdest=\"tool_frame\", default=\"l_gripper_tool_frame\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L23_C1", "label": "options, args = parse_args()", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L17_C0", "vector": [14, 1, 0.2212, 0.0096, 1, 0.82, 0.6667, 584, 3, 0, 0, 0, 187, 10, 1], "semantic": {"name": "options, args", "arg_names": [], "import_names": [], "rhs_call_name": "parse_args", "annotation": ""}, "snippet": "\t(options, args) = parser.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Return_L25_C1", "label": "return", "type": "return", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L17_C0", "vector": [13, 1, 0.2404, 0.0096, 1, 0.82, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn options.tool_frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:ClassDef_L28_C0", "label": "posearray_wrench_publisher", "type": "class", "loc": [28, 95], "level": 0, "parent": null, "vector": [3, 0, 0.5913, 0.6538, 0, 0.66, 0.9231, 896, 0, 3, 0, 0, 0, 0, 22], "semantic": {"name": "posearray_wrench_publisher", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class posearray_wrench_publisher():\n\tdef __init__(self):\n\t\tself.tool_frame = '/'+log_parse()\n\t\tself.head_frame = '/ellipse_frame'\n#\t\tself.head_frame = '/'+log_parse()\n\t\tself.torso_frame = '/torso_lift_link'\n\t\tself.base_frame = '/base_link'\n\t\tft_topic = '/netft_gravity_zeroing/wrench_zeroed'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "label": "__init__", "type": "function", "loc": [29, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:ClassDef_L28_C0", "vector": [2, 1, 0.3558, 0.1635, 1, 0.71, 0.0, 555, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.tool_frame = '/'+log_parse()\n\t\tself.head_frame = '/ellipse_frame'\n#\t\tself.head_frame = '/'+log_parse()\n\t\tself.torso_frame = '/torso_lift_link'\n\t\tself.base_frame = '/base_link'\n\t\tft_topic = '/netft_gravity_zeroing/wrench_zeroed'\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L30_C2", "label": "self.tool_frame =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "vector": [14, 2, 0.2885, 0.0096, 2, 0.81, 0.0, 392, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.tool_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.tool_frame = '/'+log_parse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L31_C2", "label": "self.head_frame =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "vector": [14, 2, 0.2981, 0.0096, 2, 0.81, 0.0833, 701, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.head_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.head_frame = '/ellipse_frame'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L33_C2", "label": "self.torso_frame =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "vector": [14, 2, 0.3173, 0.0096, 2, 0.81, 0.1667, 981, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.torso_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.torso_frame = '/torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L34_C2", "label": "self.base_frame =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "vector": [14, 2, 0.3269, 0.0096, 2, 0.81, 0.25, 200, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.base_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.base_frame = '/base_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L35_C2", "label": "ft_topic =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "vector": [14, 2, 0.3365, 0.0096, 2, 0.81, 0.3333, 640, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ft_topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tft_topic = '/netft_gravity_zeroing/wrench_zeroed'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Expr_L37_C2", "label": "init_node()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "vector": [8, 2, 0.3558, 0.0096, 2, 0.81, 0.4167, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": "\t\trospy.init_node('adl_poses_wrench', anonymous = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L38_C2", "label": "self.pub = Publisher()", "type": "assigned_variable", "loc": [38, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "vector": [14, 2, 0.3702, 0.0192, 2, 0.81, 0.5, 86, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "\t\tself.pub = rospy.Publisher('/adl_wrench_posearray',\\\n\t\t\t\tWrenchPoseArrayStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L40_C2", "label": "self.tflistener = TransformListener()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "vector": [14, 2, 0.3846, 0.0096, 2, 0.81, 0.5833, 50, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tflistener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": "\t\tself.tflistener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L41_C2", "label": "self.force_sub = Subscriber()", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "vector": [14, 2, 0.3942, 0.0096, 2, 0.81, 0.6667, 563, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "self.force_sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": "\t\tself.force_sub = rospy.Subscriber(ft_topic, WrenchStamped, self.force_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L42_C2", "label": "self.msg = WrenchPoseArrayStamped()", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "vector": [14, 2, 0.4038, 0.0096, 2, 0.81, 0.75, 528, 3, 0, 0, 0, 354, 10, 1], "semantic": {"name": "self.msg", "arg_names": [], "import_names": [], "rhs_call_name": "WrenchPoseArrayStamped", "annotation": ""}, "snippet": "\t\tself.msg = WrenchPoseArrayStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L43_C2", "label": "self.tool_pose = Pose()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "vector": [14, 2, 0.4135, 0.0096, 2, 0.81, 0.8333, 925, 3, 0, 0, 0, 902, 10, 1], "semantic": {"name": "self.tool_pose", "arg_names": [], "import_names": [], "rhs_call_name": "Pose", "annotation": ""}, "snippet": "\t\tself.tool_pose = Pose()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L44_C2", "label": "self.head_pose = Pose()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "vector": [14, 2, 0.4231, 0.0096, 2, 0.81, 0.9167, 330, 3, 0, 0, 0, 902, 10, 1], "semantic": {"name": "self.head_pose", "arg_names": [], "import_names": [], "rhs_call_name": "Pose", "annotation": ""}, "snippet": "\t\tself.head_pose = Pose()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L45_C2", "label": "self.torso_pose = Pose()", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "vector": [14, 2, 0.4327, 0.0096, 2, 0.81, 1.0, 831, 3, 0, 0, 0, 902, 10, 1], "semantic": {"name": "self.torso_pose", "arg_names": [], "import_names": [], "rhs_call_name": "Pose", "annotation": ""}, "snippet": "\t\tself.torso_pose = Pose()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L48_C1", "label": "force_cb", "type": "function", "loc": [48, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:ClassDef_L28_C0", "vector": [2, 1, 0.4663, 0.0192, 1, 0.71, 0.5, 823, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "force_cb", "arg_names": ["self", "f_msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef force_cb(self, f_msg):\n\t\tself.msg.wrench = f_msg.wrench\t\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L49_C2", "label": "self.msg.wrench =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L48_C1", "vector": [14, 2, 0.4712, 0.0096, 2, 0.68, 0.0, 444, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.msg.wrench", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.msg.wrench = f_msg.wrench\t\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L52_C1", "label": "pose_wrench_pub", "type": "function", "loc": [52, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:ClassDef_L28_C0", "vector": [2, 1, 0.7067, 0.4231, 1, 0.71, 1.0, 811, 0, 1, 0, 0, 0, 0, 13], "semantic": {"name": "pose_wrench_pub", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef pose_wrench_pub(self):\n\t\twhile not rospy.is_shutdown():\n\t\t\tself.tool_p, self.tool_q = self.tflistener.lookupTransform\\\n\t\t\t\t(self.base_frame, self.tool_frame, rospy.Time(0))\n\t\t\tself.head_p, self.head_q = self.tflistener.lookupTransform\\\n\t\t\t\t(self.base_frame, self.head_frame, rospy.Time(0))\n\t\t\tself.torso_p, self.torso_q = self.tflistener.lookupTransform\\\n\t\t\t\t(self.base_frame, self.torso_frame, rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "label": "while", "type": "while", "loc": [53, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L52_C1", "vector": [5, 2, 0.7115, 0.4135, 2, 0.8, 0.0, 0, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\twhile not rospy.is_shutdown():\n\t\t\tself.tool_p, self.tool_q = self.tflistener.lookupTransform\\\n\t\t\t\t(self.base_frame, self.tool_frame, rospy.Time(0))\n\t\t\tself.head_p, self.head_q = self.tflistener.lookupTransform\\\n\t\t\t\t(self.base_frame, self.head_frame, rospy.Time(0))\n\t\t\tself.torso_p, self.torso_q = self.tflistener.lookupTransform\\\n\t\t\t\t(self.base_frame, self.torso_frame, rospy.Time(0))\n\t\t\tself.msg.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L54_C3", "label": " = lookupTransform()", "type": "assigned_variable", "loc": [54, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.524, 0.0192, 3, 0.25, 0.0, 0, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": "\t\t\tself.tool_p, self.tool_q = self.tflistener.lookupTransform\\\n\t\t\t\t(self.base_frame, self.tool_frame, rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L56_C3", "label": " = lookupTransform()", "type": "assigned_variable", "loc": [56, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.5433, 0.0192, 3, 0.25, 0.0323, 0, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": "\t\t\tself.head_p, self.head_q = self.tflistener.lookupTransform\\\n\t\t\t\t(self.base_frame, self.head_frame, rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L58_C3", "label": " = lookupTransform()", "type": "assigned_variable", "loc": [58, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.5625, 0.0192, 3, 0.25, 0.0645, 0, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": "\t\t\tself.torso_p, self.torso_q = self.tflistener.lookupTransform\\\n\t\t\t\t(self.base_frame, self.torso_frame, rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L60_C3", "label": "self.msg.header.stamp = now()", "type": "assigned_variable", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.5769, 0.0096, 3, 0.25, 0.0968, 412, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "self.msg.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": "\t\t\tself.msg.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L61_C3", "label": "self.msg.header.frame_id =", "type": "assigned_variable", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.5865, 0.0096, 3, 0.25, 0.129, 113, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.msg.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.msg.header.frame_id = self.base_frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L62_C3", "label": "self.msg.poses =", "type": "assigned_variable", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.5962, 0.0096, 3, 0.25, 0.1613, 454, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.msg.poses", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.msg.poses = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L65_C3", "label": "self.tool_pose.position.x =", "type": "assigned_variable", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.625, 0.0096, 3, 0.25, 0.1935, 967, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tool_pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.tool_pose.position.x = self.tool_p[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L66_C3", "label": "self.tool_pose.position.y =", "type": "assigned_variable", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.6346, 0.0096, 3, 0.25, 0.2258, 443, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tool_pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.tool_pose.position.y = self.tool_p[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L67_C3", "label": "self.tool_pose.position.z =", "type": "assigned_variable", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.6442, 0.0096, 3, 0.25, 0.2581, 407, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tool_pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.tool_pose.position.z = self.tool_p[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L68_C3", "label": "self.tool_pose.orientation.x =", "type": "assigned_variable", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.6538, 0.0096, 3, 0.25, 0.2903, 133, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tool_pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.tool_pose.orientation.x = self.tool_q[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L69_C3", "label": "self.tool_pose.orientation.y =", "type": "assigned_variable", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.6635, 0.0096, 3, 0.25, 0.3226, 861, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tool_pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.tool_pose.orientation.y = self.tool_q[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L70_C3", "label": "self.tool_pose.orientation.z =", "type": "assigned_variable", "loc": [70, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.6731, 0.0096, 3, 0.25, 0.3548, 229, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tool_pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.tool_pose.orientation.z = self.tool_q[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L71_C3", "label": "self.tool_pose.orientation.w =", "type": "assigned_variable", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.6827, 0.0096, 3, 0.25, 0.3871, 19, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tool_pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.tool_pose.orientation.w = self.tool_q[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Expr_L72_C3", "label": "append()", "type": "expression", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [8, 3, 0.6923, 0.0096, 3, 0.25, 0.4194, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself.msg.poses.append(self.tool_pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L74_C3", "label": "self.head_pose.position.x =", "type": "assigned_variable", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.7115, 0.0096, 3, 0.25, 0.4516, 449, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.head_pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.head_pose.position.x = self.head_p[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L75_C3", "label": "self.head_pose.position.y =", "type": "assigned_variable", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.7212, 0.0096, 3, 0.25, 0.4839, 130, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.head_pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.head_pose.position.y = self.head_p[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L76_C3", "label": "self.head_pose.position.z =", "type": "assigned_variable", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.7308, 0.0096, 3, 0.25, 0.5161, 32, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.head_pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.head_pose.position.z = self.head_p[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L77_C3", "label": "self.head_pose.orientation.x =", "type": "assigned_variable", "loc": [77, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.7404, 0.0096, 3, 0.25, 0.5484, 896, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.head_pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.head_pose.orientation.x = self.head_q[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L78_C3", "label": "self.head_pose.orientation.y =", "type": "assigned_variable", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.75, 0.0096, 3, 0.25, 0.5806, 751, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.head_pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.head_pose.orientation.y = self.head_q[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L79_C3", "label": "self.head_pose.orientation.z =", "type": "assigned_variable", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.7596, 0.0096, 3, 0.25, 0.6129, 516, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.head_pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.head_pose.orientation.z = self.head_q[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L80_C3", "label": "self.head_pose.orientation.w =", "type": "assigned_variable", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.7692, 0.0096, 3, 0.25, 0.6452, 445, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.head_pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.head_pose.orientation.w = self.head_q[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Expr_L81_C3", "label": "append()", "type": "expression", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [8, 3, 0.7788, 0.0096, 3, 0.25, 0.6774, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself.msg.poses.append(self.head_pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L83_C3", "label": "self.torso_pose.position.x =", "type": "assigned_variable", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.7981, 0.0096, 3, 0.25, 0.7097, 689, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.torso_pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.torso_pose.position.x = self.torso_p[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L84_C3", "label": "self.torso_pose.position.y =", "type": "assigned_variable", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.8077, 0.0096, 3, 0.25, 0.7419, 173, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.torso_pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.torso_pose.position.y = self.torso_p[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L85_C3", "label": "self.torso_pose.position.z =", "type": "assigned_variable", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.8173, 0.0096, 3, 0.25, 0.7742, 129, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.torso_pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.torso_pose.position.z = self.torso_p[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L86_C3", "label": "self.torso_pose.orientation.x =", "type": "assigned_variable", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.8269, 0.0096, 3, 0.25, 0.8065, 771, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.torso_pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.torso_pose.orientation.x = self.torso_q[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L87_C3", "label": "self.torso_pose.orientation.y =", "type": "assigned_variable", "loc": [87, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.8365, 0.0096, 3, 0.25, 0.8387, 227, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.torso_pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.torso_pose.orientation.y = self.torso_q[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L88_C3", "label": "self.torso_pose.orientation.z =", "type": "assigned_variable", "loc": [88, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.8462, 0.0096, 3, 0.25, 0.871, 272, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.torso_pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.torso_pose.orientation.z = self.torso_q[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L89_C3", "label": "self.torso_pose.orientation.w =", "type": "assigned_variable", "loc": [89, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [14, 3, 0.8558, 0.0096, 3, 0.25, 0.9032, 407, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.torso_pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.torso_pose.orientation.w = self.torso_q[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Expr_L90_C3", "label": "append()", "type": "expression", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [8, 3, 0.8654, 0.0096, 3, 0.25, 0.9355, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself.msg.poses.append(self.torso_pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Expr_L92_C3", "label": "publish()", "type": "expression", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [8, 3, 0.8846, 0.0096, 3, 0.25, 0.9677, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": "\t\t\tself.pub.publish(self.msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Expr_L95_C3", "label": "sleep()", "type": "expression", "loc": [95, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "vector": [8, 3, 0.9135, 0.0096, 3, 0.25, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": "\t\t\trospy.sleep(1/100.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:If_L98_C0", "label": "if", "type": "if", "loc": [98, 103], "level": 0, "parent": null, "vector": [4, 0, 0.9663, 0.0577, 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\tdata = posearray_wrench_publisher()\n\trospy.sleep(1)\n\ttry:\n\t\tdata.pose_wrench_pub()\n\texcept rospy.ROSInterruptException: pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L99_C1", "label": "data = posearray_wrench_publisher()", "type": "assigned_variable", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:If_L98_C0", "vector": [14, 1, 0.9519, 0.0096, 1, 0.52, 0.0, 929, 3, 0, 0, 0, 896, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "posearray_wrench_publisher", "annotation": ""}, "snippet": "\tdata = posearray_wrench_publisher()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Expr_L100_C1", "label": "sleep()", "type": "expression", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:If_L98_C0", "vector": [8, 1, 0.9615, 0.0096, 1, 0.52, 0.5, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": "\trospy.sleep(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Try_L101_C1", "label": "try", "type": "try", "loc": [101, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:If_L98_C0", "vector": [7, 1, 0.9808, 0.0288, 1, 0.52, 1.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\ttry:\n\t\tdata.pose_wrench_pub()\n\texcept rospy.ROSInterruptException: pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99641:Expr_L102_C2", "label": "pose_wrench_pub()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99641:Try_L101_C1", "vector": [8, 2, 0.9808, 0.0096, 2, 0.97, 0.0, 811, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pose_wrench_pub", "arg_names": [], "import_names": [], "rhs_call_name": "pose_wrench_pub", "annotation": ""}, "snippet": "\t\tdata.pose_wrench_pub()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L18_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Expr_L21_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L23_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Return_L25_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L34_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L35_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Expr_L37_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L38_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L40_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L41_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L42_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L43_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L44_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L45_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L48_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L48_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L49_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L52_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:FunctionDef_L52_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L54_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L56_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L58_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L60_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L61_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L62_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L65_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L66_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L67_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L68_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L69_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L70_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L71_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Expr_L72_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L74_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L75_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L76_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L77_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L78_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L79_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L80_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Expr_L81_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L83_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L84_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L85_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L86_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L87_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L88_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L89_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Expr_L90_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Expr_L92_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:While_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Expr_L95_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Assign_L99_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Expr_L100_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Try_L101_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99641:Try_L101_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99641:Expr_L102_C2"}]
#!/usr/bin/python import roslib roslib.load_manifest('rospy') roslib.load_manifest('std_msgs') import rospy, optparse, math, time import numpy as np import serial from std_msgs.msg import Bool class shaver_pub(): def __init__(self): self.pub = rospy.Publisher('/ros_switch', Bool) rospy.init_node('shaver_pwr_pub', anonymous = True) rospy.logout('shaver_pwr_pub node publishing..') self.state = False self.pwr_on = 'Power is on' self.pwr_off = 'Power is off' def input_state(self): raw_input("\nPress Enter to Toggle") self.state = not self.state self.pub.publish(Bool(self.state)) if self.state: print self.pwr_on else: print self.pwr_off if __name__ == '__main__': pwr = shaver_pub() while not rospy.is_shutdown(): pwr.input_state()
ajibawa-2023/Python-Code-Large/train/row_99642
26
35
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99642:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0857, 0.0286, 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_99642:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.1143, 0.0286, 0, 0.66, 0.125, 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('rospy')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.1429, 0.0286, 0, 0.66, 0.25, 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_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:Import_L6_C0", "label": "rospy import rospy, optparse, math\u2026", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1714, 0.0286, 0, 0.66, 0.375, 164, 0, 4, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy", "optparse", "math", "time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy, optparse, math, time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:Import_L7_C0", "label": "numpy import np", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.0286, 0, 0.66, 0.5, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:Import_L8_C0", "label": "serial import serial", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.2286, 0.0286, 0, 0.66, 0.625, 601, 0, 1, 0, 0, 601, 0, 0], "semantic": {"name": "serial", "arg_names": [], "import_names": ["serial"], "rhs_call_name": "", "annotation": ""}, "snippet": "import serial"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:ImportFrom_L9_C0", "label": "from std_msgs.msg import Bool", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.2571, 0.0286, 0, 0.66, 0.75, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Bool"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Bool"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:ClassDef_L12_C0", "label": "shaver_pub", "type": "class", "loc": [12, 29], "level": 0, "parent": null, "vector": [3, 0, 0.5857, 0.5143, 0, 0.66, 0.875, 931, 0, 2, 0, 0, 0, 0, 8], "semantic": {"name": "shaver_pub", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class shaver_pub():\n\tdef __init__(self):\n\t\tself.pub = rospy.Publisher('/ros_switch', Bool)\n\t\trospy.init_node('shaver_pwr_pub', anonymous = True)\n\t\trospy.logout('shaver_pwr_pub node publishing..')\n\t\tself.state = False\n\t\tself.pwr_on = 'Power is on'\n\t\tself.pwr_off = 'Power is off'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L13_C1", "label": "__init__", "type": "function", "loc": [13, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99642:ClassDef_L12_C0", "vector": [2, 1, 0.4571, 0.2, 1, 0.99, 0.0, 555, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.pub = rospy.Publisher('/ros_switch', Bool)\n\t\trospy.init_node('shaver_pwr_pub', anonymous = True)\n\t\trospy.logout('shaver_pwr_pub node publishing..')\n\t\tself.state = False\n\t\tself.pwr_on = 'Power is on'\n\t\tself.pwr_off = 'Power is off'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:Assign_L14_C2", "label": "self.pub = Publisher()", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L13_C1", "vector": [14, 2, 0.4, 0.0286, 2, 0.74, 0.0, 86, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "\t\tself.pub = rospy.Publisher('/ros_switch', Bool)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:Expr_L15_C2", "label": "init_node()", "type": "expression", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L13_C1", "vector": [8, 2, 0.4286, 0.0286, 2, 0.74, 0.2, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": "\t\trospy.init_node('shaver_pwr_pub', anonymous = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:Expr_L16_C2", "label": "logout()", "type": "expression", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L13_C1", "vector": [8, 2, 0.4571, 0.0286, 2, 0.74, 0.4, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": "\t\trospy.logout('shaver_pwr_pub node publishing..')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:Assign_L17_C2", "label": "self.state =", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L13_C1", "vector": [14, 2, 0.4857, 0.0286, 2, 0.74, 0.6, 765, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.state = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:Assign_L18_C2", "label": "self.pwr_on =", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L13_C1", "vector": [14, 2, 0.5143, 0.0286, 2, 0.74, 0.8, 348, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.pwr_on", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.pwr_on = 'Power is on'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:Assign_L19_C2", "label": "self.pwr_off =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L13_C1", "vector": [14, 2, 0.5429, 0.0286, 2, 0.74, 1.0, 388, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.pwr_off", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.pwr_off = 'Power is off'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L22_C1", "label": "input_state", "type": "function", "loc": [22, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99642:ClassDef_L12_C0", "vector": [2, 1, 0.7286, 0.2286, 1, 0.99, 1.0, 316, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "input_state", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef input_state(self):\n\t\traw_input(\"\\nPress Enter to Toggle\")\n\t\tself.state = not self.state\n\t\tself.pub.publish(Bool(self.state))\n\t\tif self.state:\n\t\t\tprint(self.pwr_on)\n\t\telse:\n\t\t\tprint(self.pwr_off)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:Expr_L23_C2", "label": "raw_input()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L22_C1", "vector": [8, 2, 0.6571, 0.0286, 2, 0.69, 0.0, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": "\t\traw_input(\"\\nPress Enter to Toggle\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:Assign_L24_C2", "label": "self.state =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L22_C1", "vector": [14, 2, 0.6857, 0.0286, 2, 0.69, 0.3333, 765, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.state = not self.state"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:Expr_L25_C2", "label": "publish()", "type": "expression", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L22_C1", "vector": [8, 2, 0.7143, 0.0286, 2, 0.69, 0.6667, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": "\t\tself.pub.publish(Bool(self.state))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:If_L26_C2", "label": "if", "type": "if", "loc": [26, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L22_C1", "vector": [4, 2, 0.7857, 0.1143, 2, 0.69, 1.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif self.state:\n\t\t\tprint(self.pwr_on)\n\t\telse:\n\t\t\tprint(self.pwr_off)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:Expr_L27_C3", "label": "print()", "type": "expression", "loc": [27, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99642:If_L26_C2", "vector": [8, 3, 0.7714, 0.0286, 3, 0.87, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\t\tprint(self.pwr_on)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:Expr_L29_C3", "label": "print()", "type": "expression", "loc": [29, 29], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99642:If_L26_C2", "vector": [8, 3, 0.8286, 0.0286, 3, 0.87, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\t\tprint(self.pwr_off)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:If_L31_C0", "label": "if", "type": "if", "loc": [31, 34], "level": 0, "parent": null, "vector": [4, 0, 0.9286, 0.1143, 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\tpwr = shaver_pub()\n\twhile not rospy.is_shutdown():\n\t\tpwr.input_state()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:Assign_L32_C1", "label": "pwr = shaver_pub()", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99642:If_L31_C0", "vector": [14, 1, 0.9143, 0.0286, 1, 0.78, 0.0, 264, 3, 0, 0, 0, 931, 10, 1], "semantic": {"name": "pwr", "arg_names": [], "import_names": [], "rhs_call_name": "shaver_pub", "annotation": ""}, "snippet": "\tpwr = shaver_pub()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:While_L33_C1", "label": "while", "type": "while", "loc": [33, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99642:If_L31_C0", "vector": [5, 1, 0.9571, 0.0571, 1, 0.78, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\twhile not rospy.is_shutdown():\n\t\tpwr.input_state()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99642:Expr_L34_C2", "label": "input_state()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99642:While_L33_C1", "vector": [8, 2, 0.9714, 0.0286, 2, 0.6, 0.0, 316, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "input_state", "arg_names": [], "import_names": [], "rhs_call_name": "input_state", "annotation": ""}, "snippet": "\t\tpwr.input_state()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99642:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L13_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L13_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99642:Assign_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L13_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99642:Expr_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L13_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99642:Expr_L16_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L13_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99642:Assign_L17_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L13_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99642:Assign_L18_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L13_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99642:Assign_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99642:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L22_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L22_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99642:Expr_L23_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L22_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99642:Assign_L24_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L22_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99642:Expr_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99642:FunctionDef_L22_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99642:If_L26_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99642:If_L26_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99642:Expr_L27_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99642:If_L26_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99642:Expr_L29_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99642:If_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99642:Assign_L32_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99642:If_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99642:While_L33_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99642:While_L33_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99642:Expr_L34_C2"}]
#!/usr/bin/python import roslib roslib.load_manifest('tf') roslib.load_manifest('hrl_lib') import math, time, optparse import numpy as np import tf.transformations as tr import cPickle as pkl import scipy.stats as st import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import scipy.optimize as so import hrl_lib.util as ut import hrl_lib.transforms as hrl_tr def parse(): parser = optparse.OptionParser('Input the Pose node name and the ft sensor node name') parser.add_option("-n", "--name", action="store", type="string",\ dest="file_name", default="test") (options, args) = parser.parse_args() print 'Opening file name: ',options.file_name return options.file_name def compare(file1,file2): f1=ut.load_pickle(file1+'.pkl') f2=ut.load_pickle(file2+'.pkl') force1 = f1['force'] force2 = f2['force'] fmag1 = [] fmag2 = [] for i in range(len(force1)): fmag1.append(np.linalg.norm(force1[i])) for i in range(len(force2)): fmag2.append(np.linalg.norm(force2[i])) res = st.ttest_ind(fmag1,fmag2) print res if __name__ == '__main__': file_name = parse() d = ut.load_pickle(file_name+'.pkl') log = open('result_'+file_name+'.log','w') force = d['force'] force_raw = d['force_raw'] rot = d['rot_data'] quat = d['quat'] pos = d['pos'] ptime = np.array(d['ptime'])-d['init_time'] ftime = np.array(d['ftime'])-d['init_time'] init_time = d['init_time'] ptime2 = [] force_mag = [] length = [] accel = [] accel_mag = [] v = [] fx = [] fy = [] fz = [] x = [] y = [] z = [] vx = [] vy = [] vz = [] rotx = [] roty = [] rotz = [] time_diff = [] vel = np.matrix([0.,0.,0.]).T for i in range(len(pos)): if i < len(pos)-1: if ptime[i+1]-ptime[i] > .02: vel=(pos[i+1]-pos[i])/(ptime[i+1]-ptime[i]) length.append(np.linalg.norm(vel)*(ptime[i+1]-ptime[i])) ptime2.append(ptime[i]) v.append(np.linalg.norm(vel)) vx.append(vel[0,0]) vy.append(vel[1,0]) vz.append(vel[2,0]) x.append(pos[i][0,0]) y.append(pos[i][1,0]) z.append(pos[i][2,0]) rotx.append(math.degrees(rot[i][0,0])) roty.append(math.degrees(rot[i][1,0])) rotz.append(math.degrees(rot[i][2,0])) for i in range(len(force)): force_mag.append(np.linalg.norm(force[i])) fx.append(force[i][0,0]) fy.append(force[i][1,0]) fz.append(force[i][2,0]) # for i in range(len(v)-1): # a = (v[i+1]-v[i])/.01 # accel.append(a) # accel_mag.append(np.linalg.norm(a)) print 'time: ', max(ptime) print 'max speed: ', max(v) print 'min speed: ', min(v) path_length = sum(length) print 'Path Length: ', path_length print 'max vel: ', max(vx),max(vy),max(vz) print 'min vel: ', min(vx),min(vy),min(vz) print 'ave vel: ', np.mean(vx),np.mean(vx),np.mean(vz) print 'max force: ', max(fx), max(fy), max(fz) print 'min force: ', min(fx), min(fy), min(fz) print 'ave force: ', np.mean(fx),np.mean(fx),np.mean(fz) print 'max force_mag: ', max(force_mag) print 'min force_mag: ', min(force_mag) print 'ave force_mag: ', np.mean(force_mag) print 'std_force_mag: ', np.std(force_mag) print 'integration of force (N*s): ',sum(np.array(force_mag)*.01) print >> log, 'Categories x-axis y-axis z-axis' print >> log, 'max_vel', max(vx),max(vy),max(vz) print >> log, 'min_vel', min(vx),min(vy),min(vz) print >> log, 'ave_vel', np.mean(vx),np.mean(vx),np.mean(vz) print >> log, 'max_force', max(fx), max(fy), max(fz) print >> log, 'min_force', min(fx), min(fy), min(fz) print >> log, 'ave_force', np.mean(fx),np.mean(fx),np.mean(fz) print >> log, 'time', max(ptime) print >> log, 'path_length', sum(length) print >> log, 'max_force_mag', max(force_mag) print >> log, 'min_force_mag', min(force_mag) print >> log, 'ave_force_mag', np.mean(force_mag) print >> log, 'std_force_mag', np.std(force_mag) print >> log, 'int_force_mag',sum(np.array(force_mag)*.01) fig = plt.figure() # ax = Axes3D(fig) # ax.scatter(x,y,z,zdir = 'z') fig.suptitle(file_name+'_Position') ax = fig.add_subplot(3,1,1) ax.plot(ptime,x) ax.grid(True) ax.set_ylabel('x (m)') ax = fig.add_subplot(3,1,2) ax.plot(ptime,y) ax.grid(True) ax.set_ylabel('y (m)') ax = fig.add_subplot(3,1,3) ax.plot(ptime,z) ax.grid(True) ax.set_ylabel('z (m)') fig2 = plt.figure() fig2.suptitle(file_name+'_Force') ax = fig2.add_subplot(3,1,1) ax.plot(ftime,fx) ax.grid(True) ax.set_ylabel('Fx (N)') ax = fig2.add_subplot(3,1,2) ax.plot(ftime,fy) ax.grid(True) ax.set_ylabel('Fy (N)') ax = fig2.add_subplot(3,1,3) ax.plot(ftime,fz) ax.grid(True) ax.set_ylabel('Fz (N)') fig2b = plt.figure() fig2b.suptitle(file_name+' 3D Tra') ax = Axes3D(fig2b) ax.plot3D(x,y,z) ax.set_xlabel('x') ax.set_ylabel('y') ax.set_zlabel('z') fig2c = plt.figure() fig2c.suptitle(file_name+' Force Magnitute') ax = fig2c.gca() ax.plot(ftime,force_mag) ax.set_ylabel('Force (N)') ax.set_xlabel('Time (s)') fig3 = plt.figure() fig3.suptitle(file_name+'_Velocity') ax = fig3.add_subplot(3,1,1) ax.plot(ptime2,vx) ax.grid(True) ax.set_ylabel('Vx (m/s)') ax = fig3.add_subplot(3,1,2) ax.plot(ptime2,vy) ax.grid(True) ax.set_ylabel('Vy (m/s)') ax = fig3.add_subplot(3,1,3) ax.plot(ptime2,vz) ax.grid(True) ax.set_ylabel('Vz (m/s)') fig3a = plt.figure() fig3a.suptitle(file_name+' Speed') ax = fig3a.gca() ax.plot(ptime2,v) ax.set_ylabel('Speed (m/s)') ax.set_xlabel('Time (s)') fig4 = plt.figure() fig4.suptitle(file_name+'_rotation') ax = fig4.add_subplot(3,1,1) ax.plot(ptime,rotx) ax.grid(True) ax.set_ylabel('angle (deg)') ax = fig4.add_subplot(3,1,2) ax.plot(ptime,roty) ax.grid(True) ax.set_ylabel('angle (deg)') ax = fig4.add_subplot(3,1,3) ax.plot(ptime,rotz) ax.grid(True) ax.set_ylabel('angle (deg)') plt.show() log.close() # compare('aa_scratch_arm','aa_scratch_face')
ajibawa-2023/Python-Code-Large/train/row_99644
30
38
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0263, 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_99644:Import_L2_C0", "label": "math import math, time, optparse", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0263, 0, 0.66, 0.0833, 526, 0, 3, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math", "time", "optparse"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math, time, optparse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0789, 0.0263, 0, 0.66, 0.1667, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Import_L4_C0", "label": "tf.transformations import tr", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1053, 0.0263, 0, 0.66, 0.25, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Import_L5_C0", "label": "cPickle import pkl", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1316, 0.0263, 0, 0.66, 0.3333, 279, 0, 1, 0, 0, 279, 0, 0], "semantic": {"name": "cPickle", "arg_names": [], "import_names": ["pkl"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cPickle as pkl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Import_L6_C0", "label": "scipy.stats import st", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1579, 0.0263, 0, 0.66, 0.4167, 413, 0, 1, 0, 0, 413, 0, 0], "semantic": {"name": "scipy.stats", "arg_names": [], "import_names": ["st"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.stats as st"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Import_L7_C0", "label": "matplotlib.pyplot import plt", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1842, 0.0263, 0, 0.66, 0.5, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "import_names": ["plt"], "rhs_call_name": "", "annotation": ""}, "snippet": "import matplotlib.pyplot as plt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:ImportFrom_L8_C0", "label": "from mpl_toolkits.mplot3d import Axes3D", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.2105, 0.0263, 0, 0.66, 0.5833, 792, 0, 1, 0, 0, 792, 0, 0], "semantic": {"name": "mpl_toolkits.mplot3d", "arg_names": [], "import_names": ["Axes3D"], "rhs_call_name": "", "annotation": ""}, "snippet": "from mpl_toolkits.mplot3d import Axes3D"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Import_L10_C0", "label": "scipy.optimize import so", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.2632, 0.0263, 0, 0.66, 0.6667, 359, 0, 1, 0, 0, 359, 0, 0], "semantic": {"name": "scipy.optimize", "arg_names": [], "import_names": ["so"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.optimize as so"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Import_L11_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.2895, 0.0263, 0, 0.66, 0.75, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Import_L12_C0", "label": "hrl_lib.transforms import hrl_tr", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.3158, 0.0263, 0, 0.66, 0.8333, 82, 0, 1, 0, 0, 82, 0, 0], "semantic": {"name": "hrl_lib.transforms", "arg_names": [], "import_names": ["hrl_tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.transforms as hrl_tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L14_C0", "label": "parse", "type": "function", "loc": [14, 21], "level": 0, "parent": null, "vector": [2, 0, 0.4605, 0.2105, 0, 0.66, 0.9167, 678, 0, 0, 1, 0, 0, 0, 4], "semantic": {"name": "parse", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def parse():\n\tparser = optparse.OptionParser('Input the Pose node name and the ft sensor node name')\n\tparser.add_option(\"-n\", \"--name\", action=\"store\", type=\"string\",\\\n\t\tdest=\"file_name\", default=\"test\")\n\t(options, args) = parser.parse_args()\n\tprint('Opening file name: ',options.file_name)\n\n\treturn options.file_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Assign_L15_C1", "label": "parser = OptionParser()", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L14_C0", "vector": [14, 1, 0.3947, 0.0263, 1, 0.95, 0.0, 968, 3, 1, 0, 0, 894, 10, 1], "semantic": {"name": "parser", "arg_names": [], "import_names": [], "rhs_call_name": "OptionParser", "annotation": ""}, "snippet": "\tparser = optparse.OptionParser('Input the Pose node name and the ft sensor node name')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Expr_L16_C1", "label": "add_option()", "type": "expression", "loc": [16, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L14_C0", "vector": [8, 1, 0.4342, 0.0526, 1, 0.95, 0.25, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": "\tparser.add_option(\"-n\", \"--name\", action=\"store\", type=\"string\",\\\n\t\tdest=\"file_name\", default=\"test\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Assign_L18_C1", "label": "options, args = parse_args()", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L14_C0", "vector": [14, 1, 0.4737, 0.0263, 1, 0.95, 0.5, 584, 3, 0, 0, 0, 187, 10, 1], "semantic": {"name": "options, args", "arg_names": [], "import_names": [], "rhs_call_name": "parse_args", "annotation": ""}, "snippet": "\t(options, args) = parser.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Expr_L19_C1", "label": "print()", "type": "expression", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L14_C0", "vector": [8, 1, 0.5, 0.0263, 1, 0.95, 0.75, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint('Opening file name: ',options.file_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Return_L21_C1", "label": "return", "type": "return", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L14_C0", "vector": [13, 1, 0.5526, 0.0263, 1, 0.95, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn options.file_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L23_C0", "label": "compare", "type": "function", "loc": [23, 36], "level": 0, "parent": null, "vector": [2, 0, 0.7763, 0.3684, 0, 0.66, 1.0, 383, 0, 2, 0, 0, 0, 0, 12], "semantic": {"name": "compare", "arg_names": ["file1", "file2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compare(file1,file2):\n\tf1=ut.load_pickle(file1+'.pkl')\n\tf2=ut.load_pickle(file2+'.pkl')\n\tforce1 = f1['force']\n\tforce2 = f2['force']\n\tfmag1 = []\n\tfmag2 = []\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Assign_L24_C1", "label": "f1 = load_pickle()", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L23_C0", "vector": [14, 1, 0.6316, 0.0263, 1, 0.33, 0.0, 282, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "f1", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": "\tf1=ut.load_pickle(file1+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Assign_L25_C1", "label": "f2 = load_pickle()", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L23_C0", "vector": [14, 1, 0.6579, 0.0263, 1, 0.33, 0.1111, 833, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "f2", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": "\tf2=ut.load_pickle(file2+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Assign_L26_C1", "label": "force1 =", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L23_C0", "vector": [14, 1, 0.6842, 0.0263, 1, 0.33, 0.2222, 850, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tforce1 = f1['force']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Assign_L27_C1", "label": "force2 =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L23_C0", "vector": [14, 1, 0.7105, 0.0263, 1, 0.33, 0.3333, 20, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tforce2 = f2['force']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Assign_L28_C1", "label": "fmag1 =", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L23_C0", "vector": [14, 1, 0.7368, 0.0263, 1, 0.33, 0.4444, 111, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "fmag1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfmag1 = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Assign_L29_C1", "label": "fmag2 =", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L23_C0", "vector": [14, 1, 0.7632, 0.0263, 1, 0.33, 0.5556, 329, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "fmag2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfmag2 = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:For_L31_C1", "label": "for i", "type": "for", "loc": [31, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L23_C0", "vector": [6, 1, 0.8289, 0.0526, 1, 0.33, 0.6667, 826, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor i in range(len(force1)):\n\t\tfmag1.append(np.linalg.norm(force1[i]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Expr_L32_C2", "label": "append()", "type": "expression", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99644:For_L31_C1", "vector": [8, 2, 0.8421, 0.0263, 2, 0.56, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\tfmag1.append(np.linalg.norm(force1[i]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:For_L33_C1", "label": "for i", "type": "for", "loc": [33, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L23_C0", "vector": [6, 1, 0.8816, 0.0526, 1, 0.33, 0.7778, 826, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor i in range(len(force2)):\n\t\tfmag2.append(np.linalg.norm(force2[i]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Expr_L34_C2", "label": "append()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99644:For_L33_C1", "vector": [8, 2, 0.8947, 0.0263, 2, 0.49, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\tfmag2.append(np.linalg.norm(force2[i]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Assign_L35_C1", "label": "res = ttest_ind()", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L23_C0", "vector": [14, 1, 0.9211, 0.0263, 1, 0.33, 0.8889, 413, 3, 2, 0, 0, 151, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "ttest_ind", "annotation": ""}, "snippet": "\tres = st.ttest_ind(fmag1,fmag2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99644:Expr_L36_C1", "label": "print()", "type": "expression", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L23_C0", "vector": [8, 1, 0.9474, 0.0263, 1, 0.33, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint(res)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99644:Assign_L15_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99644:Expr_L16_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99644:Assign_L18_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99644:Expr_L19_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99644:Return_L21_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99644:Assign_L24_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99644:Assign_L25_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99644:Assign_L26_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99644:Assign_L27_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99644:Assign_L28_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99644:Assign_L29_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99644:For_L31_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99644:For_L31_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99644:Expr_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99644:For_L33_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99644:For_L33_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99644:Expr_L34_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99644:Assign_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99644:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99644:Expr_L36_C1"}]
#!/usr/bin/python import roslib roslib.load_manifest('stereo_anaglyph') import rospy import hrl_camera.ros_camera as rc import cv def add_alpha_channel(bgr, alpha_val): w, h = cv.GetSize(bgr) bgra = cv.CreateImage((w, h), cv.IPL_DEPTH_8U, 4) alpha = cv.CreateImage((w, h), cv.IPL_DEPTH_8U, 1) chan1 = cv.CreateImage((w, h), cv.IPL_DEPTH_8U, 1) chan2 = cv.CreateImage((w, h), cv.IPL_DEPTH_8U, 1) chan3 = cv.CreateImage((w, h), cv.IPL_DEPTH_8U, 1) [cv.Set(c, 0) for c in [chan1, chan2, chan3, bgra, alpha]] cv.Split(bgr, chan1, chan2, chan3, None) cv.Set(alpha, (alpha_val)) cv.Merge(chan1, chan2, chan3, alpha, bgra) return bgra def remove_channels(in_bgra, channel_indices): w, h = cv.GetSize(in_bgra) chan1 = cv.CreateImage((w,h), cv.IPL_DEPTH_8U, 1) chan2 = cv.CreateImage((w,h), cv.IPL_DEPTH_8U, 1) chan3 = cv.CreateImage((w,h), cv.IPL_DEPTH_8U, 1) chan4 = cv.CreateImage((w,h), cv.IPL_DEPTH_8U, 1) bgra = cv.CreateImage((w,h), cv.IPL_DEPTH_8U, 4) [cv.Set(c, 0) for c in [chan1, chan2, chan3, chan4, bgra]] cv.Split(in_bgra, chan1, chan2, chan3, chan4) chan_list = [chan1, chan2, chan3, chan4] for i in channel_indices: chan_list[i] = None chan_list.append(bgra) cv.Merge(*tuple(chan_list)) return bgra def anaglyph(left_color, right_color, correction): #create oversized image #result = cv.CreateImage(cv.GetSize(right_color), cv.IPL_DEPTH_8U, 4) w, h = cv.GetSize(left_color) bgra = cv.CreateImage((w*2, h), cv.IPL_DEPTH_8U, 4) cv.Set(bgra, 0) right_bgra = add_alpha_channel(right_color, round(255/2.)) #cyan (remove red?) left_bgra = add_alpha_channel(left_color, round(255/2.)) #red (remove blue?, green?) #remove blue & green from left => red left_red = remove_channels(left_bgra, [0, 1]) #remove red from right_bgra => cyan right_cyan = remove_channels(right_bgra, [2]) if correction < 0: left_area = cv.GetSubRect(bgra, (-correction,0,w,h)) right_area = cv.GetSubRect(bgra, (0, 0, w, h)) valid_area = cv.GetSubRect(bgra, (-correction, 0, w + correction, h)) else: #copy left & right onto bgra left_area = cv.GetSubRect(bgra, (0,0,w,h)) right_area = cv.GetSubRect(bgra, (correction, 0, w, h)) valid_area = cv.GetSubRect(bgra, (correction, 0, w - correction, h)) cv.Add(left_red, left_area, left_area) cv.Add(right_cyan, right_area, right_area) #return right_cyan #return left_red #return left_bgra #return bgra return valid_area if __name__ == '__main__': import optparse import time from sensor_msgs.msg import Image from cv_bridge.cv_bridge import CvBridge, CvBridgeError p = optparse.OptionParser() p.add_option('-c', action='store', default='/wide_stereo', type='string', dest='cam', help='which camera to listen to') p.add_option('-d', action='store', default=30, type='int', dest='dist', help='separation distance') p.add_option('-s', action='store_true', dest='headless', help='headless mode') opt, args = p.parse_args() cameras = [opt.cam + '/left/image_rect_color', opt.cam + '/right/image_rect_color'] stereo_listener = rc.ROSStereoListener(cameras) if not opt.headless: #cv.NamedWindow('left', 0) #cv.NamedWindow('right', 0) cv.NamedWindow('stereo-anaglyph', 0) cv.ResizeWindow('stereo-anaglyph', 640, 480) cv.WaitKey(10) else: bridge = CvBridge() image_pub = rospy.Publisher('stereo_anaglyph', Image) anaglyph_cyan_image_distance_correction = rospy.get_param('anaglyph_dist', opt.dist) left = 1113937# 65361 right = 1113939#65363 escape = 1048603#27 while not rospy.is_shutdown(): l, r = stereo_listener.next() red_blue = anaglyph(l, r, anaglyph_cyan_image_distance_correction) if not opt.headless: #cv.ShowImage('left', l) #cv.ShowImage('right', r) cv.ShowImage('stereo-anaglyph', red_blue) k = cv.WaitKey(10) print k if k == escape: break if k == left: anaglyph_cyan_image_distance_correction = anaglyph_cyan_image_distance_correction - 1 print anaglyph_cyan_image_distance_correction if k == right: anaglyph_cyan_image_distance_correction = anaglyph_cyan_image_distance_correction + 1 print anaglyph_cyan_image_distance_correction else: rosimage = bridge.cv_to_imgmsg(red_blue, "bgra8") image_pub.publish(rosimage) #from opencv import cv #from opencv import highgui #from time import sleep # #def makeMagic(left, right, out): # chans=[] # for i in range(6): # chans.append(cv.cvCreateImage(cv.cvGetSize(left),8,1)) # cv.cvSplit(left, chans[0], chans[1], chans[2], None); # cv.cvSplit(right, chans[3], chans[4], chans[5], None); # cv.cvMerge(chans[3],chans[4],chans[2], None, out); # # #cv.cvMerge(None,chans[1],None, None, out); # #cam=[] #def main(): # cam.append(highgui.cvCreateCameraCapture(0)) # cam.append(highgui.cvCreateCameraCapture(1)) # highgui.cvNamedWindow ("carrots", highgui.CV_WINDOW_AUTOSIZE) # # uno=highgui.cvQueryFrame(cam[0]); # dos=highgui.cvQueryFrame(cam[1]); # # highgui.cvShowImage("carrots",uno); # highgui.cvWaitKey(0); # highgui.cvShowImage("carrots",dos); # highgui.cvWaitKey(0); # # merge=cv.cvCreateImage(cv.cvGetSize(uno),8,3) # makeMagic(uno, dos, merge) # # highgui.cvShowImage("carrots",merge); # highgui.cvWaitKey(0); # # while True : # uno=highgui.cvQueryFrame(cam[0]); # dos=highgui.cvQueryFrame(cam[1]); # makeMagic(uno, dos, merge); # highgui.cvShowImage("carrots",merge); # if highgui.cvWaitKey(1)=="s": # cam.append(cam.pop(0)) # print "tick" # #if __name__=="__main__": # main()
ajibawa-2023/Python-Code-Large/train/row_99645
88
202
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0099, 0.005, 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_99645:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0149, 0.005, 0, 0.66, 0.125, 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('stereo_anaglyph')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0198, 0.005, 0, 0.66, 0.25, 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_99645:Import_L5_C0", "label": "hrl_camera.ros_camera import rc", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0248, 0.005, 0, 0.66, 0.375, 798, 0, 1, 0, 0, 798, 0, 0], "semantic": {"name": "hrl_camera.ros_camera", "arg_names": [], "import_names": ["rc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_camera.ros_camera as rc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Import_L6_C0", "label": "cv import cv", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0297, 0.005, 0, 0.66, 0.5, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "label": "add_alpha_channel", "type": "function", "loc": [8, 20], "level": 0, "parent": null, "vector": [2, 0, 0.0693, 0.0644, 0, 0.66, 0.625, 392, 0, 2, 1, 0, 0, 0, 10], "semantic": {"name": "add_alpha_channel", "arg_names": ["bgr", "alpha_val"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def add_alpha_channel(bgr, alpha_val):\n w, h = cv.GetSize(bgr)\n bgra = cv.CreateImage((w, h), cv.IPL_DEPTH_8U, 4)\n alpha = cv.CreateImage((w, h), cv.IPL_DEPTH_8U, 1)\n chan1 = cv.CreateImage((w, h), cv.IPL_DEPTH_8U, 1)\n chan2 = cv.CreateImage((w, h), cv.IPL_DEPTH_8U, 1)\n chan3 = cv.CreateImage((w, h), cv.IPL_DEPTH_8U, 1)\n [cv.Set(c, 0) for c in [chan1, chan2, chan3, bgra, alpha]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L9_C4", "label": "w, h = GetSize()", "type": "assigned_variable", "loc": [9, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "vector": [14, 1, 0.0446, 0.005, 1, 0.04, 0.0, 806, 3, 1, 0, 0, 139, 10, 1], "semantic": {"name": "w, h", "arg_names": [], "import_names": [], "rhs_call_name": "GetSize", "annotation": ""}, "snippet": " w, h = cv.GetSize(bgr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L10_C4", "label": "bgra = CreateImage()", "type": "assigned_variable", "loc": [10, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "vector": [14, 1, 0.0495, 0.005, 1, 0.04, 0.1, 368, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "bgra", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " bgra = cv.CreateImage((w, h), cv.IPL_DEPTH_8U, 4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L11_C4", "label": "alpha = CreateImage()", "type": "assigned_variable", "loc": [11, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "vector": [14, 1, 0.0545, 0.005, 1, 0.04, 0.2, 993, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "alpha", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " alpha = cv.CreateImage((w, h), cv.IPL_DEPTH_8U, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L12_C4", "label": "chan1 = CreateImage()", "type": "assigned_variable", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "vector": [14, 1, 0.0594, 0.005, 1, 0.04, 0.3, 913, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "chan1", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " chan1 = cv.CreateImage((w, h), cv.IPL_DEPTH_8U, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L13_C4", "label": "chan2 = CreateImage()", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "vector": [14, 1, 0.0644, 0.005, 1, 0.04, 0.4, 363, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "chan2", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " chan2 = cv.CreateImage((w, h), cv.IPL_DEPTH_8U, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L14_C4", "label": "chan3 = CreateImage()", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "vector": [14, 1, 0.0693, 0.005, 1, 0.04, 0.5, 216, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "chan3", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " chan3 = cv.CreateImage((w, h), cv.IPL_DEPTH_8U, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L15_C4", "label": "expression", "type": "expression", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "vector": [8, 1, 0.0743, 0.005, 1, 0.04, 0.6, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " [cv.Set(c, 0) for c in [chan1, chan2, chan3, bgra, alpha]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L17_C4", "label": "Split()", "type": "expression", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "vector": [8, 1, 0.0842, 0.005, 1, 0.04, 0.7, 551, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Split", "arg_names": [], "import_names": [], "rhs_call_name": "Split", "annotation": ""}, "snippet": " cv.Split(bgr, chan1, chan2, chan3, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L18_C4", "label": "Set()", "type": "expression", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "vector": [8, 1, 0.0891, 0.005, 1, 0.04, 0.8, 438, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Set", "arg_names": [], "import_names": [], "rhs_call_name": "Set", "annotation": ""}, "snippet": " cv.Set(alpha, (alpha_val))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L19_C4", "label": "Merge()", "type": "expression", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "vector": [8, 1, 0.0941, 0.005, 1, 0.04, 0.9, 677, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Merge", "arg_names": [], "import_names": [], "rhs_call_name": "Merge", "annotation": ""}, "snippet": " cv.Merge(chan1, chan2, chan3, alpha, bgra)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Return_L20_C4", "label": "return", "type": "return", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "vector": [13, 1, 0.099, 0.005, 1, 0.04, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bgra"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "label": "remove_channels", "type": "function", "loc": [23, 37], "level": 0, "parent": null, "vector": [2, 0, 0.1485, 0.0743, 0, 0.66, 0.75, 728, 0, 2, 1, 0, 0, 0, 11], "semantic": {"name": "remove_channels", "arg_names": ["in_bgra", "channel_indices"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def remove_channels(in_bgra, channel_indices):\n w, h = cv.GetSize(in_bgra)\n chan1 = cv.CreateImage((w,h), cv.IPL_DEPTH_8U, 1)\n chan2 = cv.CreateImage((w,h), cv.IPL_DEPTH_8U, 1)\n chan3 = cv.CreateImage((w,h), cv.IPL_DEPTH_8U, 1)\n chan4 = cv.CreateImage((w,h), cv.IPL_DEPTH_8U, 1)\n bgra = cv.CreateImage((w,h), cv.IPL_DEPTH_8U, 4)\n [cv.Set(c, 0) for c in [chan1, chan2, chan3, chan4, bgra]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L24_C4", "label": "w, h = GetSize()", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "vector": [14, 1, 0.1188, 0.005, 1, 0.45, 0.0, 806, 3, 1, 0, 0, 139, 10, 1], "semantic": {"name": "w, h", "arg_names": [], "import_names": [], "rhs_call_name": "GetSize", "annotation": ""}, "snippet": " w, h = cv.GetSize(in_bgra)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L25_C4", "label": "chan1 = CreateImage()", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "vector": [14, 1, 0.1238, 0.005, 1, 0.45, 0.0833, 913, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "chan1", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " chan1 = cv.CreateImage((w,h), cv.IPL_DEPTH_8U, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L26_C4", "label": "chan2 = CreateImage()", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "vector": [14, 1, 0.1287, 0.005, 1, 0.45, 0.1667, 363, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "chan2", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " chan2 = cv.CreateImage((w,h), cv.IPL_DEPTH_8U, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L27_C4", "label": "chan3 = CreateImage()", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "vector": [14, 1, 0.1337, 0.005, 1, 0.45, 0.25, 216, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "chan3", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " chan3 = cv.CreateImage((w,h), cv.IPL_DEPTH_8U, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L28_C4", "label": "chan4 = CreateImage()", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "vector": [14, 1, 0.1386, 0.005, 1, 0.45, 0.3333, 912, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "chan4", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " chan4 = cv.CreateImage((w,h), cv.IPL_DEPTH_8U, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L29_C4", "label": "bgra = CreateImage()", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "vector": [14, 1, 0.1436, 0.005, 1, 0.45, 0.4167, 368, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "bgra", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " bgra = cv.CreateImage((w,h), cv.IPL_DEPTH_8U, 4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L30_C4", "label": "expression", "type": "expression", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "vector": [8, 1, 0.1485, 0.005, 1, 0.45, 0.5, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " [cv.Set(c, 0) for c in [chan1, chan2, chan3, chan4, bgra]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L31_C4", "label": "Split()", "type": "expression", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "vector": [8, 1, 0.1535, 0.005, 1, 0.45, 0.5833, 551, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Split", "arg_names": [], "import_names": [], "rhs_call_name": "Split", "annotation": ""}, "snippet": " cv.Split(in_bgra, chan1, chan2, chan3, chan4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L32_C4", "label": "chan_list =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "vector": [14, 1, 0.1584, 0.005, 1, 0.45, 0.6667, 437, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "chan_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " chan_list = [chan1, chan2, chan3, chan4]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:For_L33_C4", "label": "for i", "type": "for", "loc": [33, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "vector": [6, 1, 0.1658, 0.0099, 1, 0.45, 0.75, 826, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in channel_indices:\n chan_list[i] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L34_C8", "label": "assign", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:For_L33_C4", "vector": [14, 2, 0.1683, 0.005, 2, 0.97, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " chan_list[i] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L35_C4", "label": "append()", "type": "expression", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "vector": [8, 1, 0.1733, 0.005, 1, 0.45, 0.8333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " chan_list.append(bgra)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L36_C4", "label": "Merge()", "type": "expression", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "vector": [8, 1, 0.1782, 0.005, 1, 0.45, 0.9167, 677, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "Merge", "arg_names": [], "import_names": [], "rhs_call_name": "Merge", "annotation": ""}, "snippet": " cv.Merge(*tuple(chan_list))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Return_L37_C4", "label": "return", "type": "return", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "vector": [13, 1, 0.1832, 0.005, 1, 0.45, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bgra"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "label": "anaglyph", "type": "function", "loc": [40, 72], "level": 0, "parent": null, "vector": [2, 0, 0.2772, 0.1634, 0, 0.66, 0.875, 34, 0, 3, 1, 0, 0, 0, 17], "semantic": {"name": "anaglyph", "arg_names": ["left_color", "right_color", "correction"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def anaglyph(left_color, right_color, correction):\n #create oversized image\n #result = cv.CreateImage(cv.GetSize(right_color), cv.IPL_DEPTH_8U, 4)\n w, h = cv.GetSize(left_color)\n bgra = cv.CreateImage((w*2, h), cv.IPL_DEPTH_8U, 4)\n cv.Set(bgra, 0)\n right_bgra = add_alpha_channel(right_color, round(255/2.)) #cyan (remove red?)\n left_bgra = add_alpha_channel(left_color, round(255/2.)) #red (remove blue?, green?)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L43_C4", "label": "w, h = GetSize()", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "vector": [14, 1, 0.2129, 0.005, 1, 0.6, 0.0, 806, 3, 1, 0, 0, 139, 10, 1], "semantic": {"name": "w, h", "arg_names": [], "import_names": [], "rhs_call_name": "GetSize", "annotation": ""}, "snippet": " w, h = cv.GetSize(left_color)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L44_C4", "label": "bgra = CreateImage()", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "vector": [14, 1, 0.2178, 0.005, 1, 0.6, 0.1, 368, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "bgra", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " bgra = cv.CreateImage((w*2, h), cv.IPL_DEPTH_8U, 4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L45_C4", "label": "Set()", "type": "expression", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "vector": [8, 1, 0.2228, 0.005, 1, 0.6, 0.2, 438, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Set", "arg_names": [], "import_names": [], "rhs_call_name": "Set", "annotation": ""}, "snippet": " cv.Set(bgra, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L46_C4", "label": "right_bgra = add_alpha_channel()", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "vector": [14, 1, 0.2277, 0.005, 1, 0.6, 0.3, 165, 3, 2, 0, 0, 392, 10, 2], "semantic": {"name": "right_bgra", "arg_names": [], "import_names": [], "rhs_call_name": "add_alpha_channel", "annotation": ""}, "snippet": " right_bgra = add_alpha_channel(right_color, round(255/2.)) #cyan (remove red?)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L47_C4", "label": "left_bgra = add_alpha_channel()", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "vector": [14, 1, 0.2327, 0.005, 1, 0.6, 0.4, 788, 3, 2, 0, 0, 392, 10, 2], "semantic": {"name": "left_bgra", "arg_names": [], "import_names": [], "rhs_call_name": "add_alpha_channel", "annotation": ""}, "snippet": " left_bgra = add_alpha_channel(left_color, round(255/2.)) #red (remove blue?, green?)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L50_C4", "label": "left_red = remove_channels()", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "vector": [14, 1, 0.2475, 0.005, 1, 0.6, 0.5, 230, 3, 2, 0, 0, 728, 10, 1], "semantic": {"name": "left_red", "arg_names": [], "import_names": [], "rhs_call_name": "remove_channels", "annotation": ""}, "snippet": " left_red = remove_channels(left_bgra, [0, 1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L52_C4", "label": "right_cyan = remove_channels()", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "vector": [14, 1, 0.2574, 0.005, 1, 0.6, 0.6, 967, 3, 2, 0, 0, 728, 10, 1], "semantic": {"name": "right_cyan", "arg_names": [], "import_names": [], "rhs_call_name": "remove_channels", "annotation": ""}, "snippet": " right_cyan = remove_channels(right_bgra, [2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L55_C4", "label": "if", "type": "if", "loc": [55, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "vector": [4, 1, 0.2921, 0.0446, 1, 0.6, 0.7, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if correction < 0:\n left_area = cv.GetSubRect(bgra, (-correction,0,w,h))\n right_area = cv.GetSubRect(bgra, (0, 0, w, h))\n valid_area = cv.GetSubRect(bgra, (-correction, 0, w + correction, h))\n else:\n #copy left & right onto bgra\n left_area = cv.GetSubRect(bgra, (0,0,w,h))\n right_area = cv.GetSubRect(bgra, (correction, 0, w, h))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L56_C8", "label": "left_area = GetSubRect()", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L55_C4", "vector": [14, 2, 0.2772, 0.005, 2, 0.77, 0.0, 788, 3, 2, 0, 0, 469, 10, 1], "semantic": {"name": "left_area", "arg_names": [], "import_names": [], "rhs_call_name": "GetSubRect", "annotation": ""}, "snippet": " left_area = cv.GetSubRect(bgra, (-correction,0,w,h))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L57_C8", "label": "right_area = GetSubRect()", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L55_C4", "vector": [14, 2, 0.2822, 0.005, 2, 0.77, 0.2, 609, 3, 2, 0, 0, 469, 10, 1], "semantic": {"name": "right_area", "arg_names": [], "import_names": [], "rhs_call_name": "GetSubRect", "annotation": ""}, "snippet": " right_area = cv.GetSubRect(bgra, (0, 0, w, h))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L58_C8", "label": "valid_area = GetSubRect()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L55_C4", "vector": [14, 2, 0.2871, 0.005, 2, 0.77, 0.4, 712, 3, 2, 0, 0, 469, 10, 1], "semantic": {"name": "valid_area", "arg_names": [], "import_names": [], "rhs_call_name": "GetSubRect", "annotation": ""}, "snippet": " valid_area = cv.GetSubRect(bgra, (-correction, 0, w + correction, h))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L61_C8", "label": "left_area = GetSubRect()", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L55_C4", "vector": [14, 2, 0.302, 0.005, 2, 0.77, 0.6, 788, 3, 2, 0, 0, 469, 10, 1], "semantic": {"name": "left_area", "arg_names": [], "import_names": [], "rhs_call_name": "GetSubRect", "annotation": ""}, "snippet": " left_area = cv.GetSubRect(bgra, (0,0,w,h))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L62_C8", "label": "right_area = GetSubRect()", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L55_C4", "vector": [14, 2, 0.3069, 0.005, 2, 0.77, 0.8, 609, 3, 2, 0, 0, 469, 10, 1], "semantic": {"name": "right_area", "arg_names": [], "import_names": [], "rhs_call_name": "GetSubRect", "annotation": ""}, "snippet": " right_area = cv.GetSubRect(bgra, (correction, 0, w, h))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L63_C8", "label": "valid_area = GetSubRect()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L55_C4", "vector": [14, 2, 0.3119, 0.005, 2, 0.77, 1.0, 712, 3, 2, 0, 0, 469, 10, 1], "semantic": {"name": "valid_area", "arg_names": [], "import_names": [], "rhs_call_name": "GetSubRect", "annotation": ""}, "snippet": " valid_area = cv.GetSubRect(bgra, (correction, 0, w - correction, h))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L65_C4", "label": "Add()", "type": "expression", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "vector": [8, 1, 0.3218, 0.005, 1, 0.6, 0.8, 241, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Add", "arg_names": [], "import_names": [], "rhs_call_name": "Add", "annotation": ""}, "snippet": " cv.Add(left_red, left_area, left_area)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L66_C4", "label": "Add()", "type": "expression", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "vector": [8, 1, 0.3267, 0.005, 1, 0.6, 0.9, 241, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Add", "arg_names": [], "import_names": [], "rhs_call_name": "Add", "annotation": ""}, "snippet": " cv.Add(right_cyan, right_area, right_area)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Return_L72_C4", "label": "return", "type": "return", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "vector": [13, 1, 0.3564, 0.005, 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 valid_area"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "label": "if", "type": "if", "loc": [74, 123], "level": 0, "parent": null, "vector": [4, 0, 0.4876, 0.2475, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 22], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import optparse\n import time\n from sensor_msgs.msg import Image\n from cv_bridge.cv_bridge import CvBridge, CvBridgeError\n\n p = optparse.OptionParser()\n p.add_option('-c', action='store', default='/wide_stereo', type='string', dest='cam', help='which camera to listen to')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Import_L75_C4", "label": "optparse import optparse", "type": "import", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "vector": [1, 1, 0.3713, 0.005, 1, 0.43, 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_99645:Import_L76_C4", "label": "time import time", "type": "import", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "vector": [1, 1, 0.3762, 0.005, 1, 0.43, 0.0625, 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_99645:ImportFrom_L77_C4", "label": "from sensor_msgs.msg import Image", "type": "import", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "vector": [1, 1, 0.3812, 0.005, 1, 0.43, 0.125, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["Image"], "rhs_call_name": "", "annotation": ""}, "snippet": " from sensor_msgs.msg import Image"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:ImportFrom_L78_C4", "label": "from cv_bridge.cv_bridge import CvBridge, CvBridgeError", "type": "import", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "vector": [1, 1, 0.3861, 0.005, 1, 0.43, 0.1875, 356, 0, 2, 0, 0, 356, 0, 0], "semantic": {"name": "cv_bridge.cv_bridge", "arg_names": [], "import_names": ["CvBridge", "CvBridgeError"], "rhs_call_name": "", "annotation": ""}, "snippet": " from cv_bridge.cv_bridge import CvBridge, CvBridgeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L80_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "vector": [14, 1, 0.396, 0.005, 1, 0.43, 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_99645:Expr_L81_C4", "label": "add_option()", "type": "expression", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "vector": [8, 1, 0.401, 0.005, 1, 0.43, 0.3125, 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('-c', action='store', default='/wide_stereo', type='string', dest='cam', help='which camera to listen to')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L82_C4", "label": "add_option()", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "vector": [8, 1, 0.4059, 0.005, 1, 0.43, 0.375, 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('-d', action='store', default=30, type='int', dest='dist', help='separation distance')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L83_C4", "label": "add_option()", "type": "expression", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "vector": [8, 1, 0.4109, 0.005, 1, 0.43, 0.4375, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-s', action='store_true', dest='headless', help='headless mode')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L84_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "vector": [14, 1, 0.4158, 0.005, 1, 0.43, 0.5, 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_99645:Assign_L86_C4", "label": "cameras =", "type": "assigned_variable", "loc": [86, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "vector": [14, 1, 0.4282, 0.0099, 1, 0.43, 0.5625, 382, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "cameras", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cameras = [opt.cam + '/left/image_rect_color', \n opt.cam + '/right/image_rect_color']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L88_C4", "label": "stereo_listener = ROSStereoListener()", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "vector": [14, 1, 0.4356, 0.005, 1, 0.43, 0.625, 555, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "stereo_listener", "arg_names": [], "import_names": [], "rhs_call_name": "ROSStereoListener", "annotation": ""}, "snippet": " stereo_listener = rc.ROSStereoListener(cameras)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L89_C4", "label": "if", "type": "if", "loc": [89, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "vector": [4, 1, 0.4604, 0.0446, 1, 0.43, 0.6875, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not opt.headless:\n #cv.NamedWindow('left', 0)\n #cv.NamedWindow('right', 0)\n cv.NamedWindow('stereo-anaglyph', 0)\n cv.ResizeWindow('stereo-anaglyph', 640, 480)\n cv.WaitKey(10)\n else:\n bridge = CvBridge()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L92_C8", "label": "NamedWindow()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L89_C4", "vector": [8, 2, 0.4554, 0.005, 2, 0.83, 0.0, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow('stereo-anaglyph', 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L93_C8", "label": "ResizeWindow()", "type": "expression", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L89_C4", "vector": [8, 2, 0.4604, 0.005, 2, 0.83, 0.25, 376, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "ResizeWindow", "arg_names": [], "import_names": [], "rhs_call_name": "ResizeWindow", "annotation": ""}, "snippet": " cv.ResizeWindow('stereo-anaglyph', 640, 480)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L94_C8", "label": "WaitKey()", "type": "expression", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L89_C4", "vector": [8, 2, 0.4653, 0.005, 2, 0.83, 0.5, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "WaitKey", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " cv.WaitKey(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L96_C8", "label": "bridge = CvBridge()", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L89_C4", "vector": [14, 2, 0.4752, 0.005, 2, 0.83, 0.75, 658, 3, 0, 0, 0, 439, 10, 1], "semantic": {"name": "bridge", "arg_names": [], "import_names": [], "rhs_call_name": "CvBridge", "annotation": ""}, "snippet": " bridge = CvBridge()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L97_C8", "label": "image_pub = Publisher()", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L89_C4", "vector": [14, 2, 0.4802, 0.005, 2, 0.83, 1.0, 395, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "image_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " image_pub = rospy.Publisher('stereo_anaglyph', Image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L99_C4", "label": "anaglyph_cyan_image_distance_correction = get_param()", "type": "assigned_variable", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "vector": [14, 1, 0.4901, 0.005, 1, 0.43, 0.75, 757, 3, 2, 0, 0, 427, 10, 1], "semantic": {"name": "anaglyph_cyan_image_distance_correction", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": " anaglyph_cyan_image_distance_correction = rospy.get_param('anaglyph_dist', opt.dist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L101_C4", "label": "left =", "type": "assigned_variable", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "vector": [14, 1, 0.5, 0.005, 1, 0.43, 0.8125, 605, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "left", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left = 1113937# 65361"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L102_C4", "label": "right =", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "vector": [14, 1, 0.505, 0.005, 1, 0.43, 0.875, 724, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " right = 1113939#65363 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L103_C4", "label": "escape =", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "vector": [14, 1, 0.5099, 0.005, 1, 0.43, 0.9375, 494, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "escape", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " escape = 1048603#27"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:While_L104_C4", "label": "while", "type": "while", "loc": [104, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "vector": [5, 1, 0.5619, 0.099, 1, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n l, r = stereo_listener.next()\n red_blue = anaglyph(l, r, anaglyph_cyan_image_distance_correction)\n if not opt.headless:\n #cv.ShowImage('left', l)\n #cv.ShowImage('right', r)\n cv.ShowImage('stereo-anaglyph', red_blue)\n k = cv.WaitKey(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L105_C8", "label": "l, r = next()", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:While_L104_C4", "vector": [14, 2, 0.5198, 0.005, 2, 0.48, 0.0, 781, 3, 0, 0, 0, 11, 10, 1], "semantic": {"name": "l, r", "arg_names": [], "import_names": [], "rhs_call_name": "next", "annotation": ""}, "snippet": " l, r = stereo_listener.next()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L106_C8", "label": "red_blue = anaglyph()", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:While_L104_C4", "vector": [14, 2, 0.5248, 0.005, 2, 0.48, 0.5, 70, 3, 3, 0, 0, 34, 10, 1], "semantic": {"name": "red_blue", "arg_names": [], "import_names": [], "rhs_call_name": "anaglyph", "annotation": ""}, "snippet": " red_blue = anaglyph(l, r, anaglyph_cyan_image_distance_correction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L107_C8", "label": "if", "type": "if", "loc": [107, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:While_L104_C4", "vector": [4, 2, 0.5693, 0.0842, 2, 0.48, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not opt.headless:\n #cv.ShowImage('left', l)\n #cv.ShowImage('right', r)\n cv.ShowImage('stereo-anaglyph', red_blue)\n k = cv.WaitKey(10)\n print(k)\n if k == escape:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L110_C12", "label": "ShowImage()", "type": "expression", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L107_C8", "vector": [8, 3, 0.5446, 0.005, 3, 0.15, 0.0, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage('stereo-anaglyph', red_blue)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L111_C12", "label": "k = WaitKey()", "type": "assigned_variable", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L107_C8", "vector": [14, 3, 0.5495, 0.005, 3, 0.15, 0.1429, 954, 3, 1, 0, 0, 885, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " k = cv.WaitKey(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L112_C12", "label": "print()", "type": "expression", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L107_C8", "vector": [8, 3, 0.5545, 0.005, 3, 0.15, 0.2857, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(k)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L113_C12", "label": "if", "type": "if", "loc": [113, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L107_C8", "vector": [4, 3, 0.5619, 0.0099, 3, 0.15, 0.4286, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if k == escape:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L115_C12", "label": "if", "type": "if", "loc": [115, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L107_C8", "vector": [4, 3, 0.5743, 0.0149, 3, 0.15, 0.5714, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if k == left:\n anaglyph_cyan_image_distance_correction = anaglyph_cyan_image_distance_correction - 1\n print(anaglyph_cyan_image_distance_correction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L116_C16", "label": "anaglyph_cyan_image_distance_correction =", "type": "assigned_variable", "loc": [116, 116], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L115_C12", "vector": [14, 4, 0.5743, 0.005, 4, 0.09, 0.0, 757, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "anaglyph_cyan_image_distance_correction", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " anaglyph_cyan_image_distance_correction = anaglyph_cyan_image_distance_correction - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L117_C16", "label": "print()", "type": "expression", "loc": [117, 117], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L115_C12", "vector": [8, 4, 0.5792, 0.005, 4, 0.09, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(anaglyph_cyan_image_distance_correction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L118_C12", "label": "if", "type": "if", "loc": [118, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L107_C8", "vector": [4, 3, 0.5891, 0.0149, 3, 0.15, 0.7143, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if k == right:\n anaglyph_cyan_image_distance_correction = anaglyph_cyan_image_distance_correction + 1\n print(anaglyph_cyan_image_distance_correction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L119_C16", "label": "anaglyph_cyan_image_distance_correction =", "type": "assigned_variable", "loc": [119, 119], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L118_C12", "vector": [14, 4, 0.5891, 0.005, 4, 0.26, 0.0, 757, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "anaglyph_cyan_image_distance_correction", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " anaglyph_cyan_image_distance_correction = anaglyph_cyan_image_distance_correction + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L120_C16", "label": "print()", "type": "expression", "loc": [120, 120], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L118_C12", "vector": [8, 4, 0.5941, 0.005, 4, 0.26, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(anaglyph_cyan_image_distance_correction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L122_C12", "label": "rosimage = cv_to_imgmsg()", "type": "assigned_variable", "loc": [122, 122], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L107_C8", "vector": [14, 3, 0.604, 0.005, 3, 0.15, 0.8571, 295, 3, 2, 0, 0, 630, 10, 1], "semantic": {"name": "rosimage", "arg_names": [], "import_names": [], "rhs_call_name": "cv_to_imgmsg", "annotation": ""}, "snippet": " rosimage = bridge.cv_to_imgmsg(red_blue, \"bgra8\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L123_C12", "label": "publish()", "type": "expression", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L107_C8", "vector": [8, 3, 0.6089, 0.005, 3, 0.15, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " image_pub.publish(rosimage)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Return_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:For_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:For_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Return_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Return_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Import_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Import_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:ImportFrom_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:ImportFrom_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:While_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:While_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:While_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:While_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L115_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L115_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L116_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L115_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L117_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L118_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L119_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L118_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L120_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Assign_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99645:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99645:Expr_L123_C12"}]
#!/usr/bin/python import roslib roslib.load_manifest('stereo_anaglyph') import rospy import hrl_camera.ros_camera as rc import cv def anaglyph(left_color, right_color): left_mono = cv.CreateImage(cv.GetSize(left_color), cv.IPL_DEPTH_8U, 1) right_mono = cv.CreateImage(cv.GetSize(right_color), cv.IPL_DEPTH_8U, 1) green = cv.CreateImage(cv.GetSize(right_color), cv.IPL_DEPTH_8U, 1) result = cv.CreateImage(cv.GetSize(right_color), cv.IPL_DEPTH_8U, 3) cv.CvtColor(left_color, left_mono, cv.CV_RGB2GRAY) cv.CvtColor(right_color, right_mono, cv.CV_RGB2GRAY) cv.Merge(left_mono, green, right_mono, None, result) return result cameras = ['/wide_stereo/left/image_rect_color', '/wide_stereo/right/image_rect_color'] stereo_listener = rc.ROSStereoListener(cameras) cv.NamedWindow('stereo-anaglyph', cv.CV_WINDOW_AUTOSIZE) cv.WaitKey(10) while not rospy.is_shutdown(): l, r = stereo_listener.next() red_blue = anaglyph(l, r) cv.ShowImage('stereo-anaglyph', red_blue) cv.WaitKey(10) #from opencv import cv #from opencv import highgui #from time import sleep # #def makeMagic(left, right, out): # chans=[] # for i in range(6): # chans.append(cv.cvCreateImage(cv.cvGetSize(left),8,1)) # cv.cvSplit(left, chans[0], chans[1], chans[2], None); # cv.cvSplit(right, chans[3], chans[4], chans[5], None); # cv.cvMerge(chans[3],chans[4],chans[2], None, out); # # #cv.cvMerge(None,chans[1],None, None, out); # #cam=[] #def main(): # cam.append(highgui.cvCreateCameraCapture(0)) # cam.append(highgui.cvCreateCameraCapture(1)) # highgui.cvNamedWindow ("carrots", highgui.CV_WINDOW_AUTOSIZE) # # uno=highgui.cvQueryFrame(cam[0]); # dos=highgui.cvQueryFrame(cam[1]); # # highgui.cvShowImage("carrots",uno); # highgui.cvWaitKey(0); # highgui.cvShowImage("carrots",dos); # highgui.cvWaitKey(0); # # merge=cv.cvCreateImage(cv.cvGetSize(uno),8,3) # makeMagic(uno, dos, merge) # # highgui.cvShowImage("carrots",merge); # highgui.cvWaitKey(0); # # while True : # uno=highgui.cvQueryFrame(cam[0]); # dos=highgui.cvQueryFrame(cam[1]); # makeMagic(uno, dos, merge); # highgui.cvShowImage("carrots",merge); # if highgui.cvWaitKey(1)=="s": # cam.append(cam.pop(0)) # print "tick" # #if __name__=="__main__": # main()
ajibawa-2023/Python-Code-Large/train/row_99646
23
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_99646:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0185, 0.0093, 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_99646:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0278, 0.0093, 0, 0.66, 0.1, 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('stereo_anaglyph')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99646:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.037, 0.0093, 0, 0.66, 0.2, 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_99646:Import_L5_C0", "label": "hrl_camera.ros_camera import rc", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0463, 0.0093, 0, 0.66, 0.3, 798, 0, 1, 0, 0, 798, 0, 0], "semantic": {"name": "hrl_camera.ros_camera", "arg_names": [], "import_names": ["rc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_camera.ros_camera as rc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99646:Import_L6_C0", "label": "cv import cv", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0556, 0.0093, 0, 0.66, 0.4, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99646:FunctionDef_L9_C0", "label": "anaglyph", "type": "function", "loc": [9, 18], "level": 0, "parent": null, "vector": [2, 0, 0.125, 0.0926, 0, 0.66, 0.5, 34, 0, 2, 1, 0, 0, 0, 11], "semantic": {"name": "anaglyph", "arg_names": ["left_color", "right_color"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def anaglyph(left_color, right_color):\n left_mono = cv.CreateImage(cv.GetSize(left_color), cv.IPL_DEPTH_8U, 1)\n right_mono = cv.CreateImage(cv.GetSize(right_color), cv.IPL_DEPTH_8U, 1)\n green = cv.CreateImage(cv.GetSize(right_color), cv.IPL_DEPTH_8U, 1)\n result = cv.CreateImage(cv.GetSize(right_color), cv.IPL_DEPTH_8U, 3)\n\n cv.CvtColor(left_color, left_mono, cv.CV_RGB2GRAY)\n cv.CvtColor(right_color, right_mono, cv.CV_RGB2GRAY)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99646:Assign_L10_C4", "label": "left_mono = CreateImage()", "type": "assigned_variable", "loc": [10, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99646:FunctionDef_L9_C0", "vector": [14, 1, 0.0926, 0.0093, 1, 0.97, 0.0, 280, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "left_mono", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " left_mono = cv.CreateImage(cv.GetSize(left_color), cv.IPL_DEPTH_8U, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99646:Assign_L11_C4", "label": "right_mono = CreateImage()", "type": "assigned_variable", "loc": [11, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99646:FunctionDef_L9_C0", "vector": [14, 1, 0.1019, 0.0093, 1, 0.97, 0.1429, 497, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "right_mono", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " right_mono = cv.CreateImage(cv.GetSize(right_color), cv.IPL_DEPTH_8U, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99646:Assign_L12_C4", "label": "green = CreateImage()", "type": "assigned_variable", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99646:FunctionDef_L9_C0", "vector": [14, 1, 0.1111, 0.0093, 1, 0.97, 0.2857, 128, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "green", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " green = cv.CreateImage(cv.GetSize(right_color), cv.IPL_DEPTH_8U, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99646:Assign_L13_C4", "label": "result = CreateImage()", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99646:FunctionDef_L9_C0", "vector": [14, 1, 0.1204, 0.0093, 1, 0.97, 0.4286, 51, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " result = cv.CreateImage(cv.GetSize(right_color), cv.IPL_DEPTH_8U, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99646:Expr_L15_C4", "label": "CvtColor()", "type": "expression", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99646:FunctionDef_L9_C0", "vector": [8, 1, 0.1389, 0.0093, 1, 0.97, 0.5714, 974, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "CvtColor", "arg_names": [], "import_names": [], "rhs_call_name": "CvtColor", "annotation": ""}, "snippet": " cv.CvtColor(left_color, left_mono, cv.CV_RGB2GRAY)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99646:Expr_L16_C4", "label": "CvtColor()", "type": "expression", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99646:FunctionDef_L9_C0", "vector": [8, 1, 0.1481, 0.0093, 1, 0.97, 0.7143, 974, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "CvtColor", "arg_names": [], "import_names": [], "rhs_call_name": "CvtColor", "annotation": ""}, "snippet": " cv.CvtColor(right_color, right_mono, cv.CV_RGB2GRAY)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99646:Expr_L17_C4", "label": "Merge()", "type": "expression", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99646:FunctionDef_L9_C0", "vector": [8, 1, 0.1574, 0.0093, 1, 0.97, 0.8571, 677, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Merge", "arg_names": [], "import_names": [], "rhs_call_name": "Merge", "annotation": ""}, "snippet": " cv.Merge(left_mono, green, right_mono, None, result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99646:Return_L18_C4", "label": "return", "type": "return", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99646:FunctionDef_L9_C0", "vector": [13, 1, 0.1667, 0.0093, 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 result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99646:Assign_L20_C0", "label": "cameras =", "type": "assigned_variable", "loc": [20, 21], "level": 0, "parent": null, "vector": [14, 0, 0.1898, 0.0185, 0, 0.66, 0.6, 382, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "cameras", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "cameras = ['/wide_stereo/left/image_rect_color', \n '/wide_stereo/right/image_rect_color']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99646:Assign_L22_C0", "label": "stereo_listener = ROSStereoListener()", "type": "assigned_variable", "loc": [22, 22], "level": 0, "parent": null, "vector": [14, 0, 0.2037, 0.0093, 0, 0.66, 0.7, 555, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "stereo_listener", "arg_names": [], "import_names": [], "rhs_call_name": "ROSStereoListener", "annotation": ""}, "snippet": "stereo_listener = rc.ROSStereoListener(cameras)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99646:Expr_L23_C0", "label": "NamedWindow()", "type": "expression", "loc": [23, 23], "level": 0, "parent": null, "vector": [8, 0, 0.213, 0.0093, 0, 0.66, 0.8, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": "cv.NamedWindow('stereo-anaglyph', cv.CV_WINDOW_AUTOSIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99646:Expr_L24_C0", "label": "WaitKey()", "type": "expression", "loc": [24, 24], "level": 0, "parent": null, "vector": [8, 0, 0.2222, 0.0093, 0, 0.66, 0.9, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "WaitKey", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": "cv.WaitKey(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99646:While_L26_C0", "label": "while", "type": "while", "loc": [26, 30], "level": 0, "parent": null, "vector": [5, 0, 0.2593, 0.0463, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "while not rospy.is_shutdown():\n l, r = stereo_listener.next()\n red_blue = anaglyph(l, r)\n cv.ShowImage('stereo-anaglyph', red_blue)\n cv.WaitKey(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99646:Assign_L27_C4", "label": "l, r = next()", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99646:While_L26_C0", "vector": [14, 1, 0.25, 0.0093, 1, 0.79, 0.0, 781, 3, 0, 0, 0, 11, 10, 1], "semantic": {"name": "l, r", "arg_names": [], "import_names": [], "rhs_call_name": "next", "annotation": ""}, "snippet": " l, r = stereo_listener.next()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99646:Assign_L28_C4", "label": "red_blue = anaglyph()", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99646:While_L26_C0", "vector": [14, 1, 0.2593, 0.0093, 1, 0.79, 0.3333, 70, 3, 2, 0, 0, 34, 10, 1], "semantic": {"name": "red_blue", "arg_names": [], "import_names": [], "rhs_call_name": "anaglyph", "annotation": ""}, "snippet": " red_blue = anaglyph(l, r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99646:Expr_L29_C4", "label": "ShowImage()", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99646:While_L26_C0", "vector": [8, 1, 0.2685, 0.0093, 1, 0.79, 0.6667, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage('stereo-anaglyph', red_blue)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99646:Expr_L30_C4", "label": "WaitKey()", "type": "expression", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99646:While_L26_C0", "vector": [8, 1, 0.2778, 0.0093, 1, 0.79, 1.0, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "WaitKey", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " cv.WaitKey(10)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99646:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99646:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99646:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99646:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99646:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99646:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99646:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99646:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99646:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99646:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99646:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99646:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99646:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99646:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99646:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99646:Return_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99646:While_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99646:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99646:While_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99646:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99646:While_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99646:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99646:While_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99646:Expr_L30_C4"}]
#Particle filter imports import pfilter as pf import robot_motion as rm import object_motion as om import detection_appearance as da #Others import nodes as nd import transforms2d as t2d import numpy as np import math as mt import opencv.cv as cv import types import functools as ft velocity = np.matrix([0.01, 0.0]).T pose = t2d.Pose2D(0.0, 0.0, 0.0) #Setup mvar = rm.motion_var() particles = rm.make_set(mvar, pose, 100) #Run motion_model = rm.RobotMotion(mvar) app_model = da.DetectionAppearance(cov=np.matrix([[(.03*.03), 0], [0, (.03*.03)]])) filter = pf.PFilter(motion_model, app_model) display = nd.RobotDisp("particle filter", size = 2, draw_center=True, meters_radius=10) max_weight = app_model.weight(np.matrix([1.0, 0.0]).T, t2d.Pose2D(1.0, 0.0, 0.0)) draw_func = ft.partial(rm.draw_weighted_Pose2D, display, max_weight) cur_pos = pose.pos.copy() cur_set = particles for i in xrange(100): display.clear() cur_set = filter.step(t2d.Pose2D(velocity[0,0], velocity[1,0], 0), cur_pos, cur_set, draw_func) scur_pos = display.to_screen(cur_pos) display.draw(wait=10) cur_pos = cur_pos + velocity #print "cur_pos", cur_pos.T #cur_set = filter.step(control_input=t2d.Pose2D(velocity[0,0], velocity[1,0], 0), # measurement=cur_pos, particle_set=cur_set) #cur_pos = cur_pos + velocity #cur_set = filter.step(control_input=t2d.Pose2D(velocity[0,0], velocity[1,0], 0), # measurement=cur_pos, particle_set=cur_set) #cur_pos = cur_pos + velocity #cur_set = pf.predict(motion_model, t2d.Pose2D(1.0, 0.0, 0.0), cur_set) #weighted_set = pf.likelihood(app_model, np.matrix([1.0, 0.0]).T, cur_set) #normalized = pf.normalize_likelihood(weighted_set) #for i in xrange(100): # cur_set = filter.step(control_input=t2d.Pose2D(velocity[0,0], velocity[1,0], 0), # measurement=cur_pos, particle_set=cur_set) # cur_pos = cur_pos + velocity # # display.clear() # draw_particles(cur_set) # scur_pos = display.to_screen(cur_pos) # cv.cvCircle(display.buffer, cv.cvPoint((int) (scur_pos[0,0]), (int) (scur_pos[1,0])), # 4, cv.cvScalar(100,0,0), cv.CV_FILLED) # display.draw(wait=10) #filter.step() #print "particles" #for s in particles: # print s
ajibawa-2023/Python-Code-Large/train/row_99647
29
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_99647:Import_L2_C0", "label": "pfilter import pf", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0168, 0.0084, 0, 0.66, 0.0, 180, 0, 1, 0, 0, 180, 0, 0], "semantic": {"name": "pfilter", "arg_names": [], "import_names": ["pf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pfilter as pf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Import_L3_C0", "label": "robot_motion import rm", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0252, 0.0084, 0, 0.66, 0.0435, 99, 0, 1, 0, 0, 99, 0, 0], "semantic": {"name": "robot_motion", "arg_names": [], "import_names": ["rm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import robot_motion as rm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Import_L4_C0", "label": "object_motion import om", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0336, 0.0084, 0, 0.66, 0.087, 642, 0, 1, 0, 0, 642, 0, 0], "semantic": {"name": "object_motion", "arg_names": [], "import_names": ["om"], "rhs_call_name": "", "annotation": ""}, "snippet": "import object_motion as om"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Import_L5_C0", "label": "detection_appearance import da", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.042, 0.0084, 0, 0.66, 0.1304, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "detection_appearance", "arg_names": [], "import_names": ["da"], "rhs_call_name": "", "annotation": ""}, "snippet": "import detection_appearance as da"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Import_L8_C0", "label": "nodes import nd", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0672, 0.0084, 0, 0.66, 0.1739, 696, 0, 1, 0, 0, 696, 0, 0], "semantic": {"name": "nodes", "arg_names": [], "import_names": ["nd"], "rhs_call_name": "", "annotation": ""}, "snippet": "import nodes as nd"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Import_L9_C0", "label": "transforms2d import t2d", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0756, 0.0084, 0, 0.66, 0.2174, 798, 0, 1, 0, 0, 798, 0, 0], "semantic": {"name": "transforms2d", "arg_names": [], "import_names": ["t2d"], "rhs_call_name": "", "annotation": ""}, "snippet": "import transforms2d as t2d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Import_L10_C0", "label": "numpy import np", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.084, 0.0084, 0, 0.66, 0.2609, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Import_L11_C0", "label": "math import mt", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0924, 0.0084, 0, 0.66, 0.3043, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["mt"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math as mt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Import_L12_C0", "label": "opencv.cv import cv", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1008, 0.0084, 0, 0.66, 0.3478, 718, 0, 1, 0, 0, 718, 0, 0], "semantic": {"name": "opencv.cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import opencv.cv as cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Import_L13_C0", "label": "types import types", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1092, 0.0084, 0, 0.66, 0.3913, 209, 0, 1, 0, 0, 209, 0, 0], "semantic": {"name": "types", "arg_names": [], "import_names": ["types"], "rhs_call_name": "", "annotation": ""}, "snippet": "import types"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Import_L14_C0", "label": "functools import ft", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1176, 0.0084, 0, 0.66, 0.4348, 711, 0, 1, 0, 0, 711, 0, 0], "semantic": {"name": "functools", "arg_names": [], "import_names": ["ft"], "rhs_call_name": "", "annotation": ""}, "snippet": "import functools as ft"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Assign_L16_C0", "label": "velocity =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.1345, 0.0084, 0, 0.66, 0.4783, 935, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "velocity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "velocity = np.matrix([0.01, 0.0]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Assign_L17_C0", "label": "pose = Pose2D()", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.1429, 0.0084, 0, 0.66, 0.5217, 767, 3, 3, 0, 0, 810, 10, 1], "semantic": {"name": "pose", "arg_names": [], "import_names": [], "rhs_call_name": "Pose2D", "annotation": ""}, "snippet": "pose = t2d.Pose2D(0.0, 0.0, 0.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Assign_L20_C0", "label": "mvar = motion_var()", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.1681, 0.0084, 0, 0.66, 0.5652, 219, 3, 0, 0, 0, 94, 10, 1], "semantic": {"name": "mvar", "arg_names": [], "import_names": [], "rhs_call_name": "motion_var", "annotation": ""}, "snippet": "mvar = rm.motion_var()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Assign_L21_C0", "label": "particles = make_set()", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.1765, 0.0084, 0, 0.66, 0.6087, 63, 3, 3, 0, 0, 185, 10, 1], "semantic": {"name": "particles", "arg_names": [], "import_names": [], "rhs_call_name": "make_set", "annotation": ""}, "snippet": "particles = rm.make_set(mvar, pose, 100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Assign_L24_C0", "label": "motion_model = RobotMotion()", "type": "assigned_variable", "loc": [24, 24], "level": 0, "parent": null, "vector": [14, 0, 0.2017, 0.0084, 0, 0.66, 0.6522, 149, 3, 1, 0, 0, 304, 10, 1], "semantic": {"name": "motion_model", "arg_names": [], "import_names": [], "rhs_call_name": "RobotMotion", "annotation": ""}, "snippet": "motion_model = rm.RobotMotion(mvar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Assign_L25_C0", "label": "app_model = DetectionAppearance()", "type": "assigned_variable", "loc": [25, 25], "level": 0, "parent": null, "vector": [14, 0, 0.2101, 0.0084, 0, 0.66, 0.6957, 337, 3, 1, 0, 0, 935, 10, 2], "semantic": {"name": "app_model", "arg_names": [], "import_names": [], "rhs_call_name": "DetectionAppearance", "annotation": ""}, "snippet": "app_model = da.DetectionAppearance(cov=np.matrix([[(.03*.03), 0], [0, (.03*.03)]]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Assign_L26_C0", "label": "filter = PFilter()", "type": "assigned_variable", "loc": [26, 26], "level": 0, "parent": null, "vector": [14, 0, 0.2185, 0.0084, 0, 0.66, 0.7391, 526, 3, 2, 0, 0, 298, 10, 1], "semantic": {"name": "filter", "arg_names": [], "import_names": [], "rhs_call_name": "PFilter", "annotation": ""}, "snippet": "filter = pf.PFilter(motion_model, app_model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Assign_L27_C0", "label": "display = RobotDisp()", "type": "assigned_variable", "loc": [27, 27], "level": 0, "parent": null, "vector": [14, 0, 0.2269, 0.0084, 0, 0.66, 0.7826, 669, 3, 4, 0, 0, 590, 10, 1], "semantic": {"name": "display", "arg_names": [], "import_names": [], "rhs_call_name": "RobotDisp", "annotation": ""}, "snippet": "display = nd.RobotDisp(\"particle filter\", size = 2, draw_center=True, meters_radius=10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Assign_L29_C0", "label": "max_weight = weight()", "type": "assigned_variable", "loc": [29, 29], "level": 0, "parent": null, "vector": [14, 0, 0.2437, 0.0084, 0, 0.66, 0.8261, 748, 3, 2, 0, 0, 205, 10, 3], "semantic": {"name": "max_weight", "arg_names": [], "import_names": [], "rhs_call_name": "weight", "annotation": ""}, "snippet": "max_weight = app_model.weight(np.matrix([1.0, 0.0]).T, t2d.Pose2D(1.0, 0.0, 0.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Assign_L30_C0", "label": "draw_func = partial()", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.2521, 0.0084, 0, 0.66, 0.8696, 979, 3, 3, 0, 0, 365, 10, 1], "semantic": {"name": "draw_func", "arg_names": [], "import_names": [], "rhs_call_name": "partial", "annotation": ""}, "snippet": "draw_func = ft.partial(rm.draw_weighted_Pose2D, display, max_weight)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Assign_L31_C0", "label": "cur_pos = copy()", "type": "assigned_variable", "loc": [31, 31], "level": 0, "parent": null, "vector": [14, 0, 0.2605, 0.0084, 0, 0.66, 0.913, 612, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "cur_pos", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": "cur_pos = pose.pos.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Assign_L32_C0", "label": "cur_set =", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.2689, 0.0084, 0, 0.66, 0.9565, 690, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cur_set", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "cur_set = particles"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:For_L34_C0", "label": "for i", "type": "for", "loc": [34, 41], "level": 0, "parent": null, "vector": [6, 0, 0.3151, 0.0672, 0, 0.66, 1.0, 826, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for i in xrange(100):\n display.clear()\n cur_set = filter.step(t2d.Pose2D(velocity[0,0], velocity[1,0], 0), \n cur_pos, cur_set, draw_func)\n scur_pos = display.to_screen(cur_pos)\n display.draw(wait=10)\n\n cur_pos = cur_pos + velocity"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Expr_L35_C4", "label": "clear()", "type": "expression", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99647:For_L34_C0", "vector": [8, 1, 0.2941, 0.0084, 1, 0.36, 0.0, 712, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clear", "arg_names": [], "import_names": [], "rhs_call_name": "clear", "annotation": ""}, "snippet": " display.clear()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Assign_L36_C4", "label": "cur_set = step()", "type": "assigned_variable", "loc": [36, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99647:For_L34_C0", "vector": [14, 1, 0.3067, 0.0168, 1, 0.36, 0.25, 690, 3, 4, 0, 0, 880, 10, 2], "semantic": {"name": "cur_set", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " cur_set = filter.step(t2d.Pose2D(velocity[0,0], velocity[1,0], 0), \n cur_pos, cur_set, draw_func)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Assign_L38_C4", "label": "scur_pos = to_screen()", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99647:For_L34_C0", "vector": [14, 1, 0.3193, 0.0084, 1, 0.36, 0.5, 280, 3, 1, 0, 0, 932, 10, 1], "semantic": {"name": "scur_pos", "arg_names": [], "import_names": [], "rhs_call_name": "to_screen", "annotation": ""}, "snippet": " scur_pos = display.to_screen(cur_pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Expr_L39_C4", "label": "draw()", "type": "expression", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99647:For_L34_C0", "vector": [8, 1, 0.3277, 0.0084, 1, 0.36, 0.75, 920, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "draw", "arg_names": [], "import_names": [], "rhs_call_name": "draw", "annotation": ""}, "snippet": " display.draw(wait=10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99647:Assign_L41_C4", "label": "cur_pos =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99647:For_L34_C0", "vector": [14, 1, 0.3445, 0.0084, 1, 0.36, 1.0, 612, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cur_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cur_pos = cur_pos + velocity"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99647:For_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99647:Expr_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99647:For_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99647:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99647:For_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99647:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99647:For_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99647:Expr_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99647:For_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99647:Assign_L41_C4"}]
#!/usr/bin/python import numpy as np import random as rd ############################################################################ ### Functions implementing a particle filter ############################################################################ # Note: # To instantiate a particle filter you will need a motion and appearance # model. Below are signatures and description of the motion and # appearance models: # (optional) motion.make_set: (int) -> list state # motion.predict: (control, state) -> state # appearance.weight: (measurement, state) -> double # # Where what is considered a 'state' must agree between the motion and # appearance classes. # # Optional: # The particle filter can be sped up by defining additional functions: # * weight_partial - partial application # * weight_set - any other optimizations # # * predict_partial - partial application def retTrue( *args ): return True def retFalse( *args ): return False class PFilter: def __init__(self, motion, appearance): """ Makes a particle filter """ self.motion = motion self.appearance = appearance def step(self, control_input, measurement, particle_set, draw_func=None, set_op=False, should_resample_func=retTrue): """ Go through one cycle of particle filtering """ #print particle_set predictions = predict(self.motion, control_input, particle_set) #print predictions weighted_set = likelihood(self.appearance, measurement, predictions) #print weighted_set if draw_func is not None: draw_func(weighted_set) if should_resample_func(): if set_op: normalized_set = set_norm_likelihood(weighted_set) retVal = set_resample_uss(particle_set.shape[1], normalized_set) else: normalized_set = normalize_likelihood(weighted_set) retVal = resample_uss(len(particle_set), normalized_set) else: retVal = weighted_set # Change by travis to avoid resampling, but return weights as part of particle set return retVal ############################################################################ ### Helpers ############################################################################ def predict(motion_model, control_input, particle_set): """ Predict using motion model """ if hasattr(motion_model, "predict_partial"): f = motion_model.predict_partial(control_input) predictions = [f(particle) for particle in particle_set] elif hasattr(motion_model, "predict_set"): predictions = motion_model.predict_set(control_input, particle_set) else: predictions = [motion_model.predict(control_input, particle) for particle in particle_set] return predictions def likelihood(appearance_model, measurement, particle_set): """ Evaluate using appearance model """ if hasattr(appearance_model, "weight_set"): weighted = appearance_model.weight_set(measurement, particle_set) elif hasattr(appearance_model, "weight_partial"): f = appearance_model.weight_partial(measurement) weighted = [(particle, f(particle)) for particle in particle_set] else: weighted = [(particle, appearance_model.weight(measurement, particle)) for particle in particle_set] return weighted def resample_uss(num_samples, particles): """ Universal stochastic sampler (low variance resampling) num_samples - number of samples desired particles - pairs of (state, weight) tuples """ samples = [] r = rd.random() * (1.0 / float(num_samples)) c = (particles[0])[1] i = 0 for m in xrange(num_samples): U = r + m * (1.0 / float(num_samples)) #print "U", U while U > c: i = i + 1 if i >= len(particles): i = 0 c = c + (particles[i])[1] samples.append((particles[i])[0]) return samples def set_resample_uss(num_samples, particles): """ Universal stochastic sampler (low variance resampling) num_samples - number of samples desired particles - pairs of (state, weight) tuples """ ##[[ x1 x2 ... ] ## [ y1 y2 ... ] ## [ 0. 0. ... ] ## [ 1. 1. ... ] ## [ w1 w2 ... ]] samples = np.matrix( np.zeros( (4, num_samples) )) r = rd.random() * (1.0 / float(num_samples)) c = particles[4,0] i = 0 for m in xrange(num_samples): U = r + m * (1.0 / float(num_samples)) #print "U", U while U > c: i = i + 1 if i >= particles.shape[1]: i = 0 c = c + particles[4,i] samples[:,m] = particles[0:4,i] return samples def normalize_likelihood(weighted_particles): """ Make all the particle weights sum up to 1 """ def add(a,b): apart, aw = a bpart, bw = b return ('', aw+bw) total_weight = (reduce(add, weighted_particles, ('',0.0)))[1] def normalize(a): part, weight = a return (part, weight/total_weight) return map(normalize, weighted_particles) def set_norm_likelihood(weighted_particles): wp = weighted_particles wSum = np.sum( wp[4,:] ) wp[4,:] = wp[4,:] / wSum return wp if __name__ == "__main__": particles = [("4", 4), ("1",1), ("2",2), ("3", 3)] normalized = normalize_likelihood(particles) #print normalized num_particles = 1000 new_particles = resample_uss(num_particles, normalized) #print new_particles counts = {} for pair in particles: name, numb = pair counts[name] = 0 for p in new_particles: counts[p] = 1 + counts[p] for k in counts.keys(): print k, " :", (counts[k] / float(num_particles))
ajibawa-2023/Python-Code-Large/train/row_99648
102
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_99648:Import_L2_C0", "label": "numpy import np", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0112, 0.0056, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Import_L3_C0", "label": "random import rd", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0168, 0.0056, 0, 0.66, 0.0909, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["rd"], "rhs_call_name": "", "annotation": ""}, "snippet": "import random as rd"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L26_C0", "label": "retTrue", "type": "function", "loc": [26, 27], "level": 0, "parent": null, "vector": [2, 0, 0.148, 0.0112, 0, 0.66, 0.1818, 315, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "retTrue", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def retTrue( *args ):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L27_C4", "label": "return", "type": "return", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L26_C0", "vector": [13, 1, 0.1508, 0.0056, 1, 0.56, 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_99648:FunctionDef_L29_C0", "label": "retFalse", "type": "function", "loc": [29, 30], "level": 0, "parent": null, "vector": [2, 0, 0.1648, 0.0112, 0, 0.66, 0.2727, 368, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "retFalse", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def retFalse( *args ):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L30_C4", "label": "return", "type": "return", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L29_C0", "vector": [13, 1, 0.1676, 0.0056, 1, 0.36, 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_99648:ClassDef_L32_C0", "label": "PFilter", "type": "class", "loc": [32, 58], "level": 0, "parent": null, "vector": [3, 0, 0.2514, 0.1508, 0, 0.66, 0.3636, 298, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "PFilter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PFilter:\n def __init__(self, motion, appearance):\n \"\"\" Makes a particle filter \"\"\"\n self.motion = motion\n self.appearance = appearance\n\n def step(self, control_input, measurement, particle_set, draw_func=None, set_op=False, should_resample_func=retTrue):\n \"\"\" Go through one cycle of particle filtering \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L33_C4", "label": "__init__", "type": "function", "loc": [33, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:ClassDef_L32_C0", "vector": [2, 1, 0.1927, 0.0223, 1, 0.3, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "motion", "appearance"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, motion, appearance):\n \"\"\" Makes a particle filter \"\"\"\n self.motion = motion\n self.appearance = appearance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Expr_L34_C8", "label": "expression", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L33_C4", "vector": [8, 2, 0.1899, 0.0056, 2, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" Makes a particle filter \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L35_C8", "label": "self.motion =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L33_C4", "vector": [14, 2, 0.1955, 0.0056, 2, 0.81, 0.5, 306, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.motion", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.motion = motion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L36_C8", "label": "self.appearance =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L33_C4", "vector": [14, 2, 0.2011, 0.0056, 2, 0.81, 1.0, 336, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.appearance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.appearance = appearance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L38_C4", "label": "step", "type": "function", "loc": [38, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:ClassDef_L32_C0", "vector": [2, 1, 0.2682, 0.1173, 1, 0.3, 1.0, 880, 0, 7, 1, 0, 0, 0, 9], "semantic": {"name": "step", "arg_names": ["self", "control_input", "measurement", "particle_set", "draw_func", "set_op", "should_resample_func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def step(self, control_input, measurement, particle_set, draw_func=None, set_op=False, should_resample_func=retTrue):\n \"\"\" Go through one cycle of particle filtering \"\"\"\n #print particle_set\n predictions = predict(self.motion, control_input, particle_set)\n #print predictions\n weighted_set = likelihood(self.appearance, measurement, predictions)\n #print weighted_set\n if draw_func is not None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Expr_L39_C8", "label": "expression", "type": "expression", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L38_C4", "vector": [8, 2, 0.2179, 0.0056, 2, 0.48, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" Go through one cycle of particle filtering \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L41_C8", "label": "predictions = predict()", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L38_C4", "vector": [14, 2, 0.2291, 0.0056, 2, 0.48, 0.2, 493, 3, 3, 0, 0, 127, 10, 1], "semantic": {"name": "predictions", "arg_names": [], "import_names": [], "rhs_call_name": "predict", "annotation": ""}, "snippet": " predictions = predict(self.motion, control_input, particle_set)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L43_C8", "label": "weighted_set = likelihood()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L38_C4", "vector": [14, 2, 0.2402, 0.0056, 2, 0.48, 0.4, 143, 3, 3, 0, 0, 778, 10, 1], "semantic": {"name": "weighted_set", "arg_names": [], "import_names": [], "rhs_call_name": "likelihood", "annotation": ""}, "snippet": " weighted_set = likelihood(self.appearance, measurement, predictions)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L45_C8", "label": "if", "type": "if", "loc": [45, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L38_C4", "vector": [4, 2, 0.2542, 0.0112, 2, 0.48, 0.6, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if draw_func is not None:\n draw_func(weighted_set)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Expr_L46_C12", "label": "draw_func()", "type": "expression", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L45_C8", "vector": [8, 3, 0.257, 0.0056, 3, 0.12, 0.0, 979, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "draw_func", "arg_names": [], "import_names": [], "rhs_call_name": "draw_func", "annotation": ""}, "snippet": " draw_func(weighted_set)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L48_C8", "label": "if", "type": "if", "loc": [48, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L38_C4", "vector": [4, 2, 0.2905, 0.0503, 2, 0.48, 0.8, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if should_resample_func():\n if set_op:\n normalized_set = set_norm_likelihood(weighted_set)\n retVal = set_resample_uss(particle_set.shape[1], normalized_set)\n else:\n normalized_set = normalize_likelihood(weighted_set)\n retVal = resample_uss(len(particle_set), normalized_set)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L49_C12", "label": "if", "type": "if", "loc": [49, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L48_C8", "vector": [4, 3, 0.2877, 0.0335, 3, 0.78, 0.0, 0, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if set_op:\n normalized_set = set_norm_likelihood(weighted_set)\n retVal = set_resample_uss(particle_set.shape[1], normalized_set)\n else:\n normalized_set = normalize_likelihood(weighted_set)\n retVal = resample_uss(len(particle_set), normalized_set)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L50_C16", "label": "normalized_set = set_norm_likelihood()", "type": "assigned_variable", "loc": [50, 50], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L49_C12", "vector": [14, 4, 0.2793, 0.0056, 4, 0.76, 0.0, 974, 3, 1, 0, 0, 12, 10, 1], "semantic": {"name": "normalized_set", "arg_names": [], "import_names": [], "rhs_call_name": "set_norm_likelihood", "annotation": ""}, "snippet": " normalized_set = set_norm_likelihood(weighted_set)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L51_C16", "label": "retVal = set_resample_uss()", "type": "assigned_variable", "loc": [51, 51], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L49_C12", "vector": [14, 4, 0.2849, 0.0056, 4, 0.76, 0.3333, 892, 3, 2, 0, 0, 180, 10, 1], "semantic": {"name": "retVal", "arg_names": [], "import_names": [], "rhs_call_name": "set_resample_uss", "annotation": ""}, "snippet": " retVal = set_resample_uss(particle_set.shape[1], normalized_set)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L53_C16", "label": "normalized_set = normalize_likelihood()", "type": "assigned_variable", "loc": [53, 53], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L49_C12", "vector": [14, 4, 0.2961, 0.0056, 4, 0.76, 0.6667, 974, 3, 1, 0, 0, 166, 10, 1], "semantic": {"name": "normalized_set", "arg_names": [], "import_names": [], "rhs_call_name": "normalize_likelihood", "annotation": ""}, "snippet": " normalized_set = normalize_likelihood(weighted_set)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L54_C16", "label": "retVal = resample_uss()", "type": "assigned_variable", "loc": [54, 54], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L49_C12", "vector": [14, 4, 0.3017, 0.0056, 4, 0.76, 1.0, 892, 3, 2, 0, 0, 509, 10, 2], "semantic": {"name": "retVal", "arg_names": [], "import_names": [], "rhs_call_name": "resample_uss", "annotation": ""}, "snippet": " retVal = resample_uss(len(particle_set), normalized_set)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L56_C12", "label": "retVal =", "type": "assigned_variable", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L48_C8", "vector": [14, 3, 0.3128, 0.0056, 3, 0.78, 1.0, 892, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "retVal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " retVal = weighted_set # Change by travis to avoid resampling, but return weights as part of particle set"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L58_C8", "label": "return", "type": "return", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L38_C4", "vector": [13, 2, 0.324, 0.0056, 2, 0.48, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return retVal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L63_C0", "label": "predict", "type": "function", "loc": [63, 72], "level": 0, "parent": null, "vector": [2, 0, 0.3771, 0.0559, 0, 0.66, 0.4545, 127, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "predict", "arg_names": ["motion_model", "control_input", "particle_set"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def predict(motion_model, control_input, particle_set):\n \"\"\" Predict using motion model \"\"\"\n if hasattr(motion_model, \"predict_partial\"):\n f = motion_model.predict_partial(control_input)\n predictions = [f(particle) for particle in particle_set]\n elif hasattr(motion_model, \"predict_set\"):\n predictions = motion_model.predict_set(control_input, particle_set) \n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Expr_L64_C4", "label": "expression", "type": "expression", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L63_C0", "vector": [8, 1, 0.3575, 0.0056, 1, 0.51, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" Predict using motion model \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L65_C4", "label": "if", "type": "if", "loc": [65, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L63_C0", "vector": [4, 1, 0.3799, 0.0391, 1, 0.51, 0.5, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(motion_model, \"predict_partial\"):\n f = motion_model.predict_partial(control_input)\n predictions = [f(particle) for particle in particle_set]\n elif hasattr(motion_model, \"predict_set\"):\n predictions = motion_model.predict_set(control_input, particle_set) \n else:\n predictions = [motion_model.predict(control_input, particle) for particle in particle_set]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L66_C8", "label": "f = predict_partial()", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L65_C4", "vector": [14, 2, 0.3687, 0.0056, 2, 0.02, 0.0, 899, 3, 1, 0, 0, 177, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "predict_partial", "annotation": ""}, "snippet": " f = motion_model.predict_partial(control_input)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L67_C8", "label": "predictions =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L65_C4", "vector": [14, 2, 0.3743, 0.0056, 2, 0.02, 0.5, 493, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "predictions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " predictions = [f(particle) for particle in particle_set]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L68_C4", "label": "if", "type": "if", "loc": [68, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L65_C4", "vector": [4, 2, 0.3883, 0.0223, 2, 0.02, 1.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif hasattr(motion_model, \"predict_set\"):\n predictions = motion_model.predict_set(control_input, particle_set) \n else:\n predictions = [motion_model.predict(control_input, particle) for particle in particle_set]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L69_C8", "label": "predictions = predict_set()", "type": "assigned_variable", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L68_C4", "vector": [14, 3, 0.3855, 0.0056, 3, 0.13, 0.0, 493, 3, 2, 0, 0, 874, 10, 1], "semantic": {"name": "predictions", "arg_names": [], "import_names": [], "rhs_call_name": "predict_set", "annotation": ""}, "snippet": " predictions = motion_model.predict_set(control_input, particle_set) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L71_C8", "label": "predictions =", "type": "assigned_variable", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L68_C4", "vector": [14, 3, 0.3966, 0.0056, 3, 0.13, 1.0, 493, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "predictions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " predictions = [motion_model.predict(control_input, particle) for particle in particle_set]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L72_C4", "label": "return", "type": "return", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L63_C0", "vector": [13, 1, 0.4022, 0.0056, 1, 0.51, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return predictions"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L75_C0", "label": "likelihood", "type": "function", "loc": [75, 84], "level": 0, "parent": null, "vector": [2, 0, 0.4441, 0.0559, 0, 0.66, 0.5455, 778, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "likelihood", "arg_names": ["appearance_model", "measurement", "particle_set"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def likelihood(appearance_model, measurement, particle_set):\n \"\"\" Evaluate using appearance model \"\"\"\n if hasattr(appearance_model, \"weight_set\"):\n weighted = appearance_model.weight_set(measurement, particle_set)\n elif hasattr(appearance_model, \"weight_partial\"):\n f = appearance_model.weight_partial(measurement)\n weighted = [(particle, f(particle)) for particle in particle_set]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Expr_L76_C4", "label": "expression", "type": "expression", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L75_C0", "vector": [8, 1, 0.4246, 0.0056, 1, 0.27, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" Evaluate using appearance model \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L77_C4", "label": "if", "type": "if", "loc": [77, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L75_C0", "vector": [4, 1, 0.4469, 0.0391, 1, 0.27, 0.5, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(appearance_model, \"weight_set\"):\n weighted = appearance_model.weight_set(measurement, particle_set)\n elif hasattr(appearance_model, \"weight_partial\"):\n f = appearance_model.weight_partial(measurement)\n weighted = [(particle, f(particle)) for particle in particle_set]\n else:\n weighted = [(particle, appearance_model.weight(measurement, particle)) for particle in particle_set]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L78_C8", "label": "weighted = weight_set()", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L77_C4", "vector": [14, 2, 0.4358, 0.0056, 2, 0.76, 0.0, 200, 3, 2, 0, 0, 278, 10, 1], "semantic": {"name": "weighted", "arg_names": [], "import_names": [], "rhs_call_name": "weight_set", "annotation": ""}, "snippet": " weighted = appearance_model.weight_set(measurement, particle_set)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L79_C4", "label": "if", "type": "if", "loc": [79, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L77_C4", "vector": [4, 2, 0.4525, 0.0279, 2, 0.76, 1.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif hasattr(appearance_model, \"weight_partial\"):\n f = appearance_model.weight_partial(measurement)\n weighted = [(particle, f(particle)) for particle in particle_set]\n else:\n weighted = [(particle, appearance_model.weight(measurement, particle)) for particle in particle_set]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L80_C8", "label": "f = weight_partial()", "type": "assigned_variable", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L79_C4", "vector": [14, 3, 0.4469, 0.0056, 3, 0.56, 0.0, 899, 3, 1, 0, 0, 320, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "weight_partial", "annotation": ""}, "snippet": " f = appearance_model.weight_partial(measurement)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L81_C8", "label": "weighted =", "type": "assigned_variable", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L79_C4", "vector": [14, 3, 0.4525, 0.0056, 3, 0.56, 0.5, 200, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "weighted", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " weighted = [(particle, f(particle)) for particle in particle_set]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L83_C8", "label": "weighted =", "type": "assigned_variable", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L79_C4", "vector": [14, 3, 0.4637, 0.0056, 3, 0.56, 1.0, 200, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "weighted", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " weighted = [(particle, appearance_model.weight(measurement, particle)) for particle in particle_set]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L84_C4", "label": "return", "type": "return", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L75_C0", "vector": [13, 1, 0.4693, 0.0056, 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 weighted"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L86_C0", "label": "resample_uss", "type": "function", "loc": [86, 106], "level": 0, "parent": null, "vector": [2, 0, 0.5363, 0.1173, 0, 0.66, 0.6364, 509, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "resample_uss", "arg_names": ["num_samples", "particles"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def resample_uss(num_samples, particles):\n \"\"\" \n Universal stochastic sampler (low variance resampling)\n num_samples - number of samples desired\n particles - pairs of (state, weight) tuples\n \"\"\"\n samples = []\n r = rd.random() * (1.0 / float(num_samples))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Expr_L87_C4", "label": "expression", "type": "expression", "loc": [87, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L86_C0", "vector": [8, 1, 0.4972, 0.0279, 1, 0.77, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" \n Universal stochastic sampler (low variance resampling)\n num_samples - number of samples desired\n particles - pairs of (state, weight) tuples\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L92_C4", "label": "samples =", "type": "assigned_variable", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L86_C0", "vector": [14, 1, 0.514, 0.0056, 1, 0.77, 0.1667, 986, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "samples", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " samples = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L93_C4", "label": "r =", "type": "assigned_variable", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L86_C0", "vector": [14, 1, 0.5196, 0.0056, 1, 0.77, 0.3333, 436, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = rd.random() * (1.0 / float(num_samples))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L94_C4", "label": "c =", "type": "assigned_variable", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L86_C0", "vector": [14, 1, 0.5251, 0.0056, 1, 0.77, 0.5, 411, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c = (particles[0])[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L95_C4", "label": "i =", "type": "assigned_variable", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L86_C0", "vector": [14, 1, 0.5307, 0.0056, 1, 0.77, 0.6667, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L97_C4", "label": "for m", "type": "for", "loc": [97, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L86_C0", "vector": [6, 1, 0.5642, 0.0503, 1, 0.77, 0.8333, 711, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for m in xrange(num_samples):\n U = r + m * (1.0 / float(num_samples))\n #print \"U\", U\n while U > c:\n i = i + 1\n if i >= len(particles):\n i = 0\n c = c + (particles[i])[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L98_C8", "label": "U =", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L97_C4", "vector": [14, 2, 0.5475, 0.0056, 2, 0.67, 0.0, 643, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "U", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " U = r + m * (1.0 / float(num_samples))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:While_L100_C8", "label": "while", "type": "while", "loc": [100, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L97_C4", "vector": [5, 2, 0.5698, 0.0279, 2, 0.67, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while U > c:\n i = i + 1\n if i >= len(particles):\n i = 0\n c = c + (particles[i])[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L101_C12", "label": "i =", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:While_L100_C8", "vector": [14, 3, 0.5642, 0.0056, 3, 0.49, 0.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L102_C12", "label": "if", "type": "if", "loc": [102, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:While_L100_C8", "vector": [4, 3, 0.5726, 0.0112, 3, 0.49, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i >= len(particles):\n i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L103_C16", "label": "i =", "type": "assigned_variable", "loc": [103, 103], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L102_C12", "vector": [14, 4, 0.5754, 0.0056, 4, 0.81, 0.0, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L104_C12", "label": "c =", "type": "assigned_variable", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:While_L100_C8", "vector": [14, 3, 0.581, 0.0056, 3, 0.49, 1.0, 411, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c = c + (particles[i])[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Expr_L105_C8", "label": "append()", "type": "expression", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L97_C4", "vector": [8, 2, 0.5866, 0.0056, 2, 0.67, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " samples.append((particles[i])[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L106_C4", "label": "return", "type": "return", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L86_C0", "vector": [13, 1, 0.5922, 0.0056, 1, 0.77, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return samples"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L108_C0", "label": "set_resample_uss", "type": "function", "loc": [108, 135], "level": 0, "parent": null, "vector": [2, 0, 0.6788, 0.1564, 0, 0.66, 0.7273, 180, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "set_resample_uss", "arg_names": ["num_samples", "particles"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def set_resample_uss(num_samples, particles):\n \"\"\" \n Universal stochastic sampler (low variance resampling)\n num_samples - number of samples desired\n particles - pairs of (state, weight) tuples\n \"\"\"\n ##[[ x1 x2 ... ]\n ## [ y1 y2 ... ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Expr_L109_C4", "label": "expression", "type": "expression", "loc": [109, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L108_C0", "vector": [8, 1, 0.6201, 0.0279, 1, 0.02, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" \n Universal stochastic sampler (low variance resampling)\n num_samples - number of samples desired\n particles - pairs of (state, weight) tuples\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L120_C4", "label": "samples = matrix()", "type": "assigned_variable", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L108_C0", "vector": [14, 1, 0.6704, 0.0056, 1, 0.02, 0.1667, 986, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "samples", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " samples = np.matrix( np.zeros( (4, num_samples) ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L122_C4", "label": "r =", "type": "assigned_variable", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L108_C0", "vector": [14, 1, 0.6816, 0.0056, 1, 0.02, 0.3333, 436, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = rd.random() * (1.0 / float(num_samples))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L123_C4", "label": "c =", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L108_C0", "vector": [14, 1, 0.6872, 0.0056, 1, 0.02, 0.5, 411, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c = particles[4,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L124_C4", "label": "i =", "type": "assigned_variable", "loc": [124, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L108_C0", "vector": [14, 1, 0.6927, 0.0056, 1, 0.02, 0.6667, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L126_C4", "label": "for m", "type": "for", "loc": [126, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L108_C0", "vector": [6, 1, 0.7263, 0.0503, 1, 0.02, 0.8333, 711, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for m in xrange(num_samples):\n U = r + m * (1.0 / float(num_samples))\n #print \"U\", U\n while U > c:\n i = i + 1\n if i >= particles.shape[1]:\n i = 0\n c = c + particles[4,i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L127_C8", "label": "U =", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L126_C4", "vector": [14, 2, 0.7095, 0.0056, 2, 0.95, 0.0, 643, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "U", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " U = r + m * (1.0 / float(num_samples))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:While_L129_C8", "label": "while", "type": "while", "loc": [129, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L126_C4", "vector": [5, 2, 0.7318, 0.0279, 2, 0.95, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while U > c:\n i = i + 1\n if i >= particles.shape[1]:\n i = 0\n c = c + particles[4,i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L130_C12", "label": "i =", "type": "assigned_variable", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:While_L129_C8", "vector": [14, 3, 0.7263, 0.0056, 3, 0.64, 0.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L131_C12", "label": "if", "type": "if", "loc": [131, 132], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:While_L129_C8", "vector": [4, 3, 0.7346, 0.0112, 3, 0.64, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i >= particles.shape[1]:\n i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L132_C16", "label": "i =", "type": "assigned_variable", "loc": [132, 132], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L131_C12", "vector": [14, 4, 0.7374, 0.0056, 4, 0.82, 0.0, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L133_C12", "label": "c =", "type": "assigned_variable", "loc": [133, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:While_L129_C8", "vector": [14, 3, 0.743, 0.0056, 3, 0.64, 1.0, 411, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c = c + particles[4,i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L134_C8", "label": "assign", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L126_C4", "vector": [14, 2, 0.7486, 0.0056, 2, 0.95, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " samples[:,m] = particles[0:4,i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L135_C4", "label": "return", "type": "return", "loc": [135, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L108_C0", "vector": [13, 1, 0.7542, 0.0056, 1, 0.02, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return samples"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L138_C0", "label": "normalize_likelihood", "type": "function", "loc": [138, 148], "level": 0, "parent": null, "vector": [2, 0, 0.7989, 0.0615, 0, 0.66, 0.8182, 166, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "normalize_likelihood", "arg_names": ["weighted_particles"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def normalize_likelihood(weighted_particles):\n \"\"\" Make all the particle weights sum up to 1 \"\"\"\n def add(a,b):\n apart, aw = a\n bpart, bw = b\n return ('', aw+bw)\n total_weight = (reduce(add, weighted_particles, ('',0.0)))[1]\n def normalize(a):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Expr_L139_C4", "label": "expression", "type": "expression", "loc": [139, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L138_C0", "vector": [8, 1, 0.7765, 0.0056, 1, 0.03, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" Make all the particle weights sum up to 1 \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L140_C4", "label": "add", "type": "function", "loc": [140, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L138_C0", "vector": [2, 1, 0.7905, 0.0223, 1, 0.03, 0.25, 241, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "add", "arg_names": ["a", "b"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(a,b):\n apart, aw = a\n bpart, bw = b\n return ('', aw+bw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L141_C8", "label": "apart, aw =", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L140_C4", "vector": [14, 2, 0.7877, 0.0056, 2, 0.31, 0.0, 465, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "apart, aw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " apart, aw = a"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L142_C8", "label": "bpart, bw =", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L140_C4", "vector": [14, 2, 0.7933, 0.0056, 2, 0.31, 0.5, 779, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "bpart, bw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bpart, bw = b"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L143_C8", "label": "return", "type": "return", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L140_C4", "vector": [13, 2, 0.7989, 0.0056, 2, 0.31, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ('', aw+bw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L144_C4", "label": "total_weight =", "type": "assigned_variable", "loc": [144, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L138_C0", "vector": [14, 1, 0.8045, 0.0056, 1, 0.03, 0.5, 91, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "total_weight", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " total_weight = (reduce(add, weighted_particles, ('',0.0)))[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L145_C4", "label": "normalize", "type": "function", "loc": [145, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L138_C0", "vector": [2, 1, 0.8156, 0.0168, 1, 0.03, 0.75, 257, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "normalize", "arg_names": ["a"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def normalize(a):\n part, weight = a\n return (part, weight/total_weight)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L146_C8", "label": "part, weight =", "type": "assigned_variable", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L145_C4", "vector": [14, 2, 0.8156, 0.0056, 2, 0.25, 0.0, 822, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "part, weight", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " part, weight = a"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L147_C8", "label": "return", "type": "return", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L145_C4", "vector": [13, 2, 0.8212, 0.0056, 2, 0.25, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (part, weight/total_weight)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L148_C4", "label": "return", "type": "return", "loc": [148, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L138_C0", "vector": [13, 1, 0.8268, 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 map(normalize, weighted_particles)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L150_C0", "label": "set_norm_likelihood", "type": "function", "loc": [150, 155], "level": 0, "parent": null, "vector": [2, 0, 0.852, 0.0335, 0, 0.66, 0.9091, 12, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "set_norm_likelihood", "arg_names": ["weighted_particles"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def set_norm_likelihood(weighted_particles):\n wp = weighted_particles\n \n wSum = np.sum( wp[4,:] )\n wp[4,:] = wp[4,:] / wSum\n return wp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L151_C4", "label": "wp =", "type": "assigned_variable", "loc": [151, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L150_C0", "vector": [14, 1, 0.8436, 0.0056, 1, 0.88, 0.0, 976, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "wp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wp = weighted_particles"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L153_C4", "label": "wSum = sum()", "type": "assigned_variable", "loc": [153, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L150_C0", "vector": [14, 1, 0.8547, 0.0056, 1, 0.88, 0.3333, 237, 3, 1, 0, 0, 824, 10, 1], "semantic": {"name": "wSum", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " wSum = np.sum( wp[4,:] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L154_C4", "label": "assign", "type": "assigned_variable", "loc": [154, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L150_C0", "vector": [14, 1, 0.8603, 0.0056, 1, 0.88, 0.6667, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wp[4,:] = wp[4,:] / wSum"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L155_C4", "label": "return", "type": "return", "loc": [155, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L150_C0", "vector": [13, 1, 0.8659, 0.0056, 1, 0.88, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return wp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L159_C0", "label": "if", "type": "if", "loc": [159, 177], "level": 0, "parent": null, "vector": [4, 0, 0.9385, 0.1061, 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 particles = [(\"4\", 4), (\"1\",1), (\"2\",2), (\"3\", 3)]\n normalized = normalize_likelihood(particles)\n #print normalized\n\n num_particles = 1000\n new_particles = resample_uss(num_particles, normalized)\n #print new_particles"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L160_C4", "label": "particles =", "type": "assigned_variable", "loc": [160, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L159_C0", "vector": [14, 1, 0.8939, 0.0056, 1, 0.86, 0.0, 63, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "particles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " particles = [(\"4\", 4), (\"1\",1), (\"2\",2), (\"3\", 3)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L161_C4", "label": "normalized = normalize_likelihood()", "type": "assigned_variable", "loc": [161, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L159_C0", "vector": [14, 1, 0.8994, 0.0056, 1, 0.86, 0.1429, 828, 3, 1, 0, 0, 166, 10, 1], "semantic": {"name": "normalized", "arg_names": [], "import_names": [], "rhs_call_name": "normalize_likelihood", "annotation": ""}, "snippet": " normalized = normalize_likelihood(particles)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L164_C4", "label": "num_particles =", "type": "assigned_variable", "loc": [164, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L159_C0", "vector": [14, 1, 0.9162, 0.0056, 1, 0.86, 0.2857, 499, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "num_particles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num_particles = 1000"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L165_C4", "label": "new_particles = resample_uss()", "type": "assigned_variable", "loc": [165, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L159_C0", "vector": [14, 1, 0.9218, 0.0056, 1, 0.86, 0.4286, 536, 3, 2, 0, 0, 509, 10, 1], "semantic": {"name": "new_particles", "arg_names": [], "import_names": [], "rhs_call_name": "resample_uss", "annotation": ""}, "snippet": " new_particles = resample_uss(num_particles, normalized)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L168_C4", "label": "counts =", "type": "assigned_variable", "loc": [168, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L159_C0", "vector": [14, 1, 0.9385, 0.0056, 1, 0.86, 0.5714, 560, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "counts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " counts = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L169_C4", "label": "for pair", "type": "for", "loc": [169, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L159_C0", "vector": [6, 1, 0.9497, 0.0168, 1, 0.86, 0.7143, 825, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pair", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for pair in particles:\n name, numb = pair\n counts[name] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L170_C8", "label": "name, numb =", "type": "assigned_variable", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L169_C4", "vector": [14, 2, 0.9497, 0.0056, 2, 0.91, 0.0, 21, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name, numb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name, numb = pair"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L171_C8", "label": "assign", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L169_C4", "vector": [14, 2, 0.9553, 0.0056, 2, 0.91, 1.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " counts[name] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L173_C4", "label": "for p", "type": "for", "loc": [173, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L159_C0", "vector": [6, 1, 0.9693, 0.0112, 1, 0.86, 0.8571, 491, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for p in new_particles:\n counts[p] = 1 + counts[p]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L174_C8", "label": "assign", "type": "assigned_variable", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L173_C4", "vector": [14, 2, 0.9721, 0.0056, 2, 0.54, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " counts[p] = 1 + counts[p]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L176_C4", "label": "for k", "type": "for", "loc": [176, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L159_C0", "vector": [6, 1, 0.986, 0.0112, 1, 0.86, 1.0, 954, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in counts.keys():\n print(k, \" :\", (counts[k] / float(num_particles)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99648:Expr_L177_C8", "label": "print()", "type": "expression", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L176_C4", "vector": [8, 2, 0.9888, 0.0056, 2, 0.54, 0.0, 535, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(k, \" :\", (counts[k] / float(num_particles)))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Expr_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Expr_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L49_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L49_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L50_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L49_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L51_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L49_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L53_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L49_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L54_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Expr_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Expr_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Expr_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:While_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:While_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:While_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L102_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L103_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:While_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Expr_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:While_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:While_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:While_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L132_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:While_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Expr_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:FunctionDef_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Return_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Assign_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:If_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99648:For_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99648:Expr_L177_C8"}]
__all__ = [ 'pfilter' ]
ajibawa-2023/Python-Code-Large/train/row_99649
1
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_99649:Assign_L1_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [1, 3], "level": 0, "parent": null, "vector": [14, 0, 0.6667, 1.0, 0, 0.66, 0.0, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__all__ = [\n'pfilter'\n]"}]
[]
import numpy as np import util as ut import prob as pr import itertools as it import types import opencv.cv as cv class DetectionAppearance: def __init__(self, cov): """ Appearance model for tracking when there is a detector available that gives 2d poses of objects. cov - uncertainty of measurements measurement - 2x1 matrix state - 2x1 matrix """ self.cov = cov #self.validation_prob = validation_prob def weight(self, measurement, particle): """ measurement - 2D column numpy.matrix particle - Pose2D """ gauss = pr.Gaussian(m = measurement, v = self.cov) f = gauss.pdf_mat() w = f(particle) return w[0] def weight_partial(self, measurement): gauss = pr.Gaussian(m = measurement, v = self.cov) f = gauss.pdf_mat() def weightp(particle): w = f(particle) return w[0] return weightp def weight_set(self, measurement, particle_set): pos_mat = ut.list_mat_to_mat(particle_set, axis=1) gauss = pr.Gaussian(m = measurement, v = self.cov) f = gauss.pdf_mat() weight_mat = f(pos_mat) def pair_weights(tup): part, idx = tup return (part, weight_mat[idx]) return map(pair_weights, it.izip(particle_set, xrange(len(particle_set)))) def draw_weighted_2D(display, max_weight, particles): for p in particles: if type(p) is types.TupleType: rpos, weight = p else: rpos = p pos = display.to_screen(rpos) if type(p) is types.TupleType: color = round(255.0 * (weight/max_weight)) cv.cvCircle(display.buffer, cv.cvPoint((int) (pos[0,0]), (int) (pos[1,0])), 3, cv.cvScalar(255, 255-color, 255), cv.CV_FILLED, cv.CV_AA) cv.cvCircle(display.buffer, cv.cvPoint((int) (pos[0,0]), (int) (pos[1,0])), 3, cv.cvScalar(200, 200, 200), 1, cv.CV_AA) else: cv.cvCircle(display.buffer, cv.cvPoint((int) (pos[0,0]), (int) (pos[1,0])), 2, cv.cvScalar(150, 150, 150), cv.CV_FILLED, cv.CV_AA) #def weight_matrix(self, measurement): # gauss = pr.Gaussian(m = measurement, v = self.cov) # f = gauss.pdf_mat() # def weightp(particle): # w = f(particle.pos) # return w[0] # return weightp
ajibawa-2023/Python-Code-Large/train/row_99651
43
96
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Import_L1_C0", "label": "numpy import np", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0104, 0.0104, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Import_L2_C0", "label": "util import ut", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0208, 0.0104, 0, 0.66, 0.1429, 811, 0, 1, 0, 0, 811, 0, 0], "semantic": {"name": "util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Import_L3_C0", "label": "prob import pr", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0312, 0.0104, 0, 0.66, 0.2857, 24, 0, 1, 0, 0, 24, 0, 0], "semantic": {"name": "prob", "arg_names": [], "import_names": ["pr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import prob as pr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Import_L4_C0", "label": "itertools import it", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.0104, 0, 0.66, 0.4286, 808, 0, 1, 0, 0, 808, 0, 0], "semantic": {"name": "itertools", "arg_names": [], "import_names": ["it"], "rhs_call_name": "", "annotation": ""}, "snippet": "import itertools as it"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Import_L5_C0", "label": "types import types", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0521, 0.0104, 0, 0.66, 0.5714, 209, 0, 1, 0, 0, 209, 0, 0], "semantic": {"name": "types", "arg_names": [], "import_names": ["types"], "rhs_call_name": "", "annotation": ""}, "snippet": "import types"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Import_L6_C0", "label": "opencv.cv import cv", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0104, 0, 0.66, 0.7143, 718, 0, 1, 0, 0, 718, 0, 0], "semantic": {"name": "opencv.cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import opencv.cv as cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:ClassDef_L8_C0", "label": "DetectionAppearance", "type": "class", "loc": [8, 47], "level": 0, "parent": null, "vector": [3, 0, 0.2865, 0.4167, 0, 0.66, 0.8571, 935, 0, 6, 0, 0, 0, 0, 14], "semantic": {"name": "DetectionAppearance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DetectionAppearance:\n def __init__(self, cov):\n \"\"\" \n Appearance model for tracking when there is a detector\n available that gives 2d poses of objects.\n cov - uncertainty of measurements\n measurement - 2x1 matrix\n state - 2x1 matrix"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L9_C4", "label": "__init__", "type": "function", "loc": [9, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:ClassDef_L8_C0", "vector": [2, 1, 0.1354, 0.0938, 1, 0.92, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "cov"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, cov):\n \"\"\" \n Appearance model for tracking when there is a detector\n available that gives 2d poses of objects.\n cov - uncertainty of measurements\n measurement - 2x1 matrix\n state - 2x1 matrix\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Expr_L10_C8", "label": "expression", "type": "expression", "loc": [10, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L9_C4", "vector": [8, 2, 0.1354, 0.0729, 2, 0.7, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" \n Appearance model for tracking when there is a detector\n available that gives 2d poses of objects.\n cov - uncertainty of measurements\n measurement - 2x1 matrix\n state - 2x1 matrix\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L17_C8", "label": "self.cov =", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L9_C4", "vector": [14, 2, 0.1771, 0.0104, 2, 0.7, 1.0, 375, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cov", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cov = cov "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L20_C4", "label": "weight", "type": "function", "loc": [20, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:ClassDef_L8_C0", "vector": [2, 1, 0.25, 0.0938, 1, 0.92, 0.3333, 205, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "weight", "arg_names": ["self", "measurement", "particle"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def weight(self, measurement, particle):\n \"\"\" \n measurement - 2D column numpy.matrix\n particle - Pose2D \n \"\"\"\n gauss = pr.Gaussian(m = measurement, v = self.cov)\n f = gauss.pdf_mat()\n w = f(particle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Expr_L21_C8", "label": "expression", "type": "expression", "loc": [21, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L20_C4", "vector": [8, 2, 0.2344, 0.0417, 2, 0.82, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" \n measurement - 2D column numpy.matrix\n particle - Pose2D \n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L25_C8", "label": "gauss = Gaussian()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L20_C4", "vector": [14, 2, 0.2604, 0.0104, 2, 0.82, 0.25, 316, 3, 2, 0, 0, 408, 10, 1], "semantic": {"name": "gauss", "arg_names": [], "import_names": [], "rhs_call_name": "Gaussian", "annotation": ""}, "snippet": " gauss = pr.Gaussian(m = measurement, v = self.cov)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L26_C8", "label": "f = pdf_mat()", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L20_C4", "vector": [14, 2, 0.2708, 0.0104, 2, 0.82, 0.5, 899, 3, 0, 0, 0, 929, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "pdf_mat", "annotation": ""}, "snippet": " f = gauss.pdf_mat()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L27_C8", "label": "w = f()", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L20_C4", "vector": [14, 2, 0.2812, 0.0104, 2, 0.82, 0.75, 549, 3, 1, 0, 0, 899, 10, 1], "semantic": {"name": "w", "arg_names": [], "import_names": [], "rhs_call_name": "f", "annotation": ""}, "snippet": " w = f(particle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Return_L28_C8", "label": "return", "type": "return", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L20_C4", "vector": [13, 2, 0.2917, 0.0104, 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 w[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L30_C4", "label": "weight_partial", "type": "function", "loc": [30, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:ClassDef_L8_C0", "vector": [2, 1, 0.3438, 0.0729, 1, 0.92, 0.6667, 320, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "weight_partial", "arg_names": ["self", "measurement"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def weight_partial(self, measurement):\n gauss = pr.Gaussian(m = measurement, v = self.cov)\n f = gauss.pdf_mat()\n def weightp(particle):\n w = f(particle)\n return w[0]\n return weightp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L31_C8", "label": "gauss = Gaussian()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L30_C4", "vector": [14, 2, 0.3229, 0.0104, 2, 0.71, 0.0, 316, 3, 2, 0, 0, 408, 10, 1], "semantic": {"name": "gauss", "arg_names": [], "import_names": [], "rhs_call_name": "Gaussian", "annotation": ""}, "snippet": " gauss = pr.Gaussian(m = measurement, v = self.cov)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L32_C8", "label": "f = pdf_mat()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L30_C4", "vector": [14, 2, 0.3333, 0.0104, 2, 0.71, 0.3333, 899, 3, 0, 0, 0, 929, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "pdf_mat", "annotation": ""}, "snippet": " f = gauss.pdf_mat()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L33_C8", "label": "weightp", "type": "function", "loc": [33, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L30_C4", "vector": [2, 2, 0.3542, 0.0312, 2, 0.71, 0.6667, 434, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "weightp", "arg_names": ["particle"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def weightp(particle):\n w = f(particle)\n return w[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L34_C12", "label": "w = f()", "type": "assigned_variable", "loc": [34, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L33_C8", "vector": [14, 3, 0.3542, 0.0104, 3, 0.39, 0.0, 549, 3, 1, 0, 0, 899, 10, 1], "semantic": {"name": "w", "arg_names": [], "import_names": [], "rhs_call_name": "f", "annotation": ""}, "snippet": " w = f(particle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Return_L35_C12", "label": "return", "type": "return", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L33_C8", "vector": [13, 3, 0.3646, 0.0104, 3, 0.39, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return w[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Return_L36_C8", "label": "return", "type": "return", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L30_C4", "vector": [13, 2, 0.375, 0.0104, 2, 0.71, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return weightp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L38_C4", "label": "weight_set", "type": "function", "loc": [38, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:ClassDef_L8_C0", "vector": [2, 1, 0.4427, 0.1042, 1, 0.92, 1.0, 278, 0, 3, 1, 0, 0, 0, 8], "semantic": {"name": "weight_set", "arg_names": ["self", "measurement", "particle_set"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def weight_set(self, measurement, particle_set):\n pos_mat = ut.list_mat_to_mat(particle_set, axis=1)\n gauss = pr.Gaussian(m = measurement, v = self.cov)\n f = gauss.pdf_mat()\n weight_mat = f(pos_mat)\n\n def pair_weights(tup):\n part, idx = tup"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L39_C8", "label": "pos_mat = list_mat_to_mat()", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L38_C4", "vector": [14, 2, 0.4062, 0.0104, 2, 0.74, 0.0, 932, 3, 2, 0, 0, 162, 10, 1], "semantic": {"name": "pos_mat", "arg_names": [], "import_names": [], "rhs_call_name": "list_mat_to_mat", "annotation": ""}, "snippet": " pos_mat = ut.list_mat_to_mat(particle_set, axis=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L40_C8", "label": "gauss = Gaussian()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L38_C4", "vector": [14, 2, 0.4167, 0.0104, 2, 0.74, 0.2, 316, 3, 2, 0, 0, 408, 10, 1], "semantic": {"name": "gauss", "arg_names": [], "import_names": [], "rhs_call_name": "Gaussian", "annotation": ""}, "snippet": " gauss = pr.Gaussian(m = measurement, v = self.cov)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L41_C8", "label": "f = pdf_mat()", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L38_C4", "vector": [14, 2, 0.4271, 0.0104, 2, 0.74, 0.4, 899, 3, 0, 0, 0, 929, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "pdf_mat", "annotation": ""}, "snippet": " f = gauss.pdf_mat()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L42_C8", "label": "weight_mat = f()", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L38_C4", "vector": [14, 2, 0.4375, 0.0104, 2, 0.74, 0.6, 83, 3, 1, 0, 0, 899, 10, 1], "semantic": {"name": "weight_mat", "arg_names": [], "import_names": [], "rhs_call_name": "f", "annotation": ""}, "snippet": " weight_mat = f(pos_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L44_C8", "label": "pair_weights", "type": "function", "loc": [44, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L38_C4", "vector": [2, 2, 0.4688, 0.0312, 2, 0.74, 0.8, 182, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "pair_weights", "arg_names": ["tup"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pair_weights(tup):\n part, idx = tup\n return (part, weight_mat[idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L45_C12", "label": "part, idx =", "type": "assigned_variable", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L44_C8", "vector": [14, 3, 0.4688, 0.0104, 3, 0.91, 0.0, 377, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "part, idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " part, idx = tup"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Return_L46_C12", "label": "return", "type": "return", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L44_C8", "vector": [13, 3, 0.4792, 0.0104, 3, 0.91, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (part, weight_mat[idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Return_L47_C8", "label": "return", "type": "return", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L38_C4", "vector": [13, 2, 0.4896, 0.0104, 2, 0.74, 1.0, 0, 3, 0, 0, 0, 0, 10, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return map(pair_weights, it.izip(particle_set, xrange(len(particle_set))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L51_C0", "label": "draw_weighted_2D", "type": "function", "loc": [51, 68], "level": 0, "parent": null, "vector": [2, 0, 0.6198, 0.1875, 0, 0.66, 1.0, 15, 0, 3, 0, 0, 0, 0, 19], "semantic": {"name": "draw_weighted_2D", "arg_names": ["display", "max_weight", "particles"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def draw_weighted_2D(display, max_weight, particles):\n for p in particles:\n if type(p) is types.TupleType:\n rpos, weight = p\n else:\n rpos = p\n\n pos = display.to_screen(rpos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:For_L52_C4", "label": "for p", "type": "for", "loc": [52, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L51_C0", "vector": [6, 1, 0.625, 0.1771, 1, 0.34, 0.0, 491, 2, 0, 0, 0, 0, 0, 19], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for p in particles:\n if type(p) is types.TupleType:\n rpos, weight = p\n else:\n rpos = p\n\n pos = display.to_screen(rpos)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:If_L53_C8", "label": "if", "type": "if", "loc": [53, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:For_L52_C4", "vector": [4, 2, 0.5677, 0.0417, 2, 0.65, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(p) is types.TupleType:\n rpos, weight = p\n else:\n rpos = p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L54_C12", "label": "rpos, weight =", "type": "assigned_variable", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:If_L53_C8", "vector": [14, 3, 0.5625, 0.0104, 3, 0.7, 0.0, 530, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rpos, weight", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rpos, weight = p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L56_C12", "label": "rpos =", "type": "assigned_variable", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:If_L53_C8", "vector": [14, 3, 0.5833, 0.0104, 3, 0.7, 1.0, 846, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rpos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rpos = p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L58_C8", "label": "pos = to_screen()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:For_L52_C4", "vector": [14, 2, 0.6042, 0.0104, 2, 0.65, 0.5, 627, 3, 1, 0, 0, 932, 10, 1], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "to_screen", "annotation": ""}, "snippet": " pos = display.to_screen(rpos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:If_L60_C8", "label": "if", "type": "if", "loc": [60, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:For_L52_C4", "vector": [4, 2, 0.6667, 0.0938, 2, 0.65, 1.0, 0, 0, 0, 0, 0, 0, 0, 17], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(p) is types.TupleType:\n color = round(255.0 * (weight/max_weight))\n cv.cvCircle(display.buffer, cv.cvPoint((int) (pos[0,0]), (int) (pos[1,0])), \n 3, cv.cvScalar(255, 255-color, 255), cv.CV_FILLED, cv.CV_AA)\n cv.cvCircle(display.buffer, cv.cvPoint((int) (pos[0,0]), (int) (pos[1,0])), \n 3, cv.cvScalar(200, 200, 200), 1, cv.CV_AA)\n else:\n cv.cvCircle(display.buffer, cv.cvPoint((int) (pos[0,0]), (int) (pos[1,0])), "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L61_C12", "label": "color = round()", "type": "assigned_variable", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:If_L60_C8", "vector": [14, 3, 0.6354, 0.0104, 3, 0.09, 0.0, 776, 3, 1, 0, 0, 19, 10, 1], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "round", "annotation": ""}, "snippet": " color = round(255.0 * (weight/max_weight))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Expr_L62_C12", "label": "cvCircle()", "type": "expression", "loc": [62, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:If_L60_C8", "vector": [8, 3, 0.651, 0.0208, 3, 0.09, 0.3333, 820, 3, 6, 0, 0, 0, 0, 5], "semantic": {"name": "cvCircle", "arg_names": [], "import_names": [], "rhs_call_name": "cvCircle", "annotation": ""}, "snippet": " cv.cvCircle(display.buffer, cv.cvPoint((int) (pos[0,0]), (int) (pos[1,0])), \n 3, cv.cvScalar(255, 255-color, 255), cv.CV_FILLED, cv.CV_AA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Expr_L64_C12", "label": "cvCircle()", "type": "expression", "loc": [64, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:If_L60_C8", "vector": [8, 3, 0.6719, 0.0208, 3, 0.09, 0.6667, 820, 3, 6, 0, 0, 0, 0, 5], "semantic": {"name": "cvCircle", "arg_names": [], "import_names": [], "rhs_call_name": "cvCircle", "annotation": ""}, "snippet": " cv.cvCircle(display.buffer, cv.cvPoint((int) (pos[0,0]), (int) (pos[1,0])), \n 3, cv.cvScalar(200, 200, 200), 1, cv.CV_AA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99651:Expr_L67_C12", "label": "cvCircle()", "type": "expression", "loc": [67, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99651:If_L60_C8", "vector": [8, 3, 0.7031, 0.0208, 3, 0.09, 1.0, 820, 3, 6, 0, 0, 0, 0, 5], "semantic": {"name": "cvCircle", "arg_names": [], "import_names": [], "rhs_call_name": "cvCircle", "annotation": ""}, "snippet": " cv.cvCircle(display.buffer, cv.cvPoint((int) (pos[0,0]), (int) (pos[1,0])), \n 2, cv.cvScalar(150, 150, 150), cv.CV_FILLED, cv.CV_AA)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99651:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Expr_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Return_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L34_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Return_L35_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Return_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Return_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Return_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:FunctionDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:For_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:For_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:If_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:For_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:For_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:If_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Assign_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Expr_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Expr_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99651:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99651:Expr_L67_C12"}]
import util as ut import math as mt import numpy as np from StringIO import StringIO import transforms2d as t2d import opencv.cv as cv import types class RobotMotion: """ Generates sample from robot motion model, has methods used in particle filter Use: motion_var- motion_var object or rotvar transvar """ def __init__(self, motion_var=None, rotvar=None, transvar=None): if motion_var!= None: self.motion_var = motion_var elif (rotvar != None) and (transvar != None): self.motion_var = motion_var(rotvar, transvar) def predict_partial(self, odometry): return get_odom_sample(self.motion_var, odometry) def predict(self, odometry, particle): f = get_odom_sample(self.motion_var, odometry) return f(particle) def make_set(cov, start_state, num_particles): """ Init a bunch of particles to be exactly at start state """ return get_odom_samples(cov, start_state, t2d.Pose2D(0.0, 0.0, 0.0), num_particles) def make_set_gauss(cov, start_state, num_particles): """ Initialize a gaussian distribution around start state """ sx = start_state.pos[0] sy = start_state.pos[1] #TODO: check this mean = np.concatentate((start_state, np.matrix([start_state.angle])), axis=0) def gen_pose(idx): sample = np.random.multivariate_normal(mean, cov) return t2d.Pose2D(sample[0,0], sample[1,0], sample[2,0]) return map(gen_pose, range(num_particles)) #################################################################### # Functions for sampling over 2D robot poses #################################################################### class move2d: """ Store 2d movements as 3 components initial rotation translation final rotation """ def __init__(self, rot1, trans, rot2): self.rot1 = rot1 self.trans = trans self.rot2 = rot2 def __str__(self): s = StringIO() print >>s, "( rot1:", self.rot1, ", trans:" , print >>s, self.trans, ", rot2:" , self.rot2, ")" return s.getvalue() class motion_var: """ variances used for motion generation """ def __init__(self, rotvar=(mt.radians(5), mt.radians(5)), transvar=(0.02, 0.03)): """ rotvar - a tuple of 2 floats represents degree variance introduced per 1 rotation degree variance per 1 meter traveled transvar - a tuple of 2 floats distance error introduced per 1 rotation distance error introduced per 1 meter traveled """ self.rotvar = rotvar self.transvar = transvar def p2d_to_move2d(odom): """ Decompose odometry readings into three components initial rotation translation final rotation odom - a differential reading between this and the last time step """ if (odom.pos == np.matrix([0.0, 0.0]).T).all(): orot1 = 0.0 else: orot1 = ut.standard_rad(ut.ang_of_vec(odom.pos) - odom.angle) otran = np.linalg.norm(odom.pos) orot2 = odom.angle - orot1 return move2d(orot1, otran, orot2) def get_odom_samples(cov, s, motion, num_particles): """ Get a pose sample, use this function to get multiple samples from robot motion model """ sampler = get_odom_sample(cov, motion) particles = [] for i in xrange(num_particles): sample = sampler(s) particles.append(sample) return particles def get_odom_sample(motion_variances, motion): #s, motion_variances): """ Get a pose sample using odometry motion model (from Probabilistic Robotics p. 136) use this method to get a sample pose, ignore others motion - odometry in p2d format s - state in p2d format from time t-1 motion_variances - motion variances returns a new p2d, a perturbed version of motion+s """ u_move2d = p2d_to_move2d(motion) #Partially applied motion def get_odom_sample_partial(s): # Sample srot1 = sample_rot1 (u_move2d, motion_variances) trans = sample_trans(u_move2d, motion_variances) srot2 = sample_rot2 (u_move2d, motion_variances) rot1 = ut.standard_rad(u_move2d.rot1 - srot1) trans = u_move2d.trans - trans rot2 = u_move2d.rot2 - srot2 #print mt.degrees(rot1), trans, mt.degrees(rot2) # Calculate new values sx = s.pos[0,0] sy = s.pos[1,0] x = sx + trans * mt.cos(s.angle + rot1) y = sy + trans * mt.sin(s.angle + rot1) total_rot = ut.standard_rad(s.angle + rot1 + rot2) return t2d.Pose2D(x,y, total_rot) return get_odom_sample_partial def sample_rot1(odom, odom_cov): rotvar = odom_cov.rotvar rotvar_0 = rotvar[0] / (np.pi * 2.0) scale = (rotvar_0 * abs(odom.rot1)) + (rotvar[1] * abs(odom.trans)) if scale == 0.0: return 0.0 else: return np.random.normal(scale=scale) def sample_trans(odom, odom_cov): transvar = odom_cov.transvar rot_comp = transvar[0] * abs(odom.rot1 + odom.rot2) trans_comp = transvar[1] * abs(odom.trans) scale = rot_comp + trans_comp if scale == 0.0: return 0.0 else: return np.random.normal(scale=scale) def sample_rot2(odom, odom_cov): rotvar = odom_cov.rotvar rotvar_0 = rotvar[0] / (np.pi * 2.0) scale = (rotvar_0 * abs(odom.rot2)) + (rotvar[1] * abs(odom.trans)) if scale == 0.0: return 0.0 else: return np.random.normal(scale=scale) def draw_weighted_Pose2D(display, max_weight, particles): for p in particles: if type(p) is types.TupleType: part, weight = p rpos = part.pos else: part = p rpos = p.pos x = mt.cos(part.angle) * .07 y = mt.sin(part.angle) * .07 dir = rpos.copy() dir[0,0] = dir[0,0] + x dir[1,0] = dir[1,0] + y pos = display.to_screen(rpos) dirp = display.to_screen(dir) if type(p) is types.TupleType: color = round(255.0 * (weight/max_weight)) cv.cvCircle(display.buffer, cv.cvPoint((int) (pos[0,0]), (int) (pos[1,0])), 2, cv.cvScalar(255, 255-color, 255), cv.CV_FILLED, cv.CV_AA) cv.cvCircle(display.buffer, cv.cvPoint((int) (pos[0,0]), (int) (pos[1,0])), 2, cv.cvScalar(200, 200, 200), 8, cv.CV_AA) else: cv.cvCircle(display.buffer, cv.cvPoint((int) (pos[0,0]), (int) (pos[1,0])), 2, cv.cvScalar(150, 150, 150), cv.CV_FILLED, cv.CV_AA) cv.cvLine(display.buffer, cv.cvPoint((int) (pos[0,0]), (int) (pos[1,0])), cv.cvPoint((int) (dirp[0,0]), (int) (dirp[1,0])), cv.cvScalar(100,200,100), 1, cv.CV_AA, 0) #class odometry2d: # """ an odometry reading """ # def init(self, rot, trans): # self.rot = rot # self.trans = trans # type params = RobotSampler.cov # and state = Pose2.t # and control = Pose2.t # # let predict odom_cov u (* s *)= # let partial = RobotSampler.get_odom_sample u in # (fun s -> partial s odom_cov) # # Keep it simple for now and limit to 2D motion #type state = Pose2.t #type error_wts = float*float #type cov = {rot1w: error_wts; # transw: error_wts; # rot2w: error_wts} # Example covariance for a typical situation #let image_motion_cov = {rot1w=(0.995,0.005); transw=(0.995,0.005); rot2w=(0.995,0.005)} #let make_cov rot1 trans rot2 = {rot1w=rot1; transw=trans; rot2w=rot2} if __name__ == "__main__": import nodes as nd import detection_appearance as da rotvar = (0.8, 0.2) transvar = (0.1, 0.9) motion_model = RobotMotion(motion_var(rotvar=rotvar, transvar=transfar)) cov = np.eye(3) app_model = DetectionAppearance() disp = nd.RobotDisp()
ajibawa-2023/Python-Code-Large/train/row_99652
132
250
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Import_L1_C0", "label": "util import ut", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.004, 0.004, 0, 0.66, 0.0, 811, 0, 1, 0, 0, 811, 0, 0], "semantic": {"name": "util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Import_L2_C0", "label": "math import mt", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.008, 0.004, 0, 0.66, 0.0526, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["mt"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math as mt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.012, 0.004, 0, 0.66, 0.1053, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:ImportFrom_L4_C0", "label": "from StringIO import StringIO", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.016, 0.004, 0, 0.66, 0.1579, 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_99652:Import_L5_C0", "label": "transforms2d import t2d", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.02, 0.004, 0, 0.66, 0.2105, 798, 0, 1, 0, 0, 798, 0, 0], "semantic": {"name": "transforms2d", "arg_names": [], "import_names": ["t2d"], "rhs_call_name": "", "annotation": ""}, "snippet": "import transforms2d as t2d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Import_L6_C0", "label": "opencv.cv import cv", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.024, 0.004, 0, 0.66, 0.2632, 718, 0, 1, 0, 0, 718, 0, 0], "semantic": {"name": "opencv.cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import opencv.cv as cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Import_L7_C0", "label": "types import types", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.028, 0.004, 0, 0.66, 0.3158, 209, 0, 1, 0, 0, 209, 0, 0], "semantic": {"name": "types", "arg_names": [], "import_names": ["types"], "rhs_call_name": "", "annotation": ""}, "snippet": "import types"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:ClassDef_L9_C0", "label": "RobotMotion", "type": "class", "loc": [9, 29], "level": 0, "parent": null, "vector": [3, 0, 0.076, 0.084, 0, 0.66, 0.3684, 304, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "RobotMotion", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RobotMotion:\n \"\"\" \n Generates sample from robot motion model, has methods used in particle filter \n Use:\n motion_var- motion_var object\n or\n rotvar\n transvar"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L10_C4", "label": "expression", "type": "expression", "loc": [10, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:ClassDef_L9_C0", "vector": [8, 1, 0.054, 0.032, 1, 0.39, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" \n Generates sample from robot motion model, has methods used in particle filter \n Use:\n motion_var- motion_var object\n or\n rotvar\n transvar\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L18_C4", "label": "__init__", "type": "function", "loc": [18, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:ClassDef_L9_C0", "vector": [2, 1, 0.08, 0.02, 1, 0.39, 0.3333, 555, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "motion_var", "rotvar", "transvar"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, motion_var=None, rotvar=None, transvar=None):\n if motion_var!= None:\n self.motion_var = motion_var\n elif (rotvar != None) and (transvar != None):\n self.motion_var = motion_var(rotvar, transvar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L19_C8", "label": "if", "type": "if", "loc": [19, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L18_C4", "vector": [4, 2, 0.082, 0.016, 2, 0.78, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if motion_var!= None:\n self.motion_var = motion_var\n elif (rotvar != None) and (transvar != None):\n self.motion_var = motion_var(rotvar, transvar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L20_C12", "label": "self.motion_var =", "type": "assigned_variable", "loc": [20, 20], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L19_C8", "vector": [14, 3, 0.08, 0.004, 3, 0.45, 0.0, 279, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.motion_var", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.motion_var = motion_var"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L21_C8", "label": "if", "type": "if", "loc": [21, 22], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L19_C8", "vector": [4, 3, 0.086, 0.008, 3, 0.45, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif (rotvar != None) and (transvar != None):\n self.motion_var = motion_var(rotvar, transvar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L22_C12", "label": "self.motion_var = motion_var()", "type": "assigned_variable", "loc": [22, 22], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L21_C8", "vector": [14, 4, 0.088, 0.004, 4, 0.47, 0.0, 279, 3, 2, 0, 0, 94, 10, 1], "semantic": {"name": "self.motion_var", "arg_names": [], "import_names": [], "rhs_call_name": "motion_var", "annotation": ""}, "snippet": " self.motion_var = motion_var(rotvar, transvar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L24_C4", "label": "predict_partial", "type": "function", "loc": [24, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:ClassDef_L9_C0", "vector": [2, 1, 0.098, 0.008, 1, 0.39, 0.6667, 177, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "predict_partial", "arg_names": ["self", "odometry"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def predict_partial(self, odometry):\n return get_odom_sample(self.motion_var, odometry)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L25_C8", "label": "return", "type": "return", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L24_C4", "vector": [13, 2, 0.1, 0.004, 2, 0.1, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return get_odom_sample(self.motion_var, odometry)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L27_C4", "label": "predict", "type": "function", "loc": [27, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:ClassDef_L9_C0", "vector": [2, 1, 0.112, 0.012, 1, 0.39, 1.0, 127, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "predict", "arg_names": ["self", "odometry", "particle"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def predict(self, odometry, particle):\n f = get_odom_sample(self.motion_var, odometry)\n return f(particle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L28_C8", "label": "f = get_odom_sample()", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L27_C4", "vector": [14, 2, 0.112, 0.004, 2, 0.27, 0.0, 899, 3, 2, 0, 0, 215, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "get_odom_sample", "annotation": ""}, "snippet": " f = get_odom_sample(self.motion_var, odometry)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L29_C8", "label": "return", "type": "return", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L27_C4", "vector": [13, 2, 0.116, 0.004, 2, 0.27, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return f(particle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L32_C0", "label": "make_set", "type": "function", "loc": [32, 34], "level": 0, "parent": null, "vector": [2, 0, 0.132, 0.012, 0, 0.66, 0.4211, 185, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "make_set", "arg_names": ["cov", "start_state", "num_particles"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def make_set(cov, start_state, num_particles):\n \"\"\" Init a bunch of particles to be exactly at start state \"\"\"\n return get_odom_samples(cov, start_state, t2d.Pose2D(0.0, 0.0, 0.0), num_particles)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L33_C4", "label": "expression", "type": "expression", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L32_C0", "vector": [8, 1, 0.132, 0.004, 1, 0.45, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" Init a bunch of particles to be exactly at start state \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L34_C4", "label": "return", "type": "return", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L32_C0", "vector": [13, 1, 0.136, 0.004, 1, 0.45, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return get_odom_samples(cov, start_state, t2d.Pose2D(0.0, 0.0, 0.0), num_particles)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L37_C0", "label": "make_set_gauss", "type": "function", "loc": [37, 46], "level": 0, "parent": null, "vector": [2, 0, 0.166, 0.04, 0, 0.66, 0.4737, 110, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "make_set_gauss", "arg_names": ["cov", "start_state", "num_particles"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def make_set_gauss(cov, start_state, num_particles):\n \"\"\" Initialize a gaussian distribution around start state \"\"\"\n sx = start_state.pos[0]\n sy = start_state.pos[1]\n #TODO: check this\n mean = np.concatentate((start_state, np.matrix([start_state.angle])), axis=0)\n def gen_pose(idx):\n sample = np.random.multivariate_normal(mean, cov) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L38_C4", "label": "expression", "type": "expression", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L37_C0", "vector": [8, 1, 0.152, 0.004, 1, 0.75, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" Initialize a gaussian distribution around start state \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L39_C4", "label": "sx =", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L37_C0", "vector": [14, 1, 0.156, 0.004, 1, 0.75, 0.2, 533, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sx = start_state.pos[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L40_C4", "label": "sy =", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L37_C0", "vector": [14, 1, 0.16, 0.004, 1, 0.75, 0.4, 897, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sy = start_state.pos[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L42_C4", "label": "mean = concatentate()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L37_C0", "vector": [14, 1, 0.168, 0.004, 1, 0.75, 0.6, 856, 3, 2, 0, 0, 640, 10, 2], "semantic": {"name": "mean", "arg_names": [], "import_names": [], "rhs_call_name": "concatentate", "annotation": ""}, "snippet": " mean = np.concatentate((start_state, np.matrix([start_state.angle])), axis=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L43_C4", "label": "gen_pose", "type": "function", "loc": [43, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L37_C0", "vector": [2, 1, 0.176, 0.012, 1, 0.75, 0.8, 412, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "gen_pose", "arg_names": ["idx"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def gen_pose(idx):\n sample = np.random.multivariate_normal(mean, cov) \n return t2d.Pose2D(sample[0,0], sample[1,0], sample[2,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L44_C8", "label": "sample = multivariate_normal()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L43_C4", "vector": [14, 2, 0.176, 0.004, 2, 0.69, 0.0, 513, 3, 2, 0, 0, 138, 10, 1], "semantic": {"name": "sample", "arg_names": [], "import_names": [], "rhs_call_name": "multivariate_normal", "annotation": ""}, "snippet": " sample = np.random.multivariate_normal(mean, cov) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L45_C8", "label": "return", "type": "return", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L43_C4", "vector": [13, 2, 0.18, 0.004, 2, 0.69, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return t2d.Pose2D(sample[0,0], sample[1,0], sample[2,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L46_C4", "label": "return", "type": "return", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L37_C0", "vector": [13, 1, 0.184, 0.004, 1, 0.75, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return map(gen_pose, range(num_particles))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:ClassDef_L51_C0", "label": "move2d", "type": "class", "loc": [51, 67], "level": 0, "parent": null, "vector": [3, 0, 0.236, 0.068, 0, 0.66, 0.5263, 395, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "move2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class move2d:\n \"\"\" \n Store 2d movements as 3 components\n initial rotation\n translation\n final rotation\n \"\"\"\n def __init__(self, rot1, trans, rot2):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L52_C4", "label": "expression", "type": "expression", "loc": [52, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:ClassDef_L51_C0", "vector": [8, 1, 0.218, 0.024, 1, 0.39, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" \n Store 2d movements as 3 components\n initial rotation\n translation\n final rotation\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L58_C4", "label": "__init__", "type": "function", "loc": [58, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:ClassDef_L51_C0", "vector": [2, 1, 0.238, 0.016, 1, 0.39, 0.5, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "rot1", "trans", "rot2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, rot1, trans, rot2):\n self.rot1 = rot1\n self.trans = trans\n self.rot2 = rot2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L59_C8", "label": "self.rot1 =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L58_C4", "vector": [14, 2, 0.236, 0.004, 2, 0.28, 0.0, 78, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rot1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rot1 = rot1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L60_C8", "label": "self.trans =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L58_C4", "vector": [14, 2, 0.24, 0.004, 2, 0.28, 0.5, 111, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.trans", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.trans = trans"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L61_C8", "label": "self.rot2 =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L58_C4", "vector": [14, 2, 0.244, 0.004, 2, 0.28, 1.0, 363, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rot2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rot2 = rot2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L63_C4", "label": "__str__", "type": "function", "loc": [63, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:ClassDef_L51_C0", "vector": [2, 1, 0.26, 0.02, 1, 0.39, 1.0, 527, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "__str__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __str__(self):\n s = StringIO()\n print >>s, \"( rot1:\", self.rot1, \", trans:\" , \n print >>s, self.trans, \", rot2:\" , self.rot2, \")\"\n return s.getvalue()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L64_C8", "label": "s = StringIO()", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L63_C4", "vector": [14, 2, 0.256, 0.004, 2, 0.41, 0.0, 553, 3, 0, 0, 0, 609, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "StringIO", "annotation": ""}, "snippet": " s = StringIO()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L65_C8", "label": "expression", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L63_C4", "vector": [8, 2, 0.26, 0.004, 2, 0.41, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " print >>s, \"( rot1:\", self.rot1, \", trans:\" , "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L66_C8", "label": "expression", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L63_C4", "vector": [8, 2, 0.264, 0.004, 2, 0.41, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " print >>s, self.trans, \", rot2:\" , self.rot2, \")\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L67_C8", "label": "return", "type": "return", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L63_C4", "vector": [13, 2, 0.268, 0.004, 2, 0.41, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return s.getvalue()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:ClassDef_L69_C0", "label": "motion_var", "type": "class", "loc": [69, 82], "level": 0, "parent": null, "vector": [3, 0, 0.302, 0.056, 0, 0.66, 0.5789, 94, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "motion_var", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class motion_var:\n \"\"\" variances used for motion generation \"\"\"\n def __init__(self, rotvar=(mt.radians(5), mt.radians(5)), transvar=(0.02, 0.03)):\n \"\"\"\n rotvar - a tuple of 2 floats\n represents degree variance introduced per 1 rotation\n degree variance per 1 meter traveled\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L70_C4", "label": "expression", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:ClassDef_L69_C0", "vector": [8, 1, 0.28, 0.004, 1, 0.19, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" variances used for motion generation \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L71_C4", "label": "__init__", "type": "function", "loc": [71, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:ClassDef_L69_C0", "vector": [2, 1, 0.306, 0.048, 1, 0.19, 1.0, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "rotvar", "transvar"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, rotvar=(mt.radians(5), mt.radians(5)), transvar=(0.02, 0.03)):\n \"\"\"\n rotvar - a tuple of 2 floats\n represents degree variance introduced per 1 rotation\n degree variance per 1 meter traveled\n\n transvar - a tuple of 2 floats\n distance error introduced per 1 rotation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L72_C8", "label": "expression", "type": "expression", "loc": [72, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L71_C4", "vector": [8, 2, 0.304, 0.036, 2, 0.14, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n rotvar - a tuple of 2 floats\n represents degree variance introduced per 1 rotation\n degree variance per 1 meter traveled\n\n transvar - a tuple of 2 floats\n distance error introduced per 1 rotation\n distance error introduced per 1 meter traveled"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L81_C8", "label": "self.rotvar =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L71_C4", "vector": [14, 2, 0.324, 0.004, 2, 0.14, 0.5, 598, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rotvar", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rotvar = rotvar"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L82_C8", "label": "self.transvar =", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L71_C4", "vector": [14, 2, 0.328, 0.004, 2, 0.14, 1.0, 412, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.transvar", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.transvar = transvar"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L84_C0", "label": "p2d_to_move2d", "type": "function", "loc": [84, 99], "level": 0, "parent": null, "vector": [2, 0, 0.366, 0.064, 0, 0.66, 0.6316, 357, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "p2d_to_move2d", "arg_names": ["odom"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def p2d_to_move2d(odom):\n \"\"\"\n Decompose odometry readings into three components\n initial rotation\n translation\n final rotation\n odom - a differential reading between this and the last time step\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L85_C4", "label": "expression", "type": "expression", "loc": [85, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L84_C0", "vector": [8, 1, 0.352, 0.028, 1, 0.36, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Decompose odometry readings into three components\n initial rotation\n translation\n final rotation\n odom - a differential reading between this and the last time step\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L92_C4", "label": "if", "type": "if", "loc": [92, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L84_C0", "vector": [4, 1, 0.374, 0.016, 1, 0.36, 0.25, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (odom.pos == np.matrix([0.0, 0.0]).T).all():\n orot1 = 0.0\n else:\n orot1 = ut.standard_rad(ut.ang_of_vec(odom.pos) - odom.angle) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L93_C8", "label": "orot1 =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L92_C4", "vector": [14, 2, 0.372, 0.004, 2, 0.58, 0.0, 563, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "orot1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " orot1 = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L95_C8", "label": "orot1 = standard_rad()", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L92_C4", "vector": [14, 2, 0.38, 0.004, 2, 0.58, 1.0, 563, 3, 1, 0, 0, 54, 10, 2], "semantic": {"name": "orot1", "arg_names": [], "import_names": [], "rhs_call_name": "standard_rad", "annotation": ""}, "snippet": " orot1 = ut.standard_rad(ut.ang_of_vec(odom.pos) - odom.angle) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L97_C4", "label": "otran = norm()", "type": "assigned_variable", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L84_C0", "vector": [14, 1, 0.388, 0.004, 1, 0.36, 0.5, 757, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "otran", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " otran = np.linalg.norm(odom.pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L98_C4", "label": "orot2 =", "type": "assigned_variable", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L84_C0", "vector": [14, 1, 0.392, 0.004, 1, 0.36, 0.75, 29, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "orot2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " orot2 = odom.angle - orot1 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L99_C4", "label": "return", "type": "return", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L84_C0", "vector": [13, 1, 0.396, 0.004, 1, 0.36, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return move2d(orot1, otran, orot2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L102_C0", "label": "get_odom_samples", "type": "function", "loc": [102, 109], "level": 0, "parent": null, "vector": [2, 0, 0.422, 0.032, 0, 0.66, 0.6842, 550, 0, 4, 1, 0, 0, 0, 4], "semantic": {"name": "get_odom_samples", "arg_names": ["cov", "s", "motion", "num_particles"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_odom_samples(cov, s, motion, num_particles):\n \"\"\" Get a pose sample, use this function to get multiple samples from robot motion model \"\"\"\n sampler = get_odom_sample(cov, motion)\n particles = []\n for i in xrange(num_particles):\n sample = sampler(s)\n particles.append(sample)\n return particles"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L103_C4", "label": "expression", "type": "expression", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L102_C0", "vector": [8, 1, 0.412, 0.004, 1, 0.77, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" Get a pose sample, use this function to get multiple samples from robot motion model \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L104_C4", "label": "sampler = get_odom_sample()", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L102_C0", "vector": [14, 1, 0.416, 0.004, 1, 0.77, 0.25, 234, 3, 2, 0, 0, 215, 10, 1], "semantic": {"name": "sampler", "arg_names": [], "import_names": [], "rhs_call_name": "get_odom_sample", "annotation": ""}, "snippet": " sampler = get_odom_sample(cov, motion)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L105_C4", "label": "particles =", "type": "assigned_variable", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L102_C0", "vector": [14, 1, 0.42, 0.004, 1, 0.77, 0.5, 63, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "particles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " particles = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L106_C4", "label": "for i", "type": "for", "loc": [106, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L102_C0", "vector": [6, 1, 0.428, 0.012, 1, 0.77, 0.75, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(num_particles):\n sample = sampler(s)\n particles.append(sample)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L107_C8", "label": "sample = sampler()", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L106_C4", "vector": [14, 2, 0.428, 0.004, 2, 0.89, 0.0, 513, 3, 1, 0, 0, 234, 10, 1], "semantic": {"name": "sample", "arg_names": [], "import_names": [], "rhs_call_name": "sampler", "annotation": ""}, "snippet": " sample = sampler(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L108_C8", "label": "append()", "type": "expression", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L106_C4", "vector": [8, 2, 0.432, 0.004, 2, 0.89, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " particles.append(sample)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L109_C4", "label": "return", "type": "return", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L102_C0", "vector": [13, 1, 0.436, 0.004, 1, 0.77, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return particles"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L112_C0", "label": "get_odom_sample", "type": "function", "loc": [112, 142], "level": 0, "parent": null, "vector": [2, 0, 0.508, 0.124, 0, 0.66, 0.7368, 215, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "get_odom_sample", "arg_names": ["motion_variances", "motion"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_odom_sample(motion_variances, motion): #s, motion_variances):\n \"\"\" \n Get a pose sample using odometry motion model (from Probabilistic Robotics p. 136)\n use this method to get a sample pose, ignore others \n motion - odometry in p2d format\n s - state in p2d format from time t-1\n motion_variances - motion variances\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L113_C4", "label": "expression", "type": "expression", "loc": [113, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L112_C0", "vector": [8, 1, 0.468, 0.036, 1, 0.75, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" \n Get a pose sample using odometry motion model (from Probabilistic Robotics p. 136)\n use this method to get a sample pose, ignore others \n motion - odometry in p2d format\n s - state in p2d format from time t-1\n motion_variances - motion variances\n \n returns a new p2d, a perturbed version of motion+s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L122_C4", "label": "u_move2d = p2d_to_move2d()", "type": "assigned_variable", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L112_C0", "vector": [14, 1, 0.488, 0.004, 1, 0.75, 0.3333, 738, 3, 1, 0, 0, 357, 10, 1], "semantic": {"name": "u_move2d", "arg_names": [], "import_names": [], "rhs_call_name": "p2d_to_move2d", "annotation": ""}, "snippet": " u_move2d = p2d_to_move2d(motion)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "label": "get_odom_sample_partial", "type": "function", "loc": [124, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L112_C0", "vector": [2, 1, 0.53, 0.072, 1, 0.75, 0.6667, 477, 0, 1, 1, 0, 0, 0, 8], "semantic": {"name": "get_odom_sample_partial", "arg_names": ["s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_odom_sample_partial(s):\n # Sample \n srot1 = sample_rot1 (u_move2d, motion_variances)\n trans = sample_trans(u_move2d, motion_variances)\n srot2 = sample_rot2 (u_move2d, motion_variances)\n\n rot1 = ut.standard_rad(u_move2d.rot1 - srot1)\n trans = u_move2d.trans - trans "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L126_C8", "label": "srot1 = sample_rot1()", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "vector": [14, 2, 0.504, 0.004, 2, 0.9, 0.0, 354, 3, 2, 0, 0, 354, 10, 1], "semantic": {"name": "srot1", "arg_names": [], "import_names": [], "rhs_call_name": "sample_rot1", "annotation": ""}, "snippet": " srot1 = sample_rot1 (u_move2d, motion_variances)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L127_C8", "label": "trans = sample_trans()", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "vector": [14, 2, 0.508, 0.004, 2, 0.9, 0.0909, 786, 3, 2, 0, 0, 770, 10, 1], "semantic": {"name": "trans", "arg_names": [], "import_names": [], "rhs_call_name": "sample_trans", "annotation": ""}, "snippet": " trans = sample_trans(u_move2d, motion_variances)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L128_C8", "label": "srot2 = sample_rot2()", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "vector": [14, 2, 0.512, 0.004, 2, 0.9, 0.1818, 760, 3, 2, 0, 0, 946, 10, 1], "semantic": {"name": "srot2", "arg_names": [], "import_names": [], "rhs_call_name": "sample_rot2", "annotation": ""}, "snippet": " srot2 = sample_rot2 (u_move2d, motion_variances)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L130_C8", "label": "rot1 = standard_rad()", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "vector": [14, 2, 0.52, 0.004, 2, 0.9, 0.2727, 856, 3, 1, 0, 0, 54, 10, 1], "semantic": {"name": "rot1", "arg_names": [], "import_names": [], "rhs_call_name": "standard_rad", "annotation": ""}, "snippet": " rot1 = ut.standard_rad(u_move2d.rot1 - srot1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L131_C8", "label": "trans =", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "vector": [14, 2, 0.524, 0.004, 2, 0.9, 0.3636, 786, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "trans", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trans = u_move2d.trans - trans "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L132_C8", "label": "rot2 =", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "vector": [14, 2, 0.528, 0.004, 2, 0.9, 0.4545, 447, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot2 = u_move2d.rot2 - srot2 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L136_C8", "label": "sx =", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "vector": [14, 2, 0.544, 0.004, 2, 0.9, 0.5455, 533, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sx = s.pos[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L137_C8", "label": "sy =", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "vector": [14, 2, 0.548, 0.004, 2, 0.9, 0.6364, 897, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sy = s.pos[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L138_C8", "label": "x =", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "vector": [14, 2, 0.552, 0.004, 2, 0.9, 0.7273, 190, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = sx + trans * mt.cos(s.angle + rot1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L139_C8", "label": "y =", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "vector": [14, 2, 0.556, 0.004, 2, 0.9, 0.8182, 304, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = sy + trans * mt.sin(s.angle + rot1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L140_C8", "label": "total_rot = standard_rad()", "type": "assigned_variable", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "vector": [14, 2, 0.56, 0.004, 2, 0.9, 0.9091, 697, 3, 1, 0, 0, 54, 10, 1], "semantic": {"name": "total_rot", "arg_names": [], "import_names": [], "rhs_call_name": "standard_rad", "annotation": ""}, "snippet": " total_rot = ut.standard_rad(s.angle + rot1 + rot2) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L141_C8", "label": "return", "type": "return", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "vector": [13, 2, 0.564, 0.004, 2, 0.9, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return t2d.Pose2D(x,y, total_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L142_C4", "label": "return", "type": "return", "loc": [142, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L112_C0", "vector": [13, 1, 0.568, 0.004, 1, 0.75, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return get_odom_sample_partial"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L145_C0", "label": "sample_rot1", "type": "function", "loc": [145, 153], "level": 0, "parent": null, "vector": [2, 0, 0.596, 0.036, 0, 0.66, 0.7895, 354, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "sample_rot1", "arg_names": ["odom", "odom_cov"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def sample_rot1(odom, odom_cov):\n rotvar = odom_cov.rotvar \n rotvar_0 = rotvar[0] / (np.pi * 2.0)\n scale = (rotvar_0 * abs(odom.rot1)) + (rotvar[1] * abs(odom.trans))\n\n if scale == 0.0:\n return 0.0\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L146_C4", "label": "rotvar =", "type": "assigned_variable", "loc": [146, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L145_C0", "vector": [14, 1, 0.584, 0.004, 1, 0.6, 0.0, 171, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rotvar", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rotvar = odom_cov.rotvar "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L147_C4", "label": "rotvar_0 =", "type": "assigned_variable", "loc": [147, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L145_C0", "vector": [14, 1, 0.588, 0.004, 1, 0.6, 0.3333, 220, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rotvar_0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rotvar_0 = rotvar[0] / (np.pi * 2.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L148_C4", "label": "scale =", "type": "assigned_variable", "loc": [148, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L145_C0", "vector": [14, 1, 0.592, 0.004, 1, 0.6, 0.6667, 18, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "scale", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scale = (rotvar_0 * abs(odom.rot1)) + (rotvar[1] * abs(odom.trans))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L150_C4", "label": "if", "type": "if", "loc": [150, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L145_C0", "vector": [4, 1, 0.606, 0.016, 1, 0.6, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if scale == 0.0:\n return 0.0\n else:\n return np.random.normal(scale=scale)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L151_C8", "label": "return", "type": "return", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L150_C4", "vector": [13, 2, 0.604, 0.004, 2, 0.83, 0.0, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L153_C8", "label": "return", "type": "return", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L150_C4", "vector": [13, 2, 0.612, 0.004, 2, 0.83, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.random.normal(scale=scale)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L156_C0", "label": "sample_trans", "type": "function", "loc": [156, 164], "level": 0, "parent": null, "vector": [2, 0, 0.64, 0.036, 0, 0.66, 0.8421, 770, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "sample_trans", "arg_names": ["odom", "odom_cov"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def sample_trans(odom, odom_cov):\n transvar = odom_cov.transvar \n rot_comp = transvar[0] * abs(odom.rot1 + odom.rot2)\n trans_comp = transvar[1] * abs(odom.trans)\n scale = rot_comp + trans_comp\n if scale == 0.0:\n return 0.0\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L157_C4", "label": "transvar =", "type": "assigned_variable", "loc": [157, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L156_C0", "vector": [14, 1, 0.628, 0.004, 1, 0.21, 0.0, 381, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "transvar", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " transvar = odom_cov.transvar "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L158_C4", "label": "rot_comp =", "type": "assigned_variable", "loc": [158, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L156_C0", "vector": [14, 1, 0.632, 0.004, 1, 0.21, 0.25, 372, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rot_comp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_comp = transvar[0] * abs(odom.rot1 + odom.rot2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L159_C4", "label": "trans_comp =", "type": "assigned_variable", "loc": [159, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L156_C0", "vector": [14, 1, 0.636, 0.004, 1, 0.21, 0.5, 441, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "trans_comp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trans_comp = transvar[1] * abs(odom.trans)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L160_C4", "label": "scale =", "type": "assigned_variable", "loc": [160, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L156_C0", "vector": [14, 1, 0.64, 0.004, 1, 0.21, 0.75, 18, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "scale", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scale = rot_comp + trans_comp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L161_C4", "label": "if", "type": "if", "loc": [161, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L156_C0", "vector": [4, 1, 0.65, 0.016, 1, 0.21, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if scale == 0.0:\n return 0.0\n else:\n return np.random.normal(scale=scale)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L162_C8", "label": "return", "type": "return", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L161_C4", "vector": [13, 2, 0.648, 0.004, 2, 0.94, 0.0, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L164_C8", "label": "return", "type": "return", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L161_C4", "vector": [13, 2, 0.656, 0.004, 2, 0.94, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.random.normal(scale=scale)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L167_C0", "label": "sample_rot2", "type": "function", "loc": [167, 174], "level": 0, "parent": null, "vector": [2, 0, 0.682, 0.032, 0, 0.66, 0.8947, 946, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "sample_rot2", "arg_names": ["odom", "odom_cov"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def sample_rot2(odom, odom_cov):\n rotvar = odom_cov.rotvar \n rotvar_0 = rotvar[0] / (np.pi * 2.0)\n scale = (rotvar_0 * abs(odom.rot2)) + (rotvar[1] * abs(odom.trans))\n if scale == 0.0:\n return 0.0\n else:\n return np.random.normal(scale=scale)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L168_C4", "label": "rotvar =", "type": "assigned_variable", "loc": [168, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L167_C0", "vector": [14, 1, 0.672, 0.004, 1, 0.05, 0.0, 171, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rotvar", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rotvar = odom_cov.rotvar "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L169_C4", "label": "rotvar_0 =", "type": "assigned_variable", "loc": [169, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L167_C0", "vector": [14, 1, 0.676, 0.004, 1, 0.05, 0.3333, 220, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rotvar_0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rotvar_0 = rotvar[0] / (np.pi * 2.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L170_C4", "label": "scale =", "type": "assigned_variable", "loc": [170, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L167_C0", "vector": [14, 1, 0.68, 0.004, 1, 0.05, 0.6667, 18, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "scale", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scale = (rotvar_0 * abs(odom.rot2)) + (rotvar[1] * abs(odom.trans))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L171_C4", "label": "if", "type": "if", "loc": [171, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L167_C0", "vector": [4, 1, 0.69, 0.016, 1, 0.05, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if scale == 0.0:\n return 0.0\n else:\n return np.random.normal(scale=scale)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L172_C8", "label": "return", "type": "return", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L171_C4", "vector": [13, 2, 0.688, 0.004, 2, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L174_C8", "label": "return", "type": "return", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L171_C4", "vector": [13, 2, 0.696, 0.004, 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 np.random.normal(scale=scale)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L177_C0", "label": "draw_weighted_Pose2D", "type": "function", "loc": [177, 208], "level": 0, "parent": null, "vector": [2, 0, 0.77, 0.128, 0, 0.66, 0.9474, 561, 0, 3, 0, 0, 0, 0, 31], "semantic": {"name": "draw_weighted_Pose2D", "arg_names": ["display", "max_weight", "particles"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def draw_weighted_Pose2D(display, max_weight, particles):\n for p in particles:\n if type(p) is types.TupleType:\n part, weight = p\n rpos = part.pos\n else:\n part = p\n rpos = p.pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4", "label": "for p", "type": "for", "loc": [178, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L177_C0", "vector": [6, 1, 0.772, 0.124, 1, 0.31, 0.0, 491, 2, 0, 0, 0, 0, 0, 31], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for p in particles:\n if type(p) is types.TupleType:\n part, weight = p\n rpos = part.pos\n else:\n part = p\n rpos = p.pos\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L179_C8", "label": "if", "type": "if", "loc": [179, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4", "vector": [4, 2, 0.726, 0.024, 2, 0.55, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(p) is types.TupleType:\n part, weight = p\n rpos = part.pos\n else:\n part = p\n rpos = p.pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L180_C12", "label": "part, weight =", "type": "assigned_variable", "loc": [180, 180], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L179_C8", "vector": [14, 3, 0.72, 0.004, 3, 0.71, 0.0, 822, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "part, weight", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " part, weight = p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L181_C12", "label": "rpos =", "type": "assigned_variable", "loc": [181, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L179_C8", "vector": [14, 3, 0.724, 0.004, 3, 0.71, 0.3333, 846, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rpos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rpos = part.pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L183_C12", "label": "part =", "type": "assigned_variable", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L179_C8", "vector": [14, 3, 0.732, 0.004, 3, 0.71, 0.6667, 374, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "part", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " part = p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L184_C12", "label": "rpos =", "type": "assigned_variable", "loc": [184, 184], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L179_C8", "vector": [14, 3, 0.736, 0.004, 3, 0.71, 1.0, 846, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rpos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rpos = p.pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L186_C8", "label": "x =", "type": "assigned_variable", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4", "vector": [14, 2, 0.744, 0.004, 2, 0.55, 0.1111, 190, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = mt.cos(part.angle) * .07"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L187_C8", "label": "y =", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4", "vector": [14, 2, 0.748, 0.004, 2, 0.55, 0.2222, 304, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = mt.sin(part.angle) * .07"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L189_C8", "label": "dir = copy()", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4", "vector": [14, 2, 0.756, 0.004, 2, 0.55, 0.3333, 152, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "dir", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " dir = rpos.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L190_C8", "label": "assign", "type": "assigned_variable", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4", "vector": [14, 2, 0.76, 0.004, 2, 0.55, 0.4444, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dir[0,0] = dir[0,0] + x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L191_C8", "label": "assign", "type": "assigned_variable", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4", "vector": [14, 2, 0.764, 0.004, 2, 0.55, 0.5556, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dir[1,0] = dir[1,0] + y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L193_C8", "label": "pos = to_screen()", "type": "assigned_variable", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4", "vector": [14, 2, 0.772, 0.004, 2, 0.55, 0.6667, 627, 3, 1, 0, 0, 932, 10, 1], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "to_screen", "annotation": ""}, "snippet": " pos = display.to_screen(rpos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L194_C8", "label": "dirp = to_screen()", "type": "assigned_variable", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4", "vector": [14, 2, 0.776, 0.004, 2, 0.55, 0.7778, 872, 3, 1, 0, 0, 932, 10, 1], "semantic": {"name": "dirp", "arg_names": [], "import_names": [], "rhs_call_name": "to_screen", "annotation": ""}, "snippet": " dirp = display.to_screen(dir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L196_C8", "label": "if", "type": "if", "loc": [196, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4", "vector": [4, 2, 0.8, 0.036, 2, 0.55, 0.8889, 0, 0, 0, 0, 0, 0, 0, 17], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(p) is types.TupleType:\n color = round(255.0 * (weight/max_weight))\n cv.cvCircle(display.buffer, cv.cvPoint((int) (pos[0,0]), (int) (pos[1,0])), \n 2, cv.cvScalar(255, 255-color, 255), cv.CV_FILLED, cv.CV_AA)\n cv.cvCircle(display.buffer, cv.cvPoint((int) (pos[0,0]), (int) (pos[1,0])), \n 2, cv.cvScalar(200, 200, 200), 8, cv.CV_AA)\n else:\n cv.cvCircle(display.buffer, cv.cvPoint((int) (pos[0,0]), (int) (pos[1,0])), "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L197_C12", "label": "color = round()", "type": "assigned_variable", "loc": [197, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L196_C8", "vector": [14, 3, 0.788, 0.004, 3, 0.74, 0.0, 776, 3, 1, 0, 0, 19, 10, 1], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "round", "annotation": ""}, "snippet": " color = round(255.0 * (weight/max_weight))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L198_C12", "label": "cvCircle()", "type": "expression", "loc": [198, 199], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L196_C8", "vector": [8, 3, 0.794, 0.008, 3, 0.74, 0.3333, 820, 3, 6, 0, 0, 0, 0, 5], "semantic": {"name": "cvCircle", "arg_names": [], "import_names": [], "rhs_call_name": "cvCircle", "annotation": ""}, "snippet": " cv.cvCircle(display.buffer, cv.cvPoint((int) (pos[0,0]), (int) (pos[1,0])), \n 2, cv.cvScalar(255, 255-color, 255), cv.CV_FILLED, cv.CV_AA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L200_C12", "label": "cvCircle()", "type": "expression", "loc": [200, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L196_C8", "vector": [8, 3, 0.802, 0.008, 3, 0.74, 0.6667, 820, 3, 6, 0, 0, 0, 0, 5], "semantic": {"name": "cvCircle", "arg_names": [], "import_names": [], "rhs_call_name": "cvCircle", "annotation": ""}, "snippet": " cv.cvCircle(display.buffer, cv.cvPoint((int) (pos[0,0]), (int) (pos[1,0])), \n 2, cv.cvScalar(200, 200, 200), 8, cv.CV_AA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L203_C12", "label": "cvCircle()", "type": "expression", "loc": [203, 204], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L196_C8", "vector": [8, 3, 0.814, 0.008, 3, 0.74, 1.0, 820, 3, 6, 0, 0, 0, 0, 5], "semantic": {"name": "cvCircle", "arg_names": [], "import_names": [], "rhs_call_name": "cvCircle", "annotation": ""}, "snippet": " cv.cvCircle(display.buffer, cv.cvPoint((int) (pos[0,0]), (int) (pos[1,0])), \n 2, cv.cvScalar(150, 150, 150), cv.CV_FILLED, cv.CV_AA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L206_C8", "label": "cvLine()", "type": "expression", "loc": [206, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4", "vector": [8, 2, 0.828, 0.012, 2, 0.55, 1.0, 569, 3, 7, 0, 0, 0, 0, 8], "semantic": {"name": "cvLine", "arg_names": [], "import_names": [], "rhs_call_name": "cvLine", "annotation": ""}, "snippet": " cv.cvLine(display.buffer, cv.cvPoint((int) (pos[0,0]), (int) (pos[1,0])),\n cv.cvPoint((int) (dirp[0,0]), (int) (dirp[1,0])),\n cv.cvScalar(100,200,100), 1, cv.CV_AA, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L235_C0", "label": "if", "type": "if", "loc": [235, 245], "level": 0, "parent": null, "vector": [4, 0, 0.96, 0.044, 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 import nodes as nd\n import detection_appearance as da\n\n rotvar = (0.8, 0.2)\n transvar = (0.1, 0.9)\n motion_model = RobotMotion(motion_var(rotvar=rotvar, transvar=transfar))\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Import_L236_C4", "label": "nodes import nd", "type": "import", "loc": [236, 236], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L235_C0", "vector": [1, 1, 0.944, 0.004, 1, 0.73, 0.0, 696, 0, 1, 0, 0, 696, 0, 0], "semantic": {"name": "nodes", "arg_names": [], "import_names": ["nd"], "rhs_call_name": "", "annotation": ""}, "snippet": " import nodes as nd"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Import_L237_C4", "label": "detection_appearance import da", "type": "import", "loc": [237, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L235_C0", "vector": [1, 1, 0.948, 0.004, 1, 0.73, 0.1429, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "detection_appearance", "arg_names": [], "import_names": ["da"], "rhs_call_name": "", "annotation": ""}, "snippet": " import detection_appearance as da"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L239_C4", "label": "rotvar =", "type": "assigned_variable", "loc": [239, 239], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L235_C0", "vector": [14, 1, 0.956, 0.004, 1, 0.73, 0.2857, 171, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "rotvar", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rotvar = (0.8, 0.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L240_C4", "label": "transvar =", "type": "assigned_variable", "loc": [240, 240], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L235_C0", "vector": [14, 1, 0.96, 0.004, 1, 0.73, 0.4286, 381, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "transvar", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " transvar = (0.1, 0.9)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L241_C4", "label": "motion_model = RobotMotion()", "type": "assigned_variable", "loc": [241, 241], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L235_C0", "vector": [14, 1, 0.964, 0.004, 1, 0.73, 0.5714, 149, 3, 1, 0, 0, 304, 10, 2], "semantic": {"name": "motion_model", "arg_names": [], "import_names": [], "rhs_call_name": "RobotMotion", "annotation": ""}, "snippet": " motion_model = RobotMotion(motion_var(rotvar=rotvar, transvar=transfar))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L243_C4", "label": "cov = eye()", "type": "assigned_variable", "loc": [243, 243], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L235_C0", "vector": [14, 1, 0.972, 0.004, 1, 0.73, 0.7143, 251, 3, 1, 0, 0, 881, 10, 1], "semantic": {"name": "cov", "arg_names": [], "import_names": [], "rhs_call_name": "eye", "annotation": ""}, "snippet": " cov = np.eye(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L244_C4", "label": "app_model = DetectionAppearance()", "type": "assigned_variable", "loc": [244, 244], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L235_C0", "vector": [14, 1, 0.976, 0.004, 1, 0.73, 0.8571, 337, 3, 0, 0, 0, 935, 10, 1], "semantic": {"name": "app_model", "arg_names": [], "import_names": [], "rhs_call_name": "DetectionAppearance", "annotation": ""}, "snippet": " app_model = DetectionAppearance()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L245_C4", "label": "disp = RobotDisp()", "type": "assigned_variable", "loc": [245, 245], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L235_C0", "vector": [14, 1, 0.98, 0.004, 1, 0.73, 1.0, 654, 3, 0, 0, 0, 590, 10, 1], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "RobotDisp", "annotation": ""}, "snippet": " disp = nd.RobotDisp()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99652:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L19_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L20_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L19_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L21_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L22_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:ClassDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:ClassDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:ClassDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:ClassDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:ClassDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L102_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L102_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L102_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L102_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L102_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L145_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L145_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L145_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L145_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Return_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:FunctionDef_L177_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L180_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L181_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L183_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L184_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L196_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L197_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L196_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L198_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L196_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L200_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L196_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L203_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:For_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Expr_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L235_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Import_L236_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L235_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Import_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L235_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L239_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L235_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L240_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L235_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L241_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L235_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L235_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L244_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99652:If_L235_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99652:Assign_L245_C4"}]
#!/usr/bin/python import roslib roslib.load_manifest("pr2_laser_follow_behavior") import rospy import numpy as np import math from actionlib_msgs.msg import * from pr2_controllers_msgs.msg import * from geometry_msgs.msg import * from std_msgs.msg import String from move_base_msgs.msg import * import actionlib import tf import laser_interface.camera as cam import hrl_lib.tf_utils as tfu from threading import RLock def in_bounds(p2d, xlim, ylim): return (xlim[0] <= p2d[0,0]) and (p2d[0,0] <= xlim[1]) \ and (ylim[0] <= p2d[1,0]) and (p2d[1,0] <= ylim[1]) class LookAtBehavior: def __init__(self, camera_root_topic): #self.wait = False #self.point3d = None self.state = 'ready' self.lock = RLock() self.lock.acquire() self.message = None self.STATES = {'ready':'ready', # none 'head_turn': 'head_turn', # something #'head_turn_drive': 'head_turn_drive', # something 'driving': 'driving'} # something rospy.init_node('look_at_point_behavior', anonymous=True) rospy.Subscriber('cursor3d', PointStamped, self.laser_point_handler) self.point_pub = rospy.Publisher('cursor3dcentered', PointStamped) self.double_click = rospy.Subscriber('mouse_left_double_click', String, self.move_base_double_click) self.double_click2 = rospy.Subscriber('mouse_left_double_click', String, self.cancel_move_base_double_click) self.camera_model = cam.ROSStereoCalibration('/' + camera_root_topic + '/left/camera_info' , '/' + camera_root_topic + '/right/camera_info') self.head_client = actionlib.SimpleActionClient('head_traj_controller/point_head_action', PointHeadAction) #self.head_client.wait_for_server() self.base_client = actionlib.SimpleActionClient('move_base', MoveBaseAction) #self.base_client.wait_for_server() #self.move_pub = rospy.Publisher('move_base_simple/goal', PoseStamped) self.move_pub = rospy.Publisher('look_at_point_goal', PoseStamped) #self.move_pub2 = rospy.Publisher('hai_constant', PoseStamped) self.tflistener = tf.TransformListener() self.lock.release() print 'running' def move_base_double_click(self, a_str): if self.message == None: rospy.logwarn('Unable to go, no message heard.') return else: self.lock.acquire() self.state = self.STATES['driving'] #Looking at the point last clicked on... (maybe keep doing this as we drive?) #self.look_at(self.message) #Move base self.move_base(self.message) self.message = None self.state = self.STATES['ready'] self.lock.release() def transform_point(self, point_stamped): point_head = point_stamped.point #Tranform into base link target_link = '/base_link' base_T_head = tfu.transform(target_link, point_stamped.header.frame_id, self.tflistener) point_mat_head = tfu.translation_matrix([point_head.x, point_head.y, point_head.z]) point_mat_base = base_T_head * point_mat_head t_base, o_base = tfu.matrix_as_tf(point_mat_base) #Calculate angle robot should face angle = math.atan2(t_base[1], t_base[0]) q = tf.transformations.quaternion_from_euler(0, 0, angle) return (t_base, q, target_link) def move_base(self, point, wait=False): t_base, q, target_link = point ps = PoseStamped() ps.header.frame_id = target_link ps.pose.position = geometry_msgs.msg.Point(t_base[0], t_base[1], 0) ps.pose.orientation = geometry_msgs.msg.Quaternion(*q) self.move_pub.publish(ps) #Uncomment to actually move goal = MoveBaseGoal() goal.target_pose.header.frame_id = target_link goal.target_pose.pose.position = geometry_msgs.msg.Point(t_base[0], t_base[1], 0) goal.target_pose.pose.orientation = geometry_msgs.msg.Quaternion(*q) self.base_client.send_goal(goal) print 'Sent GOAL' if wait: self.base_client.wait_for_result() if self.base_client.get_state() == GoalStatus.SUCCEEDED: return True else: return False def laser_point_handler(self, point_stamped): p = np.matrix([point_stamped.point.x, point_stamped.point.y, point_stamped.point.z, 1.]).T p2d = self.camera_model.left.P * p p2d = p2d / p2d[2,0] bx = ((self.camera_model.left.w/2.) * .9) by = ((self.camera_model.left.h/2.) * .9) xlim = [bx, self.camera_model.left.w - bx] ylim = [by, self.camera_model.left.h - by] if (self.state == self.STATES['driving']): return self.message = self.transform_point(point_stamped) if not in_bounds(p2d, xlim, ylim): if self.state != self.STATES['head_turn']: self.lock.acquire() self.state = self.STATES['head_turn'] self.lock.release() #else if we are in bounds, we do nothing #always update laser's location def run(self): r = rospy.Rate(50) while not rospy.is_shutdown(): r.sleep() if self.state == self.STATES['head_turn']: self.lock.acquire() result = self.look_at(self.message, False) self.state = self.STATES['ready'] self.lock.release() def look_at(self, message, wait=True): g = PointHeadGoal() g.target.header.frame_id = message[2] g.target.point = geometry_msgs.msg.Point(*message[0]) g.min_duration = rospy.Duration(1.0) g.max_velocity = 10. self.head_client.send_goal(g) #rospy.loginfo('Sent look at goal ' + str(g)) if wait: self.head_client.wait_for_result() if self.head_client.get_state() == GoalStatus.SUCCEEDED: return True else: return False if __name__ == '__main__': lab = LookAtBehavior('wide_stereo') lab.run()
ajibawa-2023/Python-Code-Large/train/row_99653
114
167
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.012, 0.006, 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_99653:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.018, 0.006, 0, 0.66, 0.0588, 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(\"pr2_laser_follow_behavior\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.024, 0.006, 0, 0.66, 0.1176, 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_99653:Import_L6_C0", "label": "numpy import np", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0359, 0.006, 0, 0.66, 0.1765, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Import_L7_C0", "label": "math import math", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0419, 0.006, 0, 0.66, 0.2353, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:ImportFrom_L9_C0", "label": "from actionlib_msgs.msg import *", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0539, 0.006, 0, 0.66, 0.2941, 245, 0, 1, 0, 0, 245, 0, 0], "semantic": {"name": "actionlib_msgs.msg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from actionlib_msgs.msg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:ImportFrom_L10_C0", "label": "from pr2_controllers_msgs.msg import *", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0599, 0.006, 0, 0.66, 0.3529, 457, 0, 1, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:ImportFrom_L11_C0", "label": "from geometry_msgs.msg import *", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0659, 0.006, 0, 0.66, 0.4118, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:ImportFrom_L12_C0", "label": "from std_msgs.msg import String", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0719, 0.006, 0, 0.66, 0.4706, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["String"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import String"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:ImportFrom_L13_C0", "label": "from move_base_msgs.msg import *", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0778, 0.006, 0, 0.66, 0.5294, 440, 0, 1, 0, 0, 440, 0, 0], "semantic": {"name": "move_base_msgs.msg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_base_msgs.msg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Import_L15_C0", "label": "actionlib import actionlib", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0898, 0.006, 0, 0.66, 0.5882, 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_99653:Import_L16_C0", "label": "tf import tf", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0958, 0.006, 0, 0.66, 0.6471, 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_99653:Import_L17_C0", "label": "laser_interface.camera import cam", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1018, 0.006, 0, 0.66, 0.7059, 875, 0, 1, 0, 0, 875, 0, 0], "semantic": {"name": "laser_interface.camera", "arg_names": [], "import_names": ["cam"], "rhs_call_name": "", "annotation": ""}, "snippet": "import laser_interface.camera as cam"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Import_L18_C0", "label": "hrl_lib.tf_utils import tfu", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1078, 0.006, 0, 0.66, 0.7647, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "hrl_lib.tf_utils", "arg_names": [], "import_names": ["tfu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.tf_utils as tfu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:ImportFrom_L19_C0", "label": "from threading import RLock", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.1138, 0.006, 0, 0.66, 0.8235, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["RLock"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import RLock"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L22_C0", "label": "in_bounds", "type": "function", "loc": [22, 24], "level": 0, "parent": null, "vector": [2, 0, 0.1377, 0.018, 0, 0.66, 0.8824, 510, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "in_bounds", "arg_names": ["p2d", "xlim", "ylim"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def in_bounds(p2d, xlim, ylim):\n return (xlim[0] <= p2d[0,0]) and (p2d[0,0] <= xlim[1]) \\\n and (ylim[0] <= p2d[1,0]) and (p2d[1,0] <= ylim[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Return_L23_C4", "label": "return", "type": "return", "loc": [23, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L22_C0", "vector": [13, 1, 0.1407, 0.012, 1, 0.89, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (xlim[0] <= p2d[0,0]) and (p2d[0,0] <= xlim[1]) \\\n and (ylim[0] <= p2d[1,0]) and (p2d[1,0] <= ylim[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:ClassDef_L26_C0", "label": "LookAtBehavior", "type": "class", "loc": [26, 159], "level": 0, "parent": null, "vector": [3, 0, 0.5539, 0.8024, 0, 0.66, 0.9412, 744, 0, 7, 0, 0, 0, 0, 51], "semantic": {"name": "LookAtBehavior", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class LookAtBehavior:\n\n def __init__(self, camera_root_topic):\n #self.wait = False\n #self.point3d = None\n self.state = 'ready'\n self.lock = RLock()\n self.lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "label": "__init__", "type": "function", "loc": [28, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:ClassDef_L26_C0", "vector": [2, 1, 0.2515, 0.1737, 1, 0.22, 0.0, 555, 0, 2, 0, 0, 0, 0, 14], "semantic": {"name": "__init__", "arg_names": ["self", "camera_root_topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, camera_root_topic):\n #self.wait = False\n #self.point3d = None\n self.state = 'ready'\n self.lock = RLock()\n self.lock.acquire()\n self.message = None \n self.STATES = {'ready':'ready', # none"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L31_C8", "label": "self.state =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "vector": [14, 2, 0.1856, 0.006, 2, 0.09, 0.0, 765, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.state = 'ready'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L32_C8", "label": "self.lock = RLock()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "vector": [14, 2, 0.1916, 0.006, 2, 0.09, 0.0625, 45, 3, 0, 0, 0, 207, 10, 1], "semantic": {"name": "self.lock", "arg_names": [], "import_names": [], "rhs_call_name": "RLock", "annotation": ""}, "snippet": " self.lock = RLock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L33_C8", "label": "acquire()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "vector": [8, 2, 0.1976, 0.006, 2, 0.09, 0.125, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L34_C8", "label": "self.message =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "vector": [14, 2, 0.2036, 0.006, 2, 0.09, 0.1875, 709, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.message = None "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L35_C8", "label": "self.STATES =", "type": "assigned_variable", "loc": [35, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "vector": [14, 2, 0.2186, 0.024, 2, 0.09, 0.25, 611, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.STATES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.STATES = {'ready':'ready', # none\n 'head_turn': 'head_turn', # something\n #'head_turn_drive': 'head_turn_drive', # something\n 'driving': 'driving'} # something"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L40_C8", "label": "init_node()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "vector": [8, 2, 0.2395, 0.006, 2, 0.09, 0.3125, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('look_at_point_behavior', anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L41_C8", "label": "Subscriber()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "vector": [8, 2, 0.2455, 0.006, 2, 0.09, 0.375, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('cursor3d', PointStamped, self.laser_point_handler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L42_C8", "label": "self.point_pub = Publisher()", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "vector": [14, 2, 0.2515, 0.006, 2, 0.09, 0.4375, 87, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.point_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.point_pub = rospy.Publisher('cursor3dcentered', PointStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L43_C8", "label": "self.double_click = Subscriber()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "vector": [14, 2, 0.2575, 0.006, 2, 0.09, 0.5, 256, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "self.double_click", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " self.double_click = rospy.Subscriber('mouse_left_double_click', String, self.move_base_double_click)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L44_C8", "label": "self.double_click2 = Subscriber()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "vector": [14, 2, 0.2635, 0.006, 2, 0.09, 0.5625, 347, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "self.double_click2", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " self.double_click2 = rospy.Subscriber('mouse_left_double_click', String, self.cancel_move_base_double_click)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L45_C8", "label": "self.camera_model = ROSStereoCalibration()", "type": "assigned_variable", "loc": [45, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "vector": [14, 2, 0.2725, 0.012, 2, 0.09, 0.625, 956, 3, 2, 0, 0, 61, 10, 1], "semantic": {"name": "self.camera_model", "arg_names": [], "import_names": [], "rhs_call_name": "ROSStereoCalibration", "annotation": ""}, "snippet": " self.camera_model = cam.ROSStereoCalibration('/' + camera_root_topic + '/left/camera_info' , \n '/' + camera_root_topic + '/right/camera_info')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L47_C8", "label": "self.head_client = SimpleActionClient()", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "vector": [14, 2, 0.2814, 0.006, 2, 0.09, 0.6875, 456, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.head_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.head_client = actionlib.SimpleActionClient('head_traj_controller/point_head_action', PointHeadAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L49_C8", "label": "self.base_client = SimpleActionClient()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "vector": [14, 2, 0.2934, 0.006, 2, 0.09, 0.75, 41, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.base_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.base_client = actionlib.SimpleActionClient('move_base', MoveBaseAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L52_C8", "label": "self.move_pub = Publisher()", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "vector": [14, 2, 0.3114, 0.006, 2, 0.09, 0.8125, 172, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.move_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.move_pub = rospy.Publisher('look_at_point_goal', PoseStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L54_C8", "label": "self.tflistener = TransformListener()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "vector": [14, 2, 0.3234, 0.006, 2, 0.09, 0.875, 50, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tflistener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.tflistener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L55_C8", "label": "release()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "vector": [8, 2, 0.3293, 0.006, 2, 0.09, 0.9375, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L56_C8", "label": "print()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "vector": [8, 2, 0.3353, 0.006, 2, 0.09, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('running')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L59_C4", "label": "move_base_double_click", "type": "function", "loc": [59, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:ClassDef_L26_C0", "vector": [2, 1, 0.3952, 0.0898, 1, 0.22, 0.1667, 952, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "move_base_double_click", "arg_names": ["self", "a_str"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_base_double_click(self, a_str):\n if self.message == None:\n rospy.logwarn('Unable to go, no message heard.')\n return\n else:\n self.lock.acquire()\n self.state = self.STATES['driving']\n #Looking at the point last clicked on... (maybe keep doing this as we drive?)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L60_C8", "label": "if", "type": "if", "loc": [60, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L59_C4", "vector": [4, 2, 0.3982, 0.0838, 2, 0.62, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.message == None:\n rospy.logwarn('Unable to go, no message heard.')\n return\n else:\n self.lock.acquire()\n self.state = self.STATES['driving']\n #Looking at the point last clicked on... (maybe keep doing this as we drive?)\n #self.look_at(self.message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L61_C12", "label": "logwarn()", "type": "expression", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L60_C8", "vector": [8, 3, 0.3653, 0.006, 3, 0.96, 0.0, 736, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logwarn", "arg_names": [], "import_names": [], "rhs_call_name": "logwarn", "annotation": ""}, "snippet": " rospy.logwarn('Unable to go, no message heard.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Return_L62_C12", "label": "return", "type": "return", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L60_C8", "vector": [13, 3, 0.3713, 0.006, 3, 0.96, 0.1429, 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_99653:Expr_L64_C12", "label": "acquire()", "type": "expression", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L60_C8", "vector": [8, 3, 0.3832, 0.006, 3, 0.96, 0.2857, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L65_C12", "label": "self.state =", "type": "assigned_variable", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L60_C8", "vector": [14, 3, 0.3892, 0.006, 3, 0.96, 0.4286, 765, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.state = self.STATES['driving']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L70_C12", "label": "move_base()", "type": "expression", "loc": [70, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L60_C8", "vector": [8, 3, 0.4192, 0.006, 3, 0.96, 0.5714, 55, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "move_base", "arg_names": [], "import_names": [], "rhs_call_name": "move_base", "annotation": ""}, "snippet": " self.move_base(self.message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L71_C12", "label": "self.message =", "type": "assigned_variable", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L60_C8", "vector": [14, 3, 0.4251, 0.006, 3, 0.96, 0.7143, 709, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.message = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L72_C12", "label": "self.state =", "type": "assigned_variable", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L60_C8", "vector": [14, 3, 0.4311, 0.006, 3, 0.96, 0.8571, 765, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.state = self.STATES['ready']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L73_C12", "label": "release()", "type": "expression", "loc": [73, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L60_C8", "vector": [8, 3, 0.4371, 0.006, 3, 0.96, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L75_C4", "label": "transform_point", "type": "function", "loc": [75, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:ClassDef_L26_C0", "vector": [2, 1, 0.488, 0.0838, 1, 0.22, 0.3333, 911, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "transform_point", "arg_names": ["self", "point_stamped"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def transform_point(self, point_stamped):\n point_head = point_stamped.point\n\n #Tranform into base link\n target_link = '/base_link'\n base_T_head = tfu.transform(target_link, point_stamped.header.frame_id, self.tflistener)\n point_mat_head = tfu.translation_matrix([point_head.x, point_head.y, point_head.z])\n point_mat_base = base_T_head * point_mat_head"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L76_C8", "label": "point_head =", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L75_C4", "vector": [14, 2, 0.4551, 0.006, 2, 0.83, 0.0, 553, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "point_head", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point_head = point_stamped.point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L79_C8", "label": "target_link =", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L75_C4", "vector": [14, 2, 0.4731, 0.006, 2, 0.83, 0.125, 314, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "target_link", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " target_link = '/base_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L80_C8", "label": "base_T_head = transform()", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L75_C4", "vector": [14, 2, 0.479, 0.006, 2, 0.83, 0.25, 683, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "base_T_head", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " base_T_head = tfu.transform(target_link, point_stamped.header.frame_id, self.tflistener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L81_C8", "label": "point_mat_head = translation_matrix()", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L75_C4", "vector": [14, 2, 0.485, 0.006, 2, 0.83, 0.375, 237, 3, 1, 0, 0, 868, 10, 1], "semantic": {"name": "point_mat_head", "arg_names": [], "import_names": [], "rhs_call_name": "translation_matrix", "annotation": ""}, "snippet": " point_mat_head = tfu.translation_matrix([point_head.x, point_head.y, point_head.z])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L82_C8", "label": "point_mat_base =", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L75_C4", "vector": [14, 2, 0.491, 0.006, 2, 0.83, 0.5, 970, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "point_mat_base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point_mat_base = base_T_head * point_mat_head"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L83_C8", "label": "t_base, o_base = matrix_as_tf()", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L75_C4", "vector": [14, 2, 0.497, 0.006, 2, 0.83, 0.625, 359, 3, 1, 0, 0, 22, 10, 1], "semantic": {"name": "t_base, o_base", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_as_tf", "annotation": ""}, "snippet": " t_base, o_base = tfu.matrix_as_tf(point_mat_base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L86_C8", "label": "angle = atan2()", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L75_C4", "vector": [14, 2, 0.515, 0.006, 2, 0.83, 0.75, 418, 3, 2, 0, 0, 572, 10, 1], "semantic": {"name": "angle", "arg_names": [], "import_names": [], "rhs_call_name": "atan2", "annotation": ""}, "snippet": " angle = math.atan2(t_base[1], t_base[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L87_C8", "label": "q = quaternion_from_euler()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L75_C4", "vector": [14, 2, 0.521, 0.006, 2, 0.83, 0.875, 516, 3, 3, 0, 0, 561, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_from_euler", "annotation": ""}, "snippet": " q = tf.transformations.quaternion_from_euler(0, 0, angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Return_L88_C8", "label": "return", "type": "return", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L75_C4", "vector": [13, 2, 0.5269, 0.006, 2, 0.83, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (t_base, q, target_link)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "label": "move_base", "type": "function", "loc": [91, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:ClassDef_L26_C0", "vector": [2, 1, 0.6048, 0.1257, 1, 0.22, 0.5, 55, 0, 3, 1, 0, 0, 0, 11], "semantic": {"name": "move_base", "arg_names": ["self", "point", "wait"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_base(self, point, wait=False):\n t_base, q, target_link = point\n ps = PoseStamped()\n ps.header.frame_id = target_link\n ps.pose.position = geometry_msgs.msg.Point(t_base[0], t_base[1], 0)\n ps.pose.orientation = geometry_msgs.msg.Quaternion(*q)\n self.move_pub.publish(ps)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L92_C8", "label": "t_base, q, target_link =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "vector": [14, 2, 0.5509, 0.006, 2, 0.58, 0.0, 483, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t_base, q, target_link", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t_base, q, target_link = point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L93_C8", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "vector": [14, 2, 0.5569, 0.006, 2, 0.58, 0.0769, 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_99653:Assign_L94_C8", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "vector": [14, 2, 0.5629, 0.006, 2, 0.58, 0.1538, 293, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.header.frame_id = target_link"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L95_C8", "label": "ps.pose.position = Point()", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "vector": [14, 2, 0.5689, 0.006, 2, 0.58, 0.2308, 530, 3, 3, 0, 0, 652, 10, 1], "semantic": {"name": "ps.pose.position", "arg_names": [], "import_names": [], "rhs_call_name": "Point", "annotation": ""}, "snippet": " ps.pose.position = geometry_msgs.msg.Point(t_base[0], t_base[1], 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L96_C8", "label": "ps.pose.orientation = Quaternion()", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "vector": [14, 2, 0.5749, 0.006, 2, 0.58, 0.3077, 670, 3, 1, 0, 0, 747, 10, 1], "semantic": {"name": "ps.pose.orientation", "arg_names": [], "import_names": [], "rhs_call_name": "Quaternion", "annotation": ""}, "snippet": " ps.pose.orientation = geometry_msgs.msg.Quaternion(*q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L97_C8", "label": "publish()", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "vector": [8, 2, 0.5808, 0.006, 2, 0.58, 0.3846, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.move_pub.publish(ps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L100_C8", "label": "goal = MoveBaseGoal()", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "vector": [14, 2, 0.5988, 0.006, 2, 0.58, 0.4615, 914, 3, 0, 0, 0, 968, 10, 1], "semantic": {"name": "goal", "arg_names": [], "import_names": [], "rhs_call_name": "MoveBaseGoal", "annotation": ""}, "snippet": " goal = MoveBaseGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L101_C8", "label": "goal.target_pose.header.frame_id =", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "vector": [14, 2, 0.6048, 0.006, 2, 0.58, 0.5385, 138, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.target_pose.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.target_pose.header.frame_id = target_link"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L102_C8", "label": "goal.target_pose.pose.position = Point()", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "vector": [14, 2, 0.6108, 0.006, 2, 0.58, 0.6154, 639, 3, 3, 0, 0, 652, 10, 1], "semantic": {"name": "goal.target_pose.pose.position", "arg_names": [], "import_names": [], "rhs_call_name": "Point", "annotation": ""}, "snippet": " goal.target_pose.pose.position = geometry_msgs.msg.Point(t_base[0], t_base[1], 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L103_C8", "label": "goal.target_pose.pose.orientation = Quaternion()", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "vector": [14, 2, 0.6168, 0.006, 2, 0.58, 0.6923, 655, 3, 1, 0, 0, 747, 10, 1], "semantic": {"name": "goal.target_pose.pose.orientation", "arg_names": [], "import_names": [], "rhs_call_name": "Quaternion", "annotation": ""}, "snippet": " goal.target_pose.pose.orientation = geometry_msgs.msg.Quaternion(*q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L104_C8", "label": "send_goal()", "type": "expression", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "vector": [8, 2, 0.6228, 0.006, 2, 0.58, 0.7692, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.base_client.send_goal(goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L105_C8", "label": "print()", "type": "expression", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "vector": [8, 2, 0.6287, 0.006, 2, 0.58, 0.8462, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Sent GOAL')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L106_C8", "label": "if", "type": "if", "loc": [106, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "vector": [4, 2, 0.6377, 0.012, 2, 0.58, 0.9231, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if wait:\n self.base_client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L107_C12", "label": "wait_for_result()", "type": "expression", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L106_C8", "vector": [8, 3, 0.6407, 0.006, 3, 0.45, 0.0, 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.base_client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L108_C8", "label": "if", "type": "if", "loc": [108, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "vector": [4, 2, 0.6557, 0.024, 2, 0.58, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.base_client.get_state() == GoalStatus.SUCCEEDED:\n return True\n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Return_L109_C12", "label": "return", "type": "return", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L108_C8", "vector": [13, 3, 0.6527, 0.006, 3, 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_99653:Return_L111_C12", "label": "return", "type": "return", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L108_C8", "vector": [13, 3, 0.6647, 0.006, 3, 0.04, 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_99653:FunctionDef_L113_C4", "label": "laser_point_handler", "type": "function", "loc": [113, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:ClassDef_L26_C0", "vector": [2, 1, 0.7275, 0.1078, 1, 0.22, 0.6667, 910, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "laser_point_handler", "arg_names": ["self", "point_stamped"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def laser_point_handler(self, point_stamped):\n p = np.matrix([point_stamped.point.x, point_stamped.point.y, point_stamped.point.z, 1.]).T\n p2d = self.camera_model.left.P * p\n p2d = p2d / p2d[2,0]\n bx = ((self.camera_model.left.w/2.) * .9)\n by = ((self.camera_model.left.h/2.) * .9)\n xlim = [bx, self.camera_model.left.w - bx]\n ylim = [by, self.camera_model.left.h - by]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L114_C8", "label": "p =", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L113_C4", "vector": [14, 2, 0.6826, 0.006, 2, 0.0, 0.0, 491, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = np.matrix([point_stamped.point.x, point_stamped.point.y, point_stamped.point.z, 1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L115_C8", "label": "p2d =", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L113_C4", "vector": [14, 2, 0.6886, 0.006, 2, 0.0, 0.1111, 716, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p2d = self.camera_model.left.P * p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L116_C8", "label": "p2d =", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L113_C4", "vector": [14, 2, 0.6946, 0.006, 2, 0.0, 0.2222, 716, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p2d = p2d / p2d[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L117_C8", "label": "bx =", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L113_C4", "vector": [14, 2, 0.7006, 0.006, 2, 0.0, 0.3333, 477, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "bx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bx = ((self.camera_model.left.w/2.) * .9)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L118_C8", "label": "by =", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L113_C4", "vector": [14, 2, 0.7066, 0.006, 2, 0.0, 0.4444, 140, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "by", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " by = ((self.camera_model.left.h/2.) * .9)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L119_C8", "label": "xlim =", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L113_C4", "vector": [14, 2, 0.7126, 0.006, 2, 0.0, 0.5556, 907, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xlim = [bx, self.camera_model.left.w - bx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L120_C8", "label": "ylim =", "type": "assigned_variable", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L113_C4", "vector": [14, 2, 0.7186, 0.006, 2, 0.0, 0.6667, 247, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ylim", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ylim = [by, self.camera_model.left.h - by]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L122_C8", "label": "if", "type": "if", "loc": [122, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L113_C4", "vector": [4, 2, 0.7335, 0.012, 2, 0.0, 0.7778, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.state == self.STATES['driving']):\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Return_L123_C12", "label": "return", "type": "return", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L122_C8", "vector": [13, 3, 0.7365, 0.006, 3, 0.63, 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_99653:Assign_L124_C8", "label": "self.message = transform_point()", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L113_C4", "vector": [14, 2, 0.7425, 0.006, 2, 0.0, 0.8889, 709, 3, 1, 0, 0, 911, 10, 1], "semantic": {"name": "self.message", "arg_names": [], "import_names": [], "rhs_call_name": "transform_point", "annotation": ""}, "snippet": " self.message = self.transform_point(point_stamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L126_C8", "label": "if", "type": "if", "loc": [126, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L113_C4", "vector": [4, 2, 0.7665, 0.0299, 2, 0.0, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not in_bounds(p2d, xlim, ylim):\n if self.state != self.STATES['head_turn']:\n self.lock.acquire()\n self.state = self.STATES['head_turn']\n self.lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L127_C12", "label": "if", "type": "if", "loc": [127, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L126_C8", "vector": [4, 3, 0.7695, 0.024, 3, 0.94, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.state != self.STATES['head_turn']:\n self.lock.acquire()\n self.state = self.STATES['head_turn']\n self.lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L128_C16", "label": "acquire()", "type": "expression", "loc": [128, 128], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L127_C12", "vector": [8, 4, 0.7665, 0.006, 4, 0.42, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L129_C16", "label": "self.state =", "type": "assigned_variable", "loc": [129, 129], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L127_C12", "vector": [14, 4, 0.7725, 0.006, 4, 0.42, 0.5, 765, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.state = self.STATES['head_turn']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L130_C16", "label": "release()", "type": "expression", "loc": [130, 130], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L127_C12", "vector": [8, 4, 0.7784, 0.006, 4, 0.42, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L134_C4", "label": "run", "type": "function", "loc": [134, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:ClassDef_L26_C0", "vector": [2, 1, 0.8263, 0.0539, 1, 0.22, 0.8333, 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 r = rospy.Rate(50)\n while not rospy.is_shutdown():\n r.sleep()\n if self.state == self.STATES['head_turn']:\n self.lock.acquire()\n result = self.look_at(self.message, False)\n self.state = self.STATES['ready']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L135_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L134_C4", "vector": [14, 2, 0.8084, 0.006, 2, 0.53, 0.0, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " r = rospy.Rate(50)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:While_L136_C8", "label": "while", "type": "while", "loc": [136, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L134_C4", "vector": [5, 2, 0.8323, 0.0419, 2, 0.53, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n r.sleep()\n if self.state == self.STATES['head_turn']:\n self.lock.acquire()\n result = self.look_at(self.message, False)\n self.state = self.STATES['ready']\n self.lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L137_C12", "label": "sleep()", "type": "expression", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:While_L136_C8", "vector": [8, 3, 0.8204, 0.006, 3, 0.71, 0.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_99653:If_L138_C12", "label": "if", "type": "if", "loc": [138, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:While_L136_C8", "vector": [4, 3, 0.8383, 0.0299, 3, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.state == self.STATES['head_turn']:\n self.lock.acquire()\n result = self.look_at(self.message, False)\n self.state = self.STATES['ready']\n self.lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L139_C16", "label": "acquire()", "type": "expression", "loc": [139, 139], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L138_C12", "vector": [8, 4, 0.8323, 0.006, 4, 0.59, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L140_C16", "label": "result = look_at()", "type": "assigned_variable", "loc": [140, 140], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L138_C12", "vector": [14, 4, 0.8383, 0.006, 4, 0.59, 0.3333, 51, 3, 2, 0, 0, 695, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "look_at", "annotation": ""}, "snippet": " result = self.look_at(self.message, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L141_C16", "label": "self.state =", "type": "assigned_variable", "loc": [141, 141], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L138_C12", "vector": [14, 4, 0.8443, 0.006, 4, 0.59, 0.6667, 765, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.state = self.STATES['ready']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L142_C16", "label": "release()", "type": "expression", "loc": [142, 142], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L138_C12", "vector": [8, 4, 0.8503, 0.006, 4, 0.59, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L144_C4", "label": "look_at", "type": "function", "loc": [144, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:ClassDef_L26_C0", "vector": [2, 1, 0.9072, 0.0958, 1, 0.22, 1.0, 695, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "look_at", "arg_names": ["self", "message", "wait"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def look_at(self, message, wait=True):\n g = PointHeadGoal()\n g.target.header.frame_id = message[2]\n g.target.point = geometry_msgs.msg.Point(*message[0])\n g.min_duration = rospy.Duration(1.0)\n g.max_velocity = 10.\n\n self.head_client.send_goal(g)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L145_C8", "label": "g = PointHeadGoal()", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L144_C4", "vector": [14, 2, 0.8683, 0.006, 2, 0.99, 0.0, 384, 3, 0, 0, 0, 479, 10, 1], "semantic": {"name": "g", "arg_names": [], "import_names": [], "rhs_call_name": "PointHeadGoal", "annotation": ""}, "snippet": " g = PointHeadGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L146_C8", "label": "g.target.header.frame_id =", "type": "assigned_variable", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L144_C4", "vector": [14, 2, 0.8743, 0.006, 2, 0.99, 0.1429, 758, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "g.target.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " g.target.header.frame_id = message[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L147_C8", "label": "g.target.point = Point()", "type": "assigned_variable", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L144_C4", "vector": [14, 2, 0.8802, 0.006, 2, 0.99, 0.2857, 423, 3, 1, 0, 0, 652, 10, 1], "semantic": {"name": "g.target.point", "arg_names": [], "import_names": [], "rhs_call_name": "Point", "annotation": ""}, "snippet": " g.target.point = geometry_msgs.msg.Point(*message[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L148_C8", "label": "g.min_duration = Duration()", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L144_C4", "vector": [14, 2, 0.8862, 0.006, 2, 0.99, 0.4286, 705, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "g.min_duration", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " g.min_duration = rospy.Duration(1.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L149_C8", "label": "g.max_velocity =", "type": "assigned_variable", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L144_C4", "vector": [14, 2, 0.8922, 0.006, 2, 0.99, 0.5714, 818, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "g.max_velocity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " g.max_velocity = 10."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L151_C8", "label": "send_goal()", "type": "expression", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L144_C4", "vector": [8, 2, 0.9042, 0.006, 2, 0.99, 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": " self.head_client.send_goal(g)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L153_C8", "label": "if", "type": "if", "loc": [153, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L144_C4", "vector": [4, 2, 0.9192, 0.012, 2, 0.99, 0.8571, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if wait:\n self.head_client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L154_C12", "label": "wait_for_result()", "type": "expression", "loc": [154, 154], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L153_C8", "vector": [8, 3, 0.9222, 0.006, 3, 0.11, 0.0, 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.head_client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L156_C8", "label": "if", "type": "if", "loc": [156, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L144_C4", "vector": [4, 2, 0.9431, 0.024, 2, 0.99, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.head_client.get_state() == GoalStatus.SUCCEEDED:\n return True\n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Return_L157_C12", "label": "return", "type": "return", "loc": [157, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L156_C8", "vector": [13, 3, 0.9401, 0.006, 3, 0.12, 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_99653:Return_L159_C12", "label": "return", "type": "return", "loc": [159, 159], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L156_C8", "vector": [13, 3, 0.9521, 0.006, 3, 0.12, 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_99653:If_L161_C0", "label": "if", "type": "if", "loc": [161, 163], "level": 0, "parent": null, "vector": [4, 0, 0.9701, 0.018, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n lab = LookAtBehavior('wide_stereo')\n lab.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L162_C4", "label": "lab = LookAtBehavior()", "type": "assigned_variable", "loc": [162, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L161_C0", "vector": [14, 1, 0.9701, 0.006, 1, 0.49, 0.0, 996, 3, 1, 0, 0, 744, 10, 1], "semantic": {"name": "lab", "arg_names": [], "import_names": [], "rhs_call_name": "LookAtBehavior", "annotation": ""}, "snippet": " lab = LookAtBehavior('wide_stereo')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L163_C4", "label": "run()", "type": "expression", "loc": [163, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L161_C0", "vector": [8, 1, 0.976, 0.006, 1, 0.49, 1.0, 679, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " lab.run()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Return_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Return_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L70_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Return_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L108_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Return_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L108_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Return_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Return_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L126_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L127_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L128_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L127_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L129_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L127_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L130_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:While_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:While_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:While_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L138_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L138_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L139_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L138_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L140_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L138_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L141_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L138_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L142_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L153_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L154_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L156_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Return_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L156_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Return_L159_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L161_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Assign_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99653:If_L161_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99653:Expr_L163_C4"}]
import roslib roslib.load_manifest('pr2_laser_follow_behavior') import rospy from geometry_msgs.msg import PointStamped from geometry_msgs.msg import PoseStamped import hrl_lib.tf_utils as tfu import tf class FollowPointBehavior: def __init__(self): rospy.Subscriber('cursor3dcentered', PointStamped, follow_point_cb) self.move_pub = rospy.Publisher('move_base_simple/goal', PoseStamped) self.tflistener = tf.TransformListener() def follow_point_cb(self, point_stamped): point_head = point_stamped.point base_T_head = tfu.transform('/base_link', point_stamped.header.frame_id, self.tflistener) point_mat_head = tfu.translation_matrix([point.x, point.y, point.z]) point_mat_base = base_T_head * point_mat_head t_base, o_base = tfu.matrix_as_tf(point_mat_base) x = t_base[0] y = t_base[1] angle = math.atan2(y, x) ps = PoseStamped() ps.header.frame_id = '/base_link' ps.pose.position.x = x ps.pose.position.y = y ps.pose.position.z = 0. q = tf.transformations.quaternion_from_euler(angle, 0, 0) ps.pose.orientation.x = q[0] ps.pose.orientation.y = q[1] ps.pose.orientation.z = q[2] ps.pose.orientation.w = q[3] self.move_pub.publish(ps) def run(self): r = rospy.Rate(10) while not rospy.is_shutdown(): r.sleep() if __name__ == '__main__': rospy.init_node('follow_point_node', anonymous=True) #Subscribes to laser point #sends point out to move_base_simple/goal #header: # seq: 0 # stamp: # secs: 1278624411 # nsecs: 326550373 # frame_id: /map #pose: # position: # x: 1.49216187 # y: -0.0629254132509 # z: 0.0 # orientation: # x: 0.0 # y: 0.0 # z: 0.127143523912 # w: 0.991884330115
ajibawa-2023/Python-Code-Large/train/row_99654
37
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_99654:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0152, 0.0152, 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_99654:Expr_L2_C0", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0303, 0.0152, 0, 0.66, 0.125, 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('pr2_laser_follow_behavior')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Import_L3_C0", "label": "rospy import rospy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0455, 0.0152, 0, 0.66, 0.25, 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_99654:ImportFrom_L4_C0", "label": "from geometry_msgs.msg import PointStamped", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0606, 0.0152, 0, 0.66, 0.375, 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_99654:ImportFrom_L5_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0758, 0.0152, 0, 0.66, 0.5, 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_99654:Import_L6_C0", "label": "hrl_lib.tf_utils import tfu", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0152, 0, 0.66, 0.625, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "hrl_lib.tf_utils", "arg_names": [], "import_names": ["tfu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.tf_utils as tfu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Import_L7_C0", "label": "tf import tf", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1061, 0.0152, 0, 0.66, 0.75, 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_99654:ClassDef_L9_C0", "label": "FollowPointBehavior", "type": "class", "loc": [9, 42], "level": 0, "parent": null, "vector": [3, 0, 0.3864, 0.5152, 0, 0.66, 0.875, 254, 0, 3, 0, 0, 0, 0, 12], "semantic": {"name": "FollowPointBehavior", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FollowPointBehavior:\n\n def __init__(self):\n rospy.Subscriber('cursor3dcentered', PointStamped, follow_point_cb)\n self.move_pub = rospy.Publisher('move_base_simple/goal', PoseStamped)\n\n def follow_point_cb(self, point_stamped):\n point_head = point_stamped.point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L11_C4", "label": "__init__", "type": "function", "loc": [11, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:ClassDef_L9_C0", "vector": [2, 1, 0.1818, 0.0455, 1, 0.33, 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 rospy.Subscriber('cursor3dcentered', PointStamped, follow_point_cb)\n self.move_pub = rospy.Publisher('move_base_simple/goal', PoseStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Expr_L12_C8", "label": "Subscriber()", "type": "expression", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L11_C4", "vector": [8, 2, 0.1818, 0.0152, 2, 0.32, 0.0, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('cursor3dcentered', PointStamped, follow_point_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L13_C8", "label": "self.move_pub = Publisher()", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L11_C4", "vector": [14, 2, 0.197, 0.0152, 2, 0.32, 1.0, 172, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.move_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.move_pub = rospy.Publisher('move_base_simple/goal', PoseStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "label": "follow_point_cb", "type": "function", "loc": [15, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:ClassDef_L9_C0", "vector": [2, 1, 0.3939, 0.3485, 1, 0.33, 0.5, 983, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "follow_point_cb", "arg_names": ["self", "point_stamped"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def follow_point_cb(self, point_stamped):\n point_head = point_stamped.point\n\n base_T_head = tfu.transform('/base_link', point_stamped.header.frame_id, self.tflistener)\n point_mat_head = tfu.translation_matrix([point.x, point.y, point.z])\n point_mat_base = base_T_head * point_mat_head\n t_base, o_base = tfu.matrix_as_tf(point_mat_base)\n x = t_base[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L16_C8", "label": "point_head =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "vector": [14, 2, 0.2424, 0.0152, 2, 0.22, 0.0, 553, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "point_head", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point_head = point_stamped.point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L18_C8", "label": "base_T_head = transform()", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "vector": [14, 2, 0.2727, 0.0152, 2, 0.22, 0.0556, 683, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "base_T_head", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " base_T_head = tfu.transform('/base_link', point_stamped.header.frame_id, self.tflistener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L19_C8", "label": "point_mat_head = translation_matrix()", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "vector": [14, 2, 0.2879, 0.0152, 2, 0.22, 0.1111, 237, 3, 1, 0, 0, 868, 10, 1], "semantic": {"name": "point_mat_head", "arg_names": [], "import_names": [], "rhs_call_name": "translation_matrix", "annotation": ""}, "snippet": " point_mat_head = tfu.translation_matrix([point.x, point.y, point.z])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L20_C8", "label": "point_mat_base =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "vector": [14, 2, 0.303, 0.0152, 2, 0.22, 0.1667, 970, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "point_mat_base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point_mat_base = base_T_head * point_mat_head"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L21_C8", "label": "t_base, o_base = matrix_as_tf()", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "vector": [14, 2, 0.3182, 0.0152, 2, 0.22, 0.2222, 359, 3, 1, 0, 0, 22, 10, 1], "semantic": {"name": "t_base, o_base", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_as_tf", "annotation": ""}, "snippet": " t_base, o_base = tfu.matrix_as_tf(point_mat_base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L22_C8", "label": "x =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "vector": [14, 2, 0.3333, 0.0152, 2, 0.22, 0.2778, 190, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = t_base[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L23_C8", "label": "y =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "vector": [14, 2, 0.3485, 0.0152, 2, 0.22, 0.3333, 304, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = t_base[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L24_C8", "label": "angle = atan2()", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "vector": [14, 2, 0.3636, 0.0152, 2, 0.22, 0.3889, 418, 3, 2, 0, 0, 572, 10, 1], "semantic": {"name": "angle", "arg_names": [], "import_names": [], "rhs_call_name": "atan2", "annotation": ""}, "snippet": " angle = math.atan2(y, x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L26_C8", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "vector": [14, 2, 0.3939, 0.0152, 2, 0.22, 0.4444, 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_99654:Assign_L27_C8", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "vector": [14, 2, 0.4091, 0.0152, 2, 0.22, 0.5, 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 = '/base_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L28_C8", "label": "ps.pose.position.x =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "vector": [14, 2, 0.4242, 0.0152, 2, 0.22, 0.5556, 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_99654:Assign_L29_C8", "label": "ps.pose.position.y =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "vector": [14, 2, 0.4394, 0.0152, 2, 0.22, 0.6111, 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_99654:Assign_L30_C8", "label": "ps.pose.position.z =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "vector": [14, 2, 0.4545, 0.0152, 2, 0.22, 0.6667, 771, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "ps.pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.z = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L32_C8", "label": "q = quaternion_from_euler()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "vector": [14, 2, 0.4848, 0.0152, 2, 0.22, 0.7222, 516, 3, 3, 0, 0, 561, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_from_euler", "annotation": ""}, "snippet": " q = tf.transformations.quaternion_from_euler(angle, 0, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L33_C8", "label": "ps.pose.orientation.x =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "vector": [14, 2, 0.5, 0.0152, 2, 0.22, 0.7778, 628, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.x = q[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L34_C8", "label": "ps.pose.orientation.y =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "vector": [14, 2, 0.5152, 0.0152, 2, 0.22, 0.8333, 848, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.y = q[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L35_C8", "label": "ps.pose.orientation.z =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "vector": [14, 2, 0.5303, 0.0152, 2, 0.22, 0.8889, 126, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.z = q[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L36_C8", "label": "ps.pose.orientation.w =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "vector": [14, 2, 0.5455, 0.0152, 2, 0.22, 0.9444, 163, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.w = q[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Expr_L37_C8", "label": "publish()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "vector": [8, 2, 0.5606, 0.0152, 2, 0.22, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.move_pub.publish(ps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L39_C4", "label": "run", "type": "function", "loc": [39, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:ClassDef_L9_C0", "vector": [2, 1, 0.6136, 0.0606, 1, 0.33, 1.0, 679, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run(self):\n r = rospy.Rate(10)\n while not rospy.is_shutdown():\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L40_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L39_C4", "vector": [14, 2, 0.6061, 0.0152, 2, 0.96, 0.0, 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_99654:While_L41_C8", "label": "while", "type": "while", "loc": [41, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L39_C4", "vector": [5, 2, 0.6288, 0.0303, 2, 0.96, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Expr_L42_C12", "label": "sleep()", "type": "expression", "loc": [42, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:While_L41_C8", "vector": [8, 3, 0.6364, 0.0152, 3, 0.89, 0.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_99654:If_L44_C0", "label": "if", "type": "if", "loc": [44, 45], "level": 0, "parent": null, "vector": [4, 0, 0.6742, 0.0303, 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 rospy.init_node('follow_point_node', anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99654:Expr_L45_C4", "label": "init_node()", "type": "expression", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99654:If_L44_C0", "vector": [8, 1, 0.6818, 0.0152, 1, 0.69, 0.0, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('follow_point_node', anonymous=True)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99654:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Expr_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:While_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:While_L41_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Expr_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99654:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99654:Expr_L45_C4"}]
#! /usr/bin/python import roslib roslib.load_manifest('pr2_follow_laser_behavior') import rospy import actionlib from actionlib_msgs.msg import * from pr2_controllers_msgs.msg import * from geometry_msgs.msg import * rospy.init_node('move_the_head', anonymous=True) client = actionlib.SimpleActionClient( '/head_traj_controller/point_head_action', PointHeadAction) client.wait_for_server() g = PointHeadGoal() g.target.header.frame_id = 'base_link' #g.target.header.frame_id = 'wide_stereo_optical_frame' g.target.point.x = 1. g.target.point.y = 0 g.target.point.z = 1. g.min_duration = rospy.Duration(1.0) client.send_goal(g) client.wait_for_result() if client.get_state() == GoalStatus.SUCCEEDED: print "Succeeded" else: print "Failed"
ajibawa-2023/Python-Code-Large/train/row_99655
21
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_99655:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0312, 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_99655:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0938, 0.0312, 0, 0.66, 0.0556, 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('pr2_follow_laser_behavior')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99655:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1562, 0.0312, 0, 0.66, 0.1111, 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_99655:Import_L6_C0", "label": "actionlib import actionlib", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1875, 0.0312, 0, 0.66, 0.1667, 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_99655:ImportFrom_L7_C0", "label": "from actionlib_msgs.msg import *", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.2188, 0.0312, 0, 0.66, 0.2222, 245, 0, 1, 0, 0, 245, 0, 0], "semantic": {"name": "actionlib_msgs.msg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from actionlib_msgs.msg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99655:ImportFrom_L8_C0", "label": "from pr2_controllers_msgs.msg import *", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.0312, 0, 0.66, 0.2778, 457, 0, 1, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99655:ImportFrom_L9_C0", "label": "from geometry_msgs.msg import *", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.2812, 0.0312, 0, 0.66, 0.3333, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99655:Expr_L11_C0", "label": "init_node()", "type": "expression", "loc": [11, 11], "level": 0, "parent": null, "vector": [8, 0, 0.3438, 0.0312, 0, 0.66, 0.3889, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": "rospy.init_node('move_the_head', anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99655:Assign_L13_C0", "label": "client = SimpleActionClient()", "type": "assigned_variable", "loc": [13, 14], "level": 0, "parent": null, "vector": [14, 0, 0.4219, 0.0625, 0, 0.66, 0.4444, 608, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": "client = actionlib.SimpleActionClient(\n '/head_traj_controller/point_head_action', PointHeadAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99655:Expr_L15_C0", "label": "wait_for_server()", "type": "expression", "loc": [15, 15], "level": 0, "parent": null, "vector": [8, 0, 0.4688, 0.0312, 0, 0.66, 0.5, 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_99655:Assign_L17_C0", "label": "g = PointHeadGoal()", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.5312, 0.0312, 0, 0.66, 0.5556, 384, 3, 0, 0, 0, 479, 10, 1], "semantic": {"name": "g", "arg_names": [], "import_names": [], "rhs_call_name": "PointHeadGoal", "annotation": ""}, "snippet": "g = PointHeadGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99655:Assign_L18_C0", "label": "g.target.header.frame_id =", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.5625, 0.0312, 0, 0.66, 0.6111, 758, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "g.target.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "g.target.header.frame_id = 'base_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99655:Assign_L20_C0", "label": "g.target.point.x =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.625, 0.0312, 0, 0.66, 0.6667, 493, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "g.target.point.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "g.target.point.x = 1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99655:Assign_L21_C0", "label": "g.target.point.y =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.6562, 0.0312, 0, 0.66, 0.7222, 219, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "g.target.point.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "g.target.point.y = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99655:Assign_L22_C0", "label": "g.target.point.z =", "type": "assigned_variable", "loc": [22, 22], "level": 0, "parent": null, "vector": [14, 0, 0.6875, 0.0312, 0, 0.66, 0.7778, 906, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "g.target.point.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "g.target.point.z = 1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99655:Assign_L23_C0", "label": "g.min_duration = Duration()", "type": "assigned_variable", "loc": [23, 23], "level": 0, "parent": null, "vector": [14, 0, 0.7188, 0.0312, 0, 0.66, 0.8333, 705, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "g.min_duration", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": "g.min_duration = rospy.Duration(1.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99655:Expr_L25_C0", "label": "send_goal()", "type": "expression", "loc": [25, 25], "level": 0, "parent": null, "vector": [8, 0, 0.7812, 0.0312, 0, 0.66, 0.8889, 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(g)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99655:Expr_L26_C0", "label": "wait_for_result()", "type": "expression", "loc": [26, 26], "level": 0, "parent": null, "vector": [8, 0, 0.8125, 0.0312, 0, 0.66, 0.9444, 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_99655:If_L28_C0", "label": "if", "type": "if", "loc": [28, 31], "level": 0, "parent": null, "vector": [4, 0, 0.9219, 0.125, 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 client.get_state() == GoalStatus.SUCCEEDED:\n print(\"Succeeded\")\nelse:\n print(\"Failed\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99655:Expr_L29_C4", "label": "print()", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99655:If_L28_C0", "vector": [8, 1, 0.9062, 0.0312, 1, 0.07, 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_99655:Expr_L31_C4", "label": "print()", "type": "expression", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99655:If_L28_C0", "vector": [8, 1, 0.9688, 0.0312, 1, 0.07, 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\")"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99655:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99655:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99655:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99655:Expr_L31_C4"}]
#!/usr/bin/python import roslib roslib.load_manifest("pr2_laser_follow_behavior") import rospy import numpy as np import math from actionlib_msgs.msg import * from pr2_controllers_msgs.msg import * from geometry_msgs.msg import * from std_msgs.msg import String from move_base_msgs.msg import * import actionlib import tf import laser_interface.camera as cam import hrl_lib.tf_utils as tfu from threading import RLock def in_bounds(p2d, xlim, ylim): return (xlim[0] <= p2d[0,0]) and (p2d[0,0] <= xlim[1]) \ and (ylim[0] <= p2d[1,0]) and (p2d[1,0] <= ylim[1]) class LookAtBehavior: def __init__(self, camera_root_topic): self.state = 'turn' self.move_state = None self.laser_point_base = None self.message = None self.double_click = None self.seq = 0 rospy.init_node('look_at_point_behavior', anonymous=True) rospy.Subscriber('cursor3d', PointStamped, self.laser_point_handler) self.double_click = rospy.Subscriber('mouse_left_double_click', String, self.double_click_cb) self.camera_model = cam.ROSStereoCalibration('/' + camera_root_topic + '/left/camera_info' , '/' + camera_root_topic + '/right/camera_info') self.head_client = actionlib.SimpleActionClient('head_traj_controller/point_head_action', PointHeadAction) self.base_client = actionlib.SimpleActionClient('move_base', MoveBaseAction) self.move_pub = rospy.Publisher('look_at_point_goal', PoseStamped) self.tflistener = tf.TransformListener() rospy.loginfo( 'Running') def double_click_cb(self, a_str): rospy.loginfo('Double CLICKED') self.double_click = True def laser_point_handler(self, point_stamped): if self.state == 'turn': self.laser_point_base = self.transform_point(point_stamped) self.message = point_stamped def transform_point(self, point_stamped): point_head = point_stamped.point #Tranform into base link target_link = '/base_link' base_T_head = tfu.transform(target_link, point_stamped.header.frame_id, self.tflistener) point_mat_head = tfu.translation_matrix([point_head.x, point_head.y, point_head.z]) point_mat_base = base_T_head * point_mat_head t_base, o_base = tfu.matrix_as_tf(point_mat_base) #Calculate angle robot should face angle = math.atan2(t_base[1], t_base[0]) q_base = tf.transformations.quaternion_from_euler(0, 0, angle) return (t_base, q_base, target_link) def move_base(self, point, wait=True): t_base, q, target_link = point ps = PoseStamped() ps.header.frame_id = target_link ps.pose.position = geometry_msgs.msg.Point(t_base[0], t_base[1], 0) ps.pose.orientation = geometry_msgs.msg.Quaternion(*q) self.move_pub.publish(ps) #Uncomment to actually move goal = MoveBaseGoal() goal.target_pose.header.frame_id = target_link goal.target_pose.pose.position = geometry_msgs.msg.Point(t_base[0], t_base[1], 0) goal.target_pose.pose.orientation = geometry_msgs.msg.Quaternion(*q) self.base_client.send_goal(goal) if wait: self.base_client.wait_for_result() if self.base_client.get_state() == GoalStatus.SUCCEEDED: return True else: return False def look_at(self, message, wait=True): g = PointHeadGoal() g.target.header.frame_id = message[2] g.target.point = geometry_msgs.msg.Point(*message[0]) g.min_duration = rospy.Duration(1.0) g.max_velocity = 10. self.head_client.send_goal(g) if wait: self.head_client.wait_for_result(rospy.Duration(1.)) if self.head_client.get_state() == GoalStatus.SUCCEEDED: return True else: return False def run(self): r = rospy.Rate(100) timeout_time = None self.double_click = None while not rospy.is_shutdown(): if self.state == 'turn': if self.laser_point_base is not None: if self.double_click is None: if self.message.header.seq != self.seq: self.seq = self.message.header.seq point_stamped = self.message p = np.matrix([point_stamped.point.x, point_stamped.point.y, point_stamped.point.z, 1.]).T p2d = self.camera_model.left.P * p p2d = p2d / p2d[2,0] bx = ((self.camera_model.left.w/2.) * .9) by = ((self.camera_model.left.h/2.) * .9) xlim = [bx, self.camera_model.left.w - bx] ylim = [by, self.camera_model.left.h - by] if not in_bounds(p2d, xlim, ylim): rospy.loginfo('\'turn\': Looking at laser point msg #: ' + str(self.message.header.seq)) self.look_at(self.laser_point_base, True) else: rospy.loginfo('\'turn\': double clicked. Transitioning to \'move\'.') self.state = 'move' self.move_state = 'send_cmd' self.double_click = None elif self.state == 'move': if self.move_state == 'send_cmd': if self.laser_point_base is not None: rospy.loginfo('\'move\': Sending move command.') self.move_base(self.laser_point_base, False) self.move_state = 'check_status' self.laser_point_base = None self.message = None else: raise RuntimeError('laser_point_base is none!') elif self.move_state == 'check_status': if self.double_click is not None: rospy.loginfo('\'move\': Canceling goal. Transitioning back to \'turn\'.') self.base_client.cancel_goal() self.state = 'turn' self.move_state = None self.double_click = None else: if self.base_client.get_state() == GoalStatus.SUCCEEDED or \ self.base_client.simple_state == actionlib.SimpleGoalState.DONE: rospy.loginfo('\'move\': Reached goal. Transitioning to \'turn\'.') self.state = 'turn' self.move_state = None self.double_click = None #only if we exceed our wait oime #else: # return False??? else: raise RuntimeError('invalid state for self.move_state') else: raise RuntimeError('invalid state for self.state') r.sleep() if __name__ == '__main__': lab = LookAtBehavior('wide_stereo') lab.run()
ajibawa-2023/Python-Code-Large/train/row_99656
129
177
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0113, 0.0056, 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_99656:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0169, 0.0056, 0, 0.66, 0.0588, 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(\"pr2_laser_follow_behavior\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0226, 0.0056, 0, 0.66, 0.1176, 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_99656:Import_L6_C0", "label": "numpy import np", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0339, 0.0056, 0, 0.66, 0.1765, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Import_L7_C0", "label": "math import math", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0395, 0.0056, 0, 0.66, 0.2353, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:ImportFrom_L9_C0", "label": "from actionlib_msgs.msg import *", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0508, 0.0056, 0, 0.66, 0.2941, 245, 0, 1, 0, 0, 245, 0, 0], "semantic": {"name": "actionlib_msgs.msg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from actionlib_msgs.msg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:ImportFrom_L10_C0", "label": "from pr2_controllers_msgs.msg import *", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0565, 0.0056, 0, 0.66, 0.3529, 457, 0, 1, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:ImportFrom_L11_C0", "label": "from geometry_msgs.msg import *", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0621, 0.0056, 0, 0.66, 0.4118, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:ImportFrom_L12_C0", "label": "from std_msgs.msg import String", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0678, 0.0056, 0, 0.66, 0.4706, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["String"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import String"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:ImportFrom_L13_C0", "label": "from move_base_msgs.msg import *", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0734, 0.0056, 0, 0.66, 0.5294, 440, 0, 1, 0, 0, 440, 0, 0], "semantic": {"name": "move_base_msgs.msg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_base_msgs.msg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Import_L15_C0", "label": "actionlib import actionlib", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0847, 0.0056, 0, 0.66, 0.5882, 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_99656:Import_L16_C0", "label": "tf import tf", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0904, 0.0056, 0, 0.66, 0.6471, 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_99656:Import_L17_C0", "label": "laser_interface.camera import cam", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.096, 0.0056, 0, 0.66, 0.7059, 875, 0, 1, 0, 0, 875, 0, 0], "semantic": {"name": "laser_interface.camera", "arg_names": [], "import_names": ["cam"], "rhs_call_name": "", "annotation": ""}, "snippet": "import laser_interface.camera as cam"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Import_L18_C0", "label": "hrl_lib.tf_utils import tfu", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1017, 0.0056, 0, 0.66, 0.7647, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "hrl_lib.tf_utils", "arg_names": [], "import_names": ["tfu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.tf_utils as tfu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:ImportFrom_L19_C0", "label": "from threading import RLock", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.1073, 0.0056, 0, 0.66, 0.8235, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["RLock"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import RLock"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L22_C0", "label": "in_bounds", "type": "function", "loc": [22, 24], "level": 0, "parent": null, "vector": [2, 0, 0.1299, 0.0169, 0, 0.66, 0.8824, 510, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "in_bounds", "arg_names": ["p2d", "xlim", "ylim"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def in_bounds(p2d, xlim, ylim):\n return (xlim[0] <= p2d[0,0]) and (p2d[0,0] <= xlim[1]) \\\n and (ylim[0] <= p2d[1,0]) and (p2d[1,0] <= ylim[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Return_L23_C4", "label": "return", "type": "return", "loc": [23, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L22_C0", "vector": [13, 1, 0.1328, 0.0113, 1, 0.49, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (xlim[0] <= p2d[0,0]) and (p2d[0,0] <= xlim[1]) \\\n and (ylim[0] <= p2d[1,0]) and (p2d[1,0] <= ylim[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:ClassDef_L26_C0", "label": "LookAtBehavior", "type": "class", "loc": [26, 169], "level": 0, "parent": null, "vector": [3, 0, 0.5508, 0.8136, 0, 0.66, 0.9412, 744, 0, 7, 0, 0, 0, 0, 51], "semantic": {"name": "LookAtBehavior", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class LookAtBehavior:\n\n def __init__(self, camera_root_topic):\n self.state = 'turn'\n self.move_state = None\n self.laser_point_base = None\n self.message = None\n self.double_click = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "label": "__init__", "type": "function", "loc": [28, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:ClassDef_L26_C0", "vector": [2, 1, 0.2062, 0.1017, 1, 0.38, 0.0, 555, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "__init__", "arg_names": ["self", "camera_root_topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, camera_root_topic):\n self.state = 'turn'\n self.move_state = None\n self.laser_point_base = None\n self.message = None\n self.double_click = None\n self.seq = 0\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L29_C8", "label": "self.state =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "vector": [14, 2, 0.1638, 0.0056, 2, 0.84, 0.0, 765, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.state = 'turn'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L30_C8", "label": "self.move_state =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "vector": [14, 2, 0.1695, 0.0056, 2, 0.84, 0.0714, 369, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.move_state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.move_state = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L31_C8", "label": "self.laser_point_base =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "vector": [14, 2, 0.1751, 0.0056, 2, 0.84, 0.1429, 406, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.laser_point_base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.laser_point_base = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L32_C8", "label": "self.message =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "vector": [14, 2, 0.1808, 0.0056, 2, 0.84, 0.2143, 709, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.message = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L33_C8", "label": "self.double_click =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "vector": [14, 2, 0.1864, 0.0056, 2, 0.84, 0.2857, 256, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.double_click", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.double_click = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L34_C8", "label": "self.seq =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "vector": [14, 2, 0.1921, 0.0056, 2, 0.84, 0.3571, 635, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.seq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.seq = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L36_C8", "label": "init_node()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "vector": [8, 2, 0.2034, 0.0056, 2, 0.84, 0.4286, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('look_at_point_behavior', anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L37_C8", "label": "Subscriber()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "vector": [8, 2, 0.209, 0.0056, 2, 0.84, 0.5, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('cursor3d', PointStamped, self.laser_point_handler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L38_C8", "label": "self.double_click = Subscriber()", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "vector": [14, 2, 0.2147, 0.0056, 2, 0.84, 0.5714, 256, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "self.double_click", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " self.double_click = rospy.Subscriber('mouse_left_double_click', String, self.double_click_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L39_C8", "label": "self.camera_model = ROSStereoCalibration()", "type": "assigned_variable", "loc": [39, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "vector": [14, 2, 0.2232, 0.0113, 2, 0.84, 0.6429, 956, 3, 2, 0, 0, 61, 10, 1], "semantic": {"name": "self.camera_model", "arg_names": [], "import_names": [], "rhs_call_name": "ROSStereoCalibration", "annotation": ""}, "snippet": " self.camera_model = cam.ROSStereoCalibration('/' + camera_root_topic + '/left/camera_info' , \n '/' + camera_root_topic + '/right/camera_info')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L41_C8", "label": "self.head_client = SimpleActionClient()", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "vector": [14, 2, 0.2316, 0.0056, 2, 0.84, 0.7143, 456, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.head_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.head_client = actionlib.SimpleActionClient('head_traj_controller/point_head_action', PointHeadAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L42_C8", "label": "self.base_client = SimpleActionClient()", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "vector": [14, 2, 0.2373, 0.0056, 2, 0.84, 0.7857, 41, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.base_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.base_client = actionlib.SimpleActionClient('move_base', MoveBaseAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L43_C8", "label": "self.move_pub = Publisher()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "vector": [14, 2, 0.2429, 0.0056, 2, 0.84, 0.8571, 172, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.move_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.move_pub = rospy.Publisher('look_at_point_goal', PoseStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L44_C8", "label": "self.tflistener = TransformListener()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "vector": [14, 2, 0.2486, 0.0056, 2, 0.84, 0.9286, 50, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tflistener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.tflistener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L45_C8", "label": "loginfo()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "vector": [8, 2, 0.2542, 0.0056, 2, 0.84, 1.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'Running')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L47_C4", "label": "double_click_cb", "type": "function", "loc": [47, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:ClassDef_L26_C0", "vector": [2, 1, 0.2712, 0.0169, 1, 0.38, 0.1667, 645, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "double_click_cb", "arg_names": ["self", "a_str"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def double_click_cb(self, a_str):\n rospy.loginfo('Double CLICKED')\n self.double_click = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L48_C8", "label": "loginfo()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L47_C4", "vector": [8, 2, 0.2712, 0.0056, 2, 0.95, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Double CLICKED')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L49_C8", "label": "self.double_click =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L47_C4", "vector": [14, 2, 0.2768, 0.0056, 2, 0.95, 1.0, 256, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.double_click", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.double_click = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L51_C4", "label": "laser_point_handler", "type": "function", "loc": [51, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:ClassDef_L26_C0", "vector": [2, 1, 0.2966, 0.0226, 1, 0.38, 0.3333, 910, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "laser_point_handler", "arg_names": ["self", "point_stamped"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def laser_point_handler(self, point_stamped):\n if self.state == 'turn':\n self.laser_point_base = self.transform_point(point_stamped)\n self.message = point_stamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L52_C8", "label": "if", "type": "if", "loc": [52, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L51_C4", "vector": [4, 2, 0.2994, 0.0169, 2, 0.38, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.state == 'turn':\n self.laser_point_base = self.transform_point(point_stamped)\n self.message = point_stamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L53_C12", "label": "self.laser_point_base = transform_point()", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L52_C8", "vector": [14, 3, 0.2994, 0.0056, 3, 0.94, 0.0, 406, 3, 1, 0, 0, 911, 10, 1], "semantic": {"name": "self.laser_point_base", "arg_names": [], "import_names": [], "rhs_call_name": "transform_point", "annotation": ""}, "snippet": " self.laser_point_base = self.transform_point(point_stamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L54_C12", "label": "self.message =", "type": "assigned_variable", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L52_C8", "vector": [14, 3, 0.3051, 0.0056, 3, 0.94, 1.0, 709, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.message = point_stamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L56_C4", "label": "transform_point", "type": "function", "loc": [56, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:ClassDef_L26_C0", "vector": [2, 1, 0.3531, 0.0791, 1, 0.38, 0.5, 911, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "transform_point", "arg_names": ["self", "point_stamped"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def transform_point(self, point_stamped):\n point_head = point_stamped.point\n\n #Tranform into base link\n target_link = '/base_link'\n base_T_head = tfu.transform(target_link, point_stamped.header.frame_id, self.tflistener)\n point_mat_head = tfu.translation_matrix([point_head.x, point_head.y, point_head.z])\n point_mat_base = base_T_head * point_mat_head"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L57_C8", "label": "point_head =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L56_C4", "vector": [14, 2, 0.322, 0.0056, 2, 0.01, 0.0, 553, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "point_head", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point_head = point_stamped.point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L60_C8", "label": "target_link =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L56_C4", "vector": [14, 2, 0.339, 0.0056, 2, 0.01, 0.125, 314, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "target_link", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " target_link = '/base_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L61_C8", "label": "base_T_head = transform()", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L56_C4", "vector": [14, 2, 0.3446, 0.0056, 2, 0.01, 0.25, 683, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "base_T_head", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " base_T_head = tfu.transform(target_link, point_stamped.header.frame_id, self.tflistener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L62_C8", "label": "point_mat_head = translation_matrix()", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L56_C4", "vector": [14, 2, 0.3503, 0.0056, 2, 0.01, 0.375, 237, 3, 1, 0, 0, 868, 10, 1], "semantic": {"name": "point_mat_head", "arg_names": [], "import_names": [], "rhs_call_name": "translation_matrix", "annotation": ""}, "snippet": " point_mat_head = tfu.translation_matrix([point_head.x, point_head.y, point_head.z])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L63_C8", "label": "point_mat_base =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L56_C4", "vector": [14, 2, 0.3559, 0.0056, 2, 0.01, 0.5, 970, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "point_mat_base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point_mat_base = base_T_head * point_mat_head"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L64_C8", "label": "t_base, o_base = matrix_as_tf()", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L56_C4", "vector": [14, 2, 0.3616, 0.0056, 2, 0.01, 0.625, 359, 3, 1, 0, 0, 22, 10, 1], "semantic": {"name": "t_base, o_base", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_as_tf", "annotation": ""}, "snippet": " t_base, o_base = tfu.matrix_as_tf(point_mat_base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L67_C8", "label": "angle = atan2()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L56_C4", "vector": [14, 2, 0.3785, 0.0056, 2, 0.01, 0.75, 418, 3, 2, 0, 0, 572, 10, 1], "semantic": {"name": "angle", "arg_names": [], "import_names": [], "rhs_call_name": "atan2", "annotation": ""}, "snippet": " angle = math.atan2(t_base[1], t_base[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L68_C8", "label": "q_base = quaternion_from_euler()", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L56_C4", "vector": [14, 2, 0.3842, 0.0056, 2, 0.01, 0.875, 393, 3, 3, 0, 0, 561, 10, 1], "semantic": {"name": "q_base", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_from_euler", "annotation": ""}, "snippet": " q_base = tf.transformations.quaternion_from_euler(0, 0, angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Return_L69_C8", "label": "return", "type": "return", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L56_C4", "vector": [13, 2, 0.3898, 0.0056, 2, 0.01, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (t_base, q_base, target_link)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "label": "move_base", "type": "function", "loc": [71, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:ClassDef_L26_C0", "vector": [2, 1, 0.4548, 0.113, 1, 0.38, 0.6667, 55, 0, 3, 1, 0, 0, 0, 10], "semantic": {"name": "move_base", "arg_names": ["self", "point", "wait"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_base(self, point, wait=True):\n t_base, q, target_link = point\n ps = PoseStamped()\n ps.header.frame_id = target_link\n ps.pose.position = geometry_msgs.msg.Point(t_base[0], t_base[1], 0)\n ps.pose.orientation = geometry_msgs.msg.Quaternion(*q)\n self.move_pub.publish(ps)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L72_C8", "label": "t_base, q, target_link =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "vector": [14, 2, 0.4068, 0.0056, 2, 0.74, 0.0, 483, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t_base, q, target_link", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t_base, q, target_link = point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L73_C8", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "vector": [14, 2, 0.4124, 0.0056, 2, 0.74, 0.0833, 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_99656:Assign_L74_C8", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "vector": [14, 2, 0.4181, 0.0056, 2, 0.74, 0.1667, 293, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.header.frame_id = target_link"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L75_C8", "label": "ps.pose.position = Point()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "vector": [14, 2, 0.4237, 0.0056, 2, 0.74, 0.25, 530, 3, 3, 0, 0, 652, 10, 1], "semantic": {"name": "ps.pose.position", "arg_names": [], "import_names": [], "rhs_call_name": "Point", "annotation": ""}, "snippet": " ps.pose.position = geometry_msgs.msg.Point(t_base[0], t_base[1], 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L76_C8", "label": "ps.pose.orientation = Quaternion()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "vector": [14, 2, 0.4294, 0.0056, 2, 0.74, 0.3333, 670, 3, 1, 0, 0, 747, 10, 1], "semantic": {"name": "ps.pose.orientation", "arg_names": [], "import_names": [], "rhs_call_name": "Quaternion", "annotation": ""}, "snippet": " ps.pose.orientation = geometry_msgs.msg.Quaternion(*q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L77_C8", "label": "publish()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "vector": [8, 2, 0.435, 0.0056, 2, 0.74, 0.4167, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.move_pub.publish(ps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L80_C8", "label": "goal = MoveBaseGoal()", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "vector": [14, 2, 0.452, 0.0056, 2, 0.74, 0.5, 914, 3, 0, 0, 0, 968, 10, 1], "semantic": {"name": "goal", "arg_names": [], "import_names": [], "rhs_call_name": "MoveBaseGoal", "annotation": ""}, "snippet": " goal = MoveBaseGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L81_C8", "label": "goal.target_pose.header.frame_id =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "vector": [14, 2, 0.4576, 0.0056, 2, 0.74, 0.5833, 138, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.target_pose.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.target_pose.header.frame_id = target_link"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L82_C8", "label": "goal.target_pose.pose.position = Point()", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "vector": [14, 2, 0.4633, 0.0056, 2, 0.74, 0.6667, 639, 3, 3, 0, 0, 652, 10, 1], "semantic": {"name": "goal.target_pose.pose.position", "arg_names": [], "import_names": [], "rhs_call_name": "Point", "annotation": ""}, "snippet": " goal.target_pose.pose.position = geometry_msgs.msg.Point(t_base[0], t_base[1], 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L83_C8", "label": "goal.target_pose.pose.orientation = Quaternion()", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "vector": [14, 2, 0.4689, 0.0056, 2, 0.74, 0.75, 655, 3, 1, 0, 0, 747, 10, 1], "semantic": {"name": "goal.target_pose.pose.orientation", "arg_names": [], "import_names": [], "rhs_call_name": "Quaternion", "annotation": ""}, "snippet": " goal.target_pose.pose.orientation = geometry_msgs.msg.Quaternion(*q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L84_C8", "label": "send_goal()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "vector": [8, 2, 0.4746, 0.0056, 2, 0.74, 0.8333, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.base_client.send_goal(goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L85_C8", "label": "if", "type": "if", "loc": [85, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "vector": [4, 2, 0.4831, 0.0113, 2, 0.74, 0.9167, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if wait:\n self.base_client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L86_C12", "label": "wait_for_result()", "type": "expression", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L85_C8", "vector": [8, 3, 0.4859, 0.0056, 3, 0.15, 0.0, 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.base_client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L87_C8", "label": "if", "type": "if", "loc": [87, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "vector": [4, 2, 0.5, 0.0226, 2, 0.74, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.base_client.get_state() == GoalStatus.SUCCEEDED:\n return True\n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Return_L88_C12", "label": "return", "type": "return", "loc": [88, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L87_C8", "vector": [13, 3, 0.4972, 0.0056, 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 True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Return_L90_C12", "label": "return", "type": "return", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L87_C8", "vector": [13, 3, 0.5085, 0.0056, 3, 0.51, 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_99656:FunctionDef_L92_C4", "label": "look_at", "type": "function", "loc": [92, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:ClassDef_L26_C0", "vector": [2, 1, 0.5565, 0.0791, 1, 0.38, 0.8333, 695, 0, 3, 1, 0, 0, 0, 7], "semantic": {"name": "look_at", "arg_names": ["self", "message", "wait"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def look_at(self, message, wait=True):\n g = PointHeadGoal()\n g.target.header.frame_id = message[2]\n g.target.point = geometry_msgs.msg.Point(*message[0])\n g.min_duration = rospy.Duration(1.0)\n g.max_velocity = 10.\n\n self.head_client.send_goal(g)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L93_C8", "label": "g = PointHeadGoal()", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L92_C4", "vector": [14, 2, 0.5254, 0.0056, 2, 0.73, 0.0, 384, 3, 0, 0, 0, 479, 10, 1], "semantic": {"name": "g", "arg_names": [], "import_names": [], "rhs_call_name": "PointHeadGoal", "annotation": ""}, "snippet": " g = PointHeadGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L94_C8", "label": "g.target.header.frame_id =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L92_C4", "vector": [14, 2, 0.5311, 0.0056, 2, 0.73, 0.1429, 758, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "g.target.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " g.target.header.frame_id = message[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L95_C8", "label": "g.target.point = Point()", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L92_C4", "vector": [14, 2, 0.5367, 0.0056, 2, 0.73, 0.2857, 423, 3, 1, 0, 0, 652, 10, 1], "semantic": {"name": "g.target.point", "arg_names": [], "import_names": [], "rhs_call_name": "Point", "annotation": ""}, "snippet": " g.target.point = geometry_msgs.msg.Point(*message[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L96_C8", "label": "g.min_duration = Duration()", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L92_C4", "vector": [14, 2, 0.5424, 0.0056, 2, 0.73, 0.4286, 705, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "g.min_duration", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " g.min_duration = rospy.Duration(1.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L97_C8", "label": "g.max_velocity =", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L92_C4", "vector": [14, 2, 0.548, 0.0056, 2, 0.73, 0.5714, 818, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "g.max_velocity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " g.max_velocity = 10."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L99_C8", "label": "send_goal()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L92_C4", "vector": [8, 2, 0.5593, 0.0056, 2, 0.73, 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": " self.head_client.send_goal(g)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L100_C8", "label": "if", "type": "if", "loc": [100, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L92_C4", "vector": [4, 2, 0.5678, 0.0113, 2, 0.73, 0.8571, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if wait:\n self.head_client.wait_for_result(rospy.Duration(1.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L101_C12", "label": "wait_for_result()", "type": "expression", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L100_C8", "vector": [8, 3, 0.5706, 0.0056, 3, 0.45, 0.0, 328, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "wait_for_result", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_result", "annotation": ""}, "snippet": " self.head_client.wait_for_result(rospy.Duration(1.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L102_C8", "label": "if", "type": "if", "loc": [102, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L92_C4", "vector": [4, 2, 0.5847, 0.0226, 2, 0.73, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.head_client.get_state() == GoalStatus.SUCCEEDED:\n return True\n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Return_L103_C12", "label": "return", "type": "return", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L102_C8", "vector": [13, 3, 0.5819, 0.0056, 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 True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Return_L105_C12", "label": "return", "type": "return", "loc": [105, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L102_C8", "vector": [13, 3, 0.5932, 0.0056, 3, 0.13, 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_99656:FunctionDef_L107_C4", "label": "run", "type": "function", "loc": [107, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:ClassDef_L26_C0", "vector": [2, 1, 0.7797, 0.3559, 1, 0.38, 1.0, 679, 0, 1, 0, 0, 0, 0, 18], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run(self):\n r = rospy.Rate(100)\n timeout_time = None\n self.double_click = None\n\n while not rospy.is_shutdown():\n if self.state == 'turn':\n if self.laser_point_base is not None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L108_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L107_C4", "vector": [14, 2, 0.6102, 0.0056, 2, 0.41, 0.0, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " r = rospy.Rate(100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L109_C8", "label": "timeout_time =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L107_C4", "vector": [14, 2, 0.6158, 0.0056, 2, 0.41, 0.3333, 764, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "timeout_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " timeout_time = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L110_C8", "label": "self.double_click =", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L107_C4", "vector": [14, 2, 0.6215, 0.0056, 2, 0.41, 0.6667, 256, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.double_click", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.double_click = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:While_L112_C8", "label": "while", "type": "while", "loc": [112, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L107_C4", "vector": [5, 2, 0.7938, 0.3277, 2, 0.41, 1.0, 0, 0, 0, 0, 0, 0, 0, 17], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n if self.state == 'turn':\n if self.laser_point_base is not None:\n if self.double_click is None:\n if self.message.header.seq != self.seq:\n self.seq = self.message.header.seq\n point_stamped = self.message\n p = np.matrix([point_stamped.point.x, point_stamped.point.y, point_stamped.point.z, 1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L113_C12", "label": "if", "type": "if", "loc": [113, 167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:While_L112_C8", "vector": [4, 3, 0.791, 0.3107, 3, 0.76, 0.0, 0, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.state == 'turn':\n if self.laser_point_base is not None:\n if self.double_click is None:\n if self.message.header.seq != self.seq:\n self.seq = self.message.header.seq\n point_stamped = self.message\n p = np.matrix([point_stamped.point.x, point_stamped.point.y, point_stamped.point.z, 1.]).T\n p2d = self.camera_model.left.P * p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L114_C16", "label": "if", "type": "if", "loc": [114, 133], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L113_C12", "vector": [4, 4, 0.6977, 0.113, 4, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.laser_point_base is not None:\n if self.double_click is None:\n if self.message.header.seq != self.seq:\n self.seq = self.message.header.seq\n point_stamped = self.message\n p = np.matrix([point_stamped.point.x, point_stamped.point.y, point_stamped.point.z, 1.]).T\n p2d = self.camera_model.left.P * p\n p2d = p2d / p2d[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L115_C20", "label": "if", "type": "if", "loc": [115, 133], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L114_C16", "vector": [4, 5, 0.7006, 0.1073, 5, 0.04, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.double_click is None:\n if self.message.header.seq != self.seq:\n self.seq = self.message.header.seq\n point_stamped = self.message\n p = np.matrix([point_stamped.point.x, point_stamped.point.y, point_stamped.point.z, 1.]).T\n p2d = self.camera_model.left.P * p\n p2d = p2d / p2d[2,0]\n bx = ((self.camera_model.left.w/2.) * .9)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24", "label": "if", "type": "if", "loc": [116, 128], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L115_C20", "vector": [4, 6, 0.6893, 0.0734, 6, 0.16, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.message.header.seq != self.seq:\n self.seq = self.message.header.seq\n point_stamped = self.message\n p = np.matrix([point_stamped.point.x, point_stamped.point.y, point_stamped.point.z, 1.]).T\n p2d = self.camera_model.left.P * p\n p2d = p2d / p2d[2,0]\n bx = ((self.camera_model.left.w/2.) * .9)\n by = ((self.camera_model.left.h/2.) * .9)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L117_C28", "label": "self.seq =", "type": "assigned_variable", "loc": [117, 117], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24", "vector": [14, 7, 0.661, 0.0056, 7, 0.99, 0.0, 635, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.seq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.seq = self.message.header.seq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L118_C28", "label": "point_stamped =", "type": "assigned_variable", "loc": [118, 118], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24", "vector": [14, 7, 0.6667, 0.0056, 7, 0.99, 0.1111, 336, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "point_stamped", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point_stamped = self.message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L119_C28", "label": "p =", "type": "assigned_variable", "loc": [119, 119], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24", "vector": [14, 7, 0.6723, 0.0056, 7, 0.99, 0.2222, 491, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = np.matrix([point_stamped.point.x, point_stamped.point.y, point_stamped.point.z, 1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L120_C28", "label": "p2d =", "type": "assigned_variable", "loc": [120, 120], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24", "vector": [14, 7, 0.678, 0.0056, 7, 0.99, 0.3333, 716, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p2d = self.camera_model.left.P * p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L121_C28", "label": "p2d =", "type": "assigned_variable", "loc": [121, 121], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24", "vector": [14, 7, 0.6836, 0.0056, 7, 0.99, 0.4444, 716, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p2d = p2d / p2d[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L122_C28", "label": "bx =", "type": "assigned_variable", "loc": [122, 122], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24", "vector": [14, 7, 0.6893, 0.0056, 7, 0.99, 0.5556, 477, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "bx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bx = ((self.camera_model.left.w/2.) * .9)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L123_C28", "label": "by =", "type": "assigned_variable", "loc": [123, 123], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24", "vector": [14, 7, 0.6949, 0.0056, 7, 0.99, 0.6667, 140, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "by", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " by = ((self.camera_model.left.h/2.) * .9)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L124_C28", "label": "xlim =", "type": "assigned_variable", "loc": [124, 124], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24", "vector": [14, 7, 0.7006, 0.0056, 7, 0.99, 0.7778, 907, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xlim = [bx, self.camera_model.left.w - bx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L125_C28", "label": "ylim =", "type": "assigned_variable", "loc": [125, 125], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24", "vector": [14, 7, 0.7062, 0.0056, 7, 0.99, 0.8889, 247, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ylim", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ylim = [by, self.camera_model.left.h - by]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L126_C28", "label": "if", "type": "if", "loc": [126, 128], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24", "vector": [4, 7, 0.7175, 0.0169, 7, 0.99, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not in_bounds(p2d, xlim, ylim):\n rospy.loginfo('\\'turn\\': Looking at laser point msg #: ' + str(self.message.header.seq))\n self.look_at(self.laser_point_base, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L127_C32", "label": "loginfo()", "type": "expression", "loc": [127, 127], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L126_C28", "vector": [8, 8, 0.7175, 0.0056, 8, 0.1, 0.0, 607, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('\\'turn\\': Looking at laser point msg #: ' + str(self.message.header.seq))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L128_C32", "label": "look_at()", "type": "expression", "loc": [128, 128], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L126_C28", "vector": [8, 8, 0.7232, 0.0056, 8, 0.1, 1.0, 695, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "look_at", "arg_names": [], "import_names": [], "rhs_call_name": "look_at", "annotation": ""}, "snippet": " self.look_at(self.laser_point_base, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L130_C24", "label": "loginfo()", "type": "expression", "loc": [130, 130], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L115_C20", "vector": [8, 6, 0.7345, 0.0056, 6, 0.16, 0.25, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('\\'turn\\': double clicked. Transitioning to \\'move\\'.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L131_C24", "label": "self.state =", "type": "assigned_variable", "loc": [131, 131], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L115_C20", "vector": [14, 6, 0.7401, 0.0056, 6, 0.16, 0.5, 765, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.state = 'move'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L132_C24", "label": "self.move_state =", "type": "assigned_variable", "loc": [132, 132], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L115_C20", "vector": [14, 6, 0.7458, 0.0056, 6, 0.16, 0.75, 369, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.move_state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.move_state = 'send_cmd'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L133_C24", "label": "self.double_click =", "type": "assigned_variable", "loc": [133, 133], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L115_C20", "vector": [14, 6, 0.7514, 0.0056, 6, 0.16, 1.0, 256, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.double_click", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.double_click = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L135_C12", "label": "if", "type": "if", "loc": [135, 167], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L113_C12", "vector": [4, 4, 0.8531, 0.1864, 4, 0.73, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.state == 'move':\n if self.move_state == 'send_cmd':\n if self.laser_point_base is not None:\n rospy.loginfo('\\'move\\': Sending move command.')\n self.move_base(self.laser_point_base, False)\n self.move_state = 'check_status'\n self.laser_point_base = None\n self.message = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L136_C16", "label": "if", "type": "if", "loc": [136, 165], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L135_C12", "vector": [4, 5, 0.8503, 0.1695, 5, 0.63, 0.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.move_state == 'send_cmd':\n if self.laser_point_base is not None:\n rospy.loginfo('\\'move\\': Sending move command.')\n self.move_base(self.laser_point_base, False)\n self.move_state = 'check_status'\n self.laser_point_base = None\n self.message = None\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L137_C20", "label": "if", "type": "if", "loc": [137, 144], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L136_C16", "vector": [4, 6, 0.7938, 0.0452, 6, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.laser_point_base is not None:\n rospy.loginfo('\\'move\\': Sending move command.')\n self.move_base(self.laser_point_base, False)\n self.move_state = 'check_status'\n self.laser_point_base = None\n self.message = None\n else:\n raise RuntimeError('laser_point_base is none!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L138_C24", "label": "loginfo()", "type": "expression", "loc": [138, 138], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L137_C20", "vector": [8, 7, 0.7797, 0.0056, 7, 0.29, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('\\'move\\': Sending move command.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L139_C24", "label": "move_base()", "type": "expression", "loc": [139, 139], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L137_C20", "vector": [8, 7, 0.7853, 0.0056, 7, 0.29, 0.25, 55, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "move_base", "arg_names": [], "import_names": [], "rhs_call_name": "move_base", "annotation": ""}, "snippet": " self.move_base(self.laser_point_base, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L140_C24", "label": "self.move_state =", "type": "assigned_variable", "loc": [140, 140], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L137_C20", "vector": [14, 7, 0.791, 0.0056, 7, 0.29, 0.5, 369, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.move_state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.move_state = 'check_status'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L141_C24", "label": "self.laser_point_base =", "type": "assigned_variable", "loc": [141, 141], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L137_C20", "vector": [14, 7, 0.7966, 0.0056, 7, 0.29, 0.75, 406, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.laser_point_base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.laser_point_base = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L142_C24", "label": "self.message =", "type": "assigned_variable", "loc": [142, 142], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L137_C20", "vector": [14, 7, 0.8023, 0.0056, 7, 0.29, 1.0, 709, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.message = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L146_C16", "label": "if", "type": "if", "loc": [146, 165], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L136_C16", "vector": [4, 6, 0.8785, 0.113, 6, 0.02, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.move_state == 'check_status':\n if self.double_click is not None:\n rospy.loginfo('\\'move\\': Canceling goal. Transitioning back to \\'turn\\'.')\n self.base_client.cancel_goal()\n self.state = 'turn'\n self.move_state = None\n self.double_click = None\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L147_C20", "label": "if", "type": "if", "loc": [147, 159], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L146_C16", "vector": [4, 7, 0.8644, 0.0734, 7, 0.45, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.double_click is not None:\n rospy.loginfo('\\'move\\': Canceling goal. Transitioning back to \\'turn\\'.')\n self.base_client.cancel_goal()\n self.state = 'turn'\n self.move_state = None\n self.double_click = None\n else:\n if self.base_client.get_state() == GoalStatus.SUCCEEDED or \\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L148_C24", "label": "loginfo()", "type": "expression", "loc": [148, 148], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L147_C20", "vector": [8, 8, 0.8362, 0.0056, 8, 0.24, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('\\'move\\': Canceling goal. Transitioning back to \\'turn\\'.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L149_C24", "label": "cancel_goal()", "type": "expression", "loc": [149, 149], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L147_C20", "vector": [8, 8, 0.8418, 0.0056, 8, 0.24, 0.2, 349, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_goal", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_goal", "annotation": ""}, "snippet": " self.base_client.cancel_goal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L150_C24", "label": "self.state =", "type": "assigned_variable", "loc": [150, 150], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L147_C20", "vector": [14, 8, 0.8475, 0.0056, 8, 0.24, 0.4, 765, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.state = 'turn'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L151_C24", "label": "self.move_state =", "type": "assigned_variable", "loc": [151, 151], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L147_C20", "vector": [14, 8, 0.8531, 0.0056, 8, 0.24, 0.6, 369, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.move_state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.move_state = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L152_C24", "label": "self.double_click =", "type": "assigned_variable", "loc": [152, 152], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L147_C20", "vector": [14, 8, 0.8588, 0.0056, 8, 0.24, 0.8, 256, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.double_click", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.double_click = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L154_C24", "label": "if", "type": "if", "loc": [154, 159], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L147_C20", "vector": [4, 8, 0.8842, 0.0339, 8, 0.24, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.base_client.get_state() == GoalStatus.SUCCEEDED or \\\n self.base_client.simple_state == actionlib.SimpleGoalState.DONE:\n rospy.loginfo('\\'move\\': Reached goal. Transitioning to \\'turn\\'.')\n self.state = 'turn'\n self.move_state = None\n self.double_click = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L156_C28", "label": "loginfo()", "type": "expression", "loc": [156, 156], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L154_C24", "vector": [8, 9, 0.8814, 0.0056, 9, 0.99, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('\\'move\\': Reached goal. Transitioning to \\'turn\\'.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L157_C28", "label": "self.state =", "type": "assigned_variable", "loc": [157, 157], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L154_C24", "vector": [14, 9, 0.887, 0.0056, 9, 0.99, 0.3333, 765, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.state = 'turn'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L158_C28", "label": "self.move_state =", "type": "assigned_variable", "loc": [158, 158], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L154_C24", "vector": [14, 9, 0.8927, 0.0056, 9, 0.99, 0.6667, 369, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.move_state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.move_state = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L159_C28", "label": "self.double_click =", "type": "assigned_variable", "loc": [159, 159], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L154_C24", "vector": [14, 9, 0.8983, 0.0056, 9, 0.99, 1.0, 256, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.double_click", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.double_click = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L169_C12", "label": "sleep()", "type": "expression", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:While_L112_C8", "vector": [8, 3, 0.9548, 0.0056, 3, 0.76, 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_99656:If_L171_C0", "label": "if", "type": "if", "loc": [171, 173], "level": 0, "parent": null, "vector": [4, 0, 0.9718, 0.0169, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n lab = LookAtBehavior('wide_stereo')\n lab.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L172_C4", "label": "lab = LookAtBehavior()", "type": "assigned_variable", "loc": [172, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L171_C0", "vector": [14, 1, 0.9718, 0.0056, 1, 0.81, 0.0, 996, 3, 1, 0, 0, 744, 10, 1], "semantic": {"name": "lab", "arg_names": [], "import_names": [], "rhs_call_name": "LookAtBehavior", "annotation": ""}, "snippet": " lab = LookAtBehavior('wide_stereo')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L173_C4", "label": "run()", "type": "expression", "loc": [173, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L171_C0", "vector": [8, 1, 0.9774, 0.0056, 1, 0.81, 1.0, 679, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " lab.run()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Return_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Return_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L85_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Return_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Return_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L102_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Return_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L102_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Return_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:While_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:While_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L113_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L114_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L114_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L115_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L115_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L117_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L118_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L119_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L120_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L121_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L122_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L123_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L124_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L125_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L116_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L126_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L126_C28", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L127_C32"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L126_C28", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L128_C32"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L115_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L130_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L115_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L131_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L115_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L132_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L115_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L133_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L113_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L135_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L136_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L136_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L137_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L137_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L138_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L137_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L139_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L137_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L140_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L137_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L141_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L137_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L142_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L136_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L146_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L146_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L147_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L147_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L148_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L147_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L149_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L147_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L150_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L147_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L151_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L147_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L152_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L147_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L154_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L154_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L156_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L154_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L157_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L154_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L158_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L154_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L159_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:While_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L171_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Assign_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99656:If_L171_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99656:Expr_L173_C4"}]
import roslib; roslib.load_manifest('hai_sandbox') from cv_bridge.cv_bridge import CvBridge, CvBridgeError import rospy import cv import sys import hrl_lib.tf_utils as tfu import tf.transformations as tr import tf import hrl_camera.ros_camera as cam from sensor_msgs.msg import CameraInfo import numpy as np import hai_sandbox.features as fea ## # from camera.py in laser_interface. class ROSCameraCalibration: def __init__(self, channel): rospy.Subscriber(channel, CameraInfo, self.camera_info) self.has_msg = False def camera_info(self, msg): self.distortion = np.matrix(msg.D) self.K = np.reshape(np.matrix(msg.K), (3,3)) self.R = np.reshape(np.matrix(msg.R), (3,3)) self.P = np.reshape(np.matrix(msg.P), (3,4)) self.w = msg.width self.h = msg.height self.frame = msg.header.frame_id self.has_msg = True ## # project 3D point into this camera # # @param p 3x1 matrix in given coord frame # @param tf_listener None if transformation not needed # @param from_frame None is default camera frame # @return 2x1 matrix def project(self, p, tf_listener=None, from_frame=None): if not(from_frame == None or from_frame == self.frame): p_cam = tfu.transform(self.frame, from_frame, tf_listener) \ * tfu.tf_as_matrix((p.A1.tolist(), tr.quaternion_from_euler(0,0,0))) trans, q = tfu.matrix_as_tf(p_cam) p = np.matrix(trans).T p = np.row_stack((p, np.matrix([1.]))) pp = self.P * p pp = pp / pp[2,0] return pp[0:2,0] class GripperTipProjected: def __init__(self): forearm_cam_l = '/l_forearm_cam/image_rect_color' ws_l = '/wide_stereo/left/image_rect_color' ws_r = '/wide_stereo/right/image_rect_color' ws_linf = '/wide_stereo/left/camera_info' ws_rinf = '/wide_stereo/right/camera_info' self.finger_tips = ['r_gripper_l_finger_tip_link', 'r_gripper_r_finger_tip_link', 'l_gripper_l_finger_tip_link', 'l_gripper_r_finger_tip_link'] self.camera_fr = ['r_forearm_cam_optical_frame', 'l_forearm_cam_optical_frame', 'wide_stereo_optical_frame'] rospy.init_node('gripper_pose_viewer') #self.camera_geo = ROSCameraCalibration('/wide_stereo/left/camera_info') self.camera_geo = ROSCameraCalibration('/l_forearm_cam/camera_info') self.camera = cam.ROSImageClient(forearm_cam_l) self.tflistener = tf.TransformListener() def run(self): cv.NamedWindow('surf', 1) while not rospy.is_shutdown(): image = self.camera.get_frame() image_gray = fea.grayscale(image) surf_keypoints, surf_descriptors = fea.surf(image_gray) vis_img = fea.draw_surf(image, surf_keypoints, (255, 0, 0)) #Project the tip of the gripper (both of them) into the image frame img_ll = self.camera_geo.project(np.matrix([0,0,0.]).T, self.tflistener, self.finger_tips[2]) img_lr = self.camera_geo.project(np.matrix([0,0,0.]).T, self.tflistener, self.finger_tips[3]) cv.Circle(vis_img, tuple(np.matrix(np.round(img_ll), dtype='int').A1.tolist()), 30, (0, 255, 0), 1, cv.CV_AA) cv.Circle(vis_img, tuple(np.matrix(np.round(img_lr), dtype='int').A1.tolist()), 30, (0, 255, 0), 1, cv.CV_AA) cv.ShowImage('surf', vis_img) cv.WaitKey(10) if __name__ == '__main__': g = GripperTipProjected() g.run() #fname = sys.argv[1] #bridge = CvBridge() #ws_leftinfo = ROSCameraCalibration(ws_linf) #ws_rightinfo = ROSCameraCalibration(ws_rinf)
ajibawa-2023/Python-Code-Large/train/row_99657
64
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_99657:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0093, 0.0093, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0093, 0.0093, 0, 0.66, 0.0667, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:ImportFrom_L2_C0", "label": "from cv_bridge.cv_bridge import CvBridge, CvBridgeError", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0185, 0.0093, 0, 0.66, 0.1333, 356, 0, 2, 0, 0, 356, 0, 0], "semantic": {"name": "cv_bridge.cv_bridge", "arg_names": [], "import_names": ["CvBridge", "CvBridgeError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from cv_bridge.cv_bridge import CvBridge, CvBridgeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Import_L3_C0", "label": "rospy import rospy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0278, 0.0093, 0, 0.66, 0.2, 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_99657:Import_L4_C0", "label": "cv import cv", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.037, 0.0093, 0, 0.66, 0.2667, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Import_L5_C0", "label": "sys import sys", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0463, 0.0093, 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_99657:Import_L7_C0", "label": "hrl_lib.tf_utils import tfu", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0648, 0.0093, 0, 0.66, 0.4, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "hrl_lib.tf_utils", "arg_names": [], "import_names": ["tfu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.tf_utils as tfu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Import_L8_C0", "label": "tf.transformations import tr", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0741, 0.0093, 0, 0.66, 0.4667, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Import_L9_C0", "label": "tf import tf", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0093, 0, 0.66, 0.5333, 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_99657:Import_L10_C0", "label": "hrl_camera.ros_camera import cam", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0926, 0.0093, 0, 0.66, 0.6, 798, 0, 1, 0, 0, 798, 0, 0], "semantic": {"name": "hrl_camera.ros_camera", "arg_names": [], "import_names": ["cam"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_camera.ros_camera as cam"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:ImportFrom_L11_C0", "label": "from sensor_msgs.msg import CameraInfo", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1019, 0.0093, 0, 0.66, 0.6667, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["CameraInfo"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import CameraInfo"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Import_L12_C0", "label": "numpy import np", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.0093, 0, 0.66, 0.7333, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Import_L13_C0", "label": "hai_sandbox.features import fea", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1204, 0.0093, 0, 0.66, 0.8, 673, 0, 1, 0, 0, 673, 0, 0], "semantic": {"name": "hai_sandbox.features", "arg_names": [], "import_names": ["fea"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hai_sandbox.features as fea"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:ClassDef_L18_C0", "label": "ROSCameraCalibration", "type": "class", "loc": [18, 50], "level": 0, "parent": null, "vector": [3, 0, 0.3148, 0.3056, 0, 0.66, 0.8667, 289, 0, 3, 0, 0, 0, 0, 16], "semantic": {"name": "ROSCameraCalibration", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ROSCameraCalibration:\n def __init__(self, channel):\n rospy.Subscriber(channel, CameraInfo, self.camera_info)\n self.has_msg = False\n\n def camera_info(self, msg):\n self.distortion = np.matrix(msg.D)\n self.K = np.reshape(np.matrix(msg.K), (3,3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L19_C4", "label": "__init__", "type": "function", "loc": [19, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:ClassDef_L18_C0", "vector": [2, 1, 0.1852, 0.0278, 1, 0.78, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "channel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, channel):\n rospy.Subscriber(channel, CameraInfo, self.camera_info)\n self.has_msg = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Expr_L20_C8", "label": "Subscriber()", "type": "expression", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L19_C4", "vector": [8, 2, 0.1852, 0.0093, 2, 0.62, 0.0, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber(channel, CameraInfo, self.camera_info)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L21_C8", "label": "self.has_msg =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L19_C4", "vector": [14, 2, 0.1944, 0.0093, 2, 0.62, 1.0, 477, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.has_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.has_msg = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L23_C4", "label": "camera_info", "type": "function", "loc": [23, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:ClassDef_L18_C0", "vector": [2, 1, 0.25, 0.0833, 1, 0.78, 0.5, 652, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "camera_info", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def camera_info(self, msg):\n self.distortion = np.matrix(msg.D)\n self.K = np.reshape(np.matrix(msg.K), (3,3))\n self.R = np.reshape(np.matrix(msg.R), (3,3))\n self.P = np.reshape(np.matrix(msg.P), (3,4))\n self.w = msg.width\n self.h = msg.height\n self.frame = msg.header.frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L24_C8", "label": "self.distortion = matrix()", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L23_C4", "vector": [14, 2, 0.2222, 0.0093, 2, 0.95, 0.0, 647, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "self.distortion", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " self.distortion = np.matrix(msg.D)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L25_C8", "label": "self.K = reshape()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L23_C4", "vector": [14, 2, 0.2315, 0.0093, 2, 0.95, 0.1429, 210, 3, 2, 0, 0, 276, 10, 2], "semantic": {"name": "self.K", "arg_names": [], "import_names": [], "rhs_call_name": "reshape", "annotation": ""}, "snippet": " self.K = np.reshape(np.matrix(msg.K), (3,3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L26_C8", "label": "self.R = reshape()", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L23_C4", "vector": [14, 2, 0.2407, 0.0093, 2, 0.95, 0.2857, 333, 3, 2, 0, 0, 276, 10, 2], "semantic": {"name": "self.R", "arg_names": [], "import_names": [], "rhs_call_name": "reshape", "annotation": ""}, "snippet": " self.R = np.reshape(np.matrix(msg.R), (3,3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L27_C8", "label": "self.P = reshape()", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L23_C4", "vector": [14, 2, 0.25, 0.0093, 2, 0.95, 0.4286, 612, 3, 2, 0, 0, 276, 10, 2], "semantic": {"name": "self.P", "arg_names": [], "import_names": [], "rhs_call_name": "reshape", "annotation": ""}, "snippet": " self.P = np.reshape(np.matrix(msg.P), (3,4))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L28_C8", "label": "self.w =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L23_C4", "vector": [14, 2, 0.2593, 0.0093, 2, 0.95, 0.5714, 642, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.w = msg.width"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L29_C8", "label": "self.h =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L23_C4", "vector": [14, 2, 0.2685, 0.0093, 2, 0.95, 0.7143, 164, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.h", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.h = msg.height"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L30_C8", "label": "self.frame =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L23_C4", "vector": [14, 2, 0.2778, 0.0093, 2, 0.95, 0.8571, 409, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.frame = msg.header.frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L31_C8", "label": "self.has_msg =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L23_C4", "vector": [14, 2, 0.287, 0.0093, 2, 0.95, 1.0, 477, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.has_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.has_msg = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L40_C4", "label": "project", "type": "function", "loc": [40, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:ClassDef_L18_C0", "vector": [2, 1, 0.4167, 0.1019, 1, 0.78, 1.0, 841, 0, 4, 1, 0, 0, 0, 8], "semantic": {"name": "project", "arg_names": ["self", "p", "tf_listener", "from_frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def project(self, p, tf_listener=None, from_frame=None):\n if not(from_frame == None or from_frame == self.frame):\n p_cam = tfu.transform(self.frame, from_frame, tf_listener) \\\n * tfu.tf_as_matrix((p.A1.tolist(), tr.quaternion_from_euler(0,0,0)))\n trans, q = tfu.matrix_as_tf(p_cam)\n p = np.matrix(trans).T\n\n p = np.row_stack((p, np.matrix([1.])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:If_L41_C8", "label": "if", "type": "if", "loc": [41, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L40_C4", "vector": [4, 2, 0.3981, 0.0463, 2, 0.41, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not(from_frame == None or from_frame == self.frame):\n p_cam = tfu.transform(self.frame, from_frame, tf_listener) \\\n * tfu.tf_as_matrix((p.A1.tolist(), tr.quaternion_from_euler(0,0,0)))\n trans, q = tfu.matrix_as_tf(p_cam)\n p = np.matrix(trans).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L42_C12", "label": "p_cam =", "type": "assigned_variable", "loc": [42, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:If_L41_C8", "vector": [14, 3, 0.3935, 0.0185, 3, 0.89, 0.0, 382, 4, 0, 0, 0, 0, 0, 4], "semantic": {"name": "p_cam", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_cam = tfu.transform(self.frame, from_frame, tf_listener) \\\n * tfu.tf_as_matrix((p.A1.tolist(), tr.quaternion_from_euler(0,0,0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L44_C12", "label": "trans, q = matrix_as_tf()", "type": "assigned_variable", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:If_L41_C8", "vector": [14, 3, 0.4074, 0.0093, 3, 0.89, 0.5, 606, 3, 1, 0, 0, 22, 10, 1], "semantic": {"name": "trans, q", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_as_tf", "annotation": ""}, "snippet": " trans, q = tfu.matrix_as_tf(p_cam)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L45_C12", "label": "p =", "type": "assigned_variable", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:If_L41_C8", "vector": [14, 3, 0.4167, 0.0093, 3, 0.89, 1.0, 491, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = np.matrix(trans).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L47_C8", "label": "p = row_stack()", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L40_C4", "vector": [14, 2, 0.4352, 0.0093, 2, 0.41, 0.25, 491, 3, 1, 0, 0, 612, 10, 2], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " p = np.row_stack((p, np.matrix([1.])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L48_C8", "label": "pp =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L40_C4", "vector": [14, 2, 0.4444, 0.0093, 2, 0.41, 0.5, 632, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pp = self.P * p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L49_C8", "label": "pp =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L40_C4", "vector": [14, 2, 0.4537, 0.0093, 2, 0.41, 0.75, 632, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pp = pp / pp[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Return_L50_C8", "label": "return", "type": "return", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L40_C4", "vector": [13, 2, 0.463, 0.0093, 2, 0.41, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pp[0:2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:ClassDef_L53_C0", "label": "GripperTipProjected", "type": "class", "loc": [53, 92], "level": 0, "parent": null, "vector": [3, 0, 0.6713, 0.3704, 0, 0.66, 0.9333, 548, 0, 2, 0, 0, 0, 0, 26], "semantic": {"name": "GripperTipProjected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class GripperTipProjected:\n def __init__(self):\n forearm_cam_l = '/l_forearm_cam/image_rect_color'\n ws_l = '/wide_stereo/left/image_rect_color'\n ws_r = '/wide_stereo/right/image_rect_color'\n ws_linf = '/wide_stereo/left/camera_info'\n ws_rinf = '/wide_stereo/right/camera_info'\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "label": "__init__", "type": "function", "loc": [54, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:ClassDef_L53_C0", "vector": [2, 1, 0.5926, 0.1944, 1, 0.68, 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 forearm_cam_l = '/l_forearm_cam/image_rect_color'\n ws_l = '/wide_stereo/left/image_rect_color'\n ws_r = '/wide_stereo/right/image_rect_color'\n ws_linf = '/wide_stereo/left/camera_info'\n ws_rinf = '/wide_stereo/right/camera_info'\n\n self.finger_tips = ['r_gripper_l_finger_tip_link',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L55_C8", "label": "forearm_cam_l =", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "vector": [14, 2, 0.5093, 0.0093, 2, 0.61, 0.0, 246, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "forearm_cam_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forearm_cam_l = '/l_forearm_cam/image_rect_color'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L56_C8", "label": "ws_l =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "vector": [14, 2, 0.5185, 0.0093, 2, 0.61, 0.1, 657, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ws_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ws_l = '/wide_stereo/left/image_rect_color'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L57_C8", "label": "ws_r =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "vector": [14, 2, 0.5278, 0.0093, 2, 0.61, 0.2, 524, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ws_r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ws_r = '/wide_stereo/right/image_rect_color'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L58_C8", "label": "ws_linf =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "vector": [14, 2, 0.537, 0.0093, 2, 0.61, 0.3, 808, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ws_linf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ws_linf = '/wide_stereo/left/camera_info'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L59_C8", "label": "ws_rinf =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "vector": [14, 2, 0.5463, 0.0093, 2, 0.61, 0.4, 972, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ws_rinf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ws_rinf = '/wide_stereo/right/camera_info'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L61_C8", "label": "self.finger_tips =", "type": "assigned_variable", "loc": [61, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "vector": [14, 2, 0.5787, 0.037, 2, 0.61, 0.5, 887, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.finger_tips", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.finger_tips = ['r_gripper_l_finger_tip_link',\n 'r_gripper_r_finger_tip_link',\n 'l_gripper_l_finger_tip_link',\n 'l_gripper_r_finger_tip_link']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L66_C8", "label": "self.camera_fr =", "type": "assigned_variable", "loc": [66, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "vector": [14, 2, 0.6204, 0.0278, 2, 0.61, 0.6, 217, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.camera_fr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.camera_fr = ['r_forearm_cam_optical_frame', \n 'l_forearm_cam_optical_frame', \n 'wide_stereo_optical_frame']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Expr_L70_C8", "label": "init_node()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "vector": [8, 2, 0.6481, 0.0093, 2, 0.61, 0.7, 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('gripper_pose_viewer')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L72_C8", "label": "self.camera_geo = ROSCameraCalibration()", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "vector": [14, 2, 0.6667, 0.0093, 2, 0.61, 0.8, 991, 3, 1, 0, 0, 289, 10, 1], "semantic": {"name": "self.camera_geo", "arg_names": [], "import_names": [], "rhs_call_name": "ROSCameraCalibration", "annotation": ""}, "snippet": " self.camera_geo = ROSCameraCalibration('/l_forearm_cam/camera_info')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L73_C8", "label": "self.camera = ROSImageClient()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "vector": [14, 2, 0.6759, 0.0093, 2, 0.61, 0.9, 585, 3, 1, 0, 0, 348, 10, 1], "semantic": {"name": "self.camera", "arg_names": [], "import_names": [], "rhs_call_name": "ROSImageClient", "annotation": ""}, "snippet": " self.camera = cam.ROSImageClient(forearm_cam_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L74_C8", "label": "self.tflistener = TransformListener()", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "vector": [14, 2, 0.6852, 0.0093, 2, 0.61, 1.0, 50, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tflistener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.tflistener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L77_C4", "label": "run", "type": "function", "loc": [77, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:ClassDef_L53_C0", "vector": [2, 1, 0.7824, 0.1481, 1, 0.68, 1.0, 679, 0, 1, 0, 0, 0, 0, 22], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run(self):\n cv.NamedWindow('surf', 1)\n while not rospy.is_shutdown():\n image = self.camera.get_frame()\n image_gray = fea.grayscale(image)\n surf_keypoints, surf_descriptors = fea.surf(image_gray)\n vis_img = fea.draw_surf(image, surf_keypoints, (255, 0, 0))\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Expr_L78_C8", "label": "NamedWindow()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L77_C4", "vector": [8, 2, 0.7222, 0.0093, 2, 0.8, 0.0, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow('surf', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8", "label": "while", "type": "while", "loc": [79, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L77_C4", "vector": [5, 2, 0.7917, 0.1296, 2, 0.8, 1.0, 0, 0, 0, 0, 0, 0, 0, 21], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n image = self.camera.get_frame()\n image_gray = fea.grayscale(image)\n surf_keypoints, surf_descriptors = fea.surf(image_gray)\n vis_img = fea.draw_surf(image, surf_keypoints, (255, 0, 0))\n \n #Project the tip of the gripper (both of them) into the image frame\n img_ll = self.camera_geo.project(np.matrix([0,0,0.]).T, self.tflistener, self.finger_tips[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L80_C12", "label": "image = get_frame()", "type": "assigned_variable", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8", "vector": [14, 3, 0.7407, 0.0093, 3, 0.11, 0.0, 505, 3, 0, 0, 0, 489, 10, 1], "semantic": {"name": "image", "arg_names": [], "import_names": [], "rhs_call_name": "get_frame", "annotation": ""}, "snippet": " image = self.camera.get_frame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L81_C12", "label": "image_gray = grayscale()", "type": "assigned_variable", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8", "vector": [14, 3, 0.75, 0.0093, 3, 0.11, 0.1111, 411, 3, 1, 0, 0, 530, 10, 1], "semantic": {"name": "image_gray", "arg_names": [], "import_names": [], "rhs_call_name": "grayscale", "annotation": ""}, "snippet": " image_gray = fea.grayscale(image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L82_C12", "label": "surf_keypoints, surf_descriptors = surf()", "type": "assigned_variable", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8", "vector": [14, 3, 0.7593, 0.0093, 3, 0.11, 0.2222, 490, 3, 1, 0, 0, 181, 10, 1], "semantic": {"name": "surf_keypoints, surf_descriptors", "arg_names": [], "import_names": [], "rhs_call_name": "surf", "annotation": ""}, "snippet": " surf_keypoints, surf_descriptors = fea.surf(image_gray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L83_C12", "label": "vis_img = draw_surf()", "type": "assigned_variable", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8", "vector": [14, 3, 0.7685, 0.0093, 3, 0.11, 0.3333, 444, 3, 3, 0, 0, 124, 10, 1], "semantic": {"name": "vis_img", "arg_names": [], "import_names": [], "rhs_call_name": "draw_surf", "annotation": ""}, "snippet": " vis_img = fea.draw_surf(image, surf_keypoints, (255, 0, 0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L86_C12", "label": "img_ll = project()", "type": "assigned_variable", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8", "vector": [14, 3, 0.7963, 0.0093, 3, 0.11, 0.4444, 900, 3, 3, 0, 0, 841, 10, 2], "semantic": {"name": "img_ll", "arg_names": [], "import_names": [], "rhs_call_name": "project", "annotation": ""}, "snippet": " img_ll = self.camera_geo.project(np.matrix([0,0,0.]).T, self.tflistener, self.finger_tips[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L87_C12", "label": "img_lr = project()", "type": "assigned_variable", "loc": [87, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8", "vector": [14, 3, 0.8056, 0.0093, 3, 0.11, 0.5556, 433, 3, 3, 0, 0, 841, 10, 2], "semantic": {"name": "img_lr", "arg_names": [], "import_names": [], "rhs_call_name": "project", "annotation": ""}, "snippet": " img_lr = self.camera_geo.project(np.matrix([0,0,0.]).T, self.tflistener, self.finger_tips[3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Expr_L89_C12", "label": "Circle()", "type": "expression", "loc": [89, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8", "vector": [8, 3, 0.8241, 0.0093, 3, 0.11, 0.6667, 780, 3, 6, 0, 0, 0, 0, 5], "semantic": {"name": "Circle", "arg_names": [], "import_names": [], "rhs_call_name": "Circle", "annotation": ""}, "snippet": " cv.Circle(vis_img, tuple(np.matrix(np.round(img_ll), dtype='int').A1.tolist()), 30, (0, 255, 0), 1, cv.CV_AA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Expr_L90_C12", "label": "Circle()", "type": "expression", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8", "vector": [8, 3, 0.8333, 0.0093, 3, 0.11, 0.7778, 780, 3, 6, 0, 0, 0, 0, 5], "semantic": {"name": "Circle", "arg_names": [], "import_names": [], "rhs_call_name": "Circle", "annotation": ""}, "snippet": " cv.Circle(vis_img, tuple(np.matrix(np.round(img_lr), dtype='int').A1.tolist()), 30, (0, 255, 0), 1, cv.CV_AA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Expr_L91_C12", "label": "ShowImage()", "type": "expression", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8", "vector": [8, 3, 0.8426, 0.0093, 3, 0.11, 0.8889, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage('surf', vis_img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Expr_L92_C12", "label": "WaitKey()", "type": "expression", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8", "vector": [8, 3, 0.8519, 0.0093, 3, 0.11, 1.0, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "WaitKey", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " cv.WaitKey(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:If_L95_C0", "label": "if", "type": "if", "loc": [95, 97], "level": 0, "parent": null, "vector": [4, 0, 0.8889, 0.0278, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n g = GripperTipProjected()\n g.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L96_C4", "label": "g = GripperTipProjected()", "type": "assigned_variable", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:If_L95_C0", "vector": [14, 1, 0.8889, 0.0093, 1, 0.16, 0.0, 384, 3, 0, 0, 0, 548, 10, 1], "semantic": {"name": "g", "arg_names": [], "import_names": [], "rhs_call_name": "GripperTipProjected", "annotation": ""}, "snippet": " g = GripperTipProjected()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99657:Expr_L97_C4", "label": "run()", "type": "expression", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99657:If_L95_C0", "vector": [8, 1, 0.8981, 0.0093, 1, 0.16, 1.0, 679, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " g.run()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99657:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Expr_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:If_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:If_L41_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:If_L41_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:If_L41_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Return_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:ClassDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:ClassDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Expr_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Expr_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Expr_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:While_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Expr_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Assign_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99657:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99657:Expr_L97_C4"}]
#! /usr/bin/python import roslib; roslib.load_manifest('hai_sandbox') import hrl_camera.ros_camera as rc import hrl_lib.rutils as ru import hrl_lib.util as ut import rospy import math import cv #TF import tf import hrl_lib.tf_utils as tfu import tf.transformations as tr if __name__ == '__main__': ls = ru.LaserScanner('point_cloud_srv') prosilica = rc.Prosilica('prosilica', 'streaming') if __name__ == '__main__': import sys base_name = sys.argv[1] test = 'laser' ls = ru.LaserScanner('point_cloud_srv') prosilica = rc.Prosilica('prosilica', 'streaming') tf_listener = tf.TransformListener() rospy.loginfo( 'Getting laser scan.') points = ls.scan(math.radians(180.), math.radians(-180.), 20.) rospy.loginfo('Size of point cloud: %d' % len(points.points)) rospy.loginfo( 'Grabbing image.') image = prosilica.get_frame() rospy.loginfo( 'Grabbing transforms.') #transform from tilt_laser => base_footprint (pointcloud is already in base_footprint) #transform from base_footprint => (pose of head) prosilica pro_T_bf = tfu.transform('/high_def_optical_frame', '/base_footprint', tf_listener) #transform from base_footprint => map map_T_bf = tfu.transform('/map', '/base_footprint', tf_listener) #get camera's P matrix rospy.loginfo('Waiting for camera_info.') calibration = rc.ROSCameraCalibration('/prosilica/camera_info') r = rospy.Rate(10) while not rospy.is_shutdown() and calibration.has_msg == False: r.sleep() rospy.loginfo('Saving.') pkl_name = '%s.pkl' % base_name img_name = '%s.png' % base_name ut.save_pickle({'points': points, 'pro_T_bf': pro_T_bf, 'map_T_bf': map_T_bf, 'camera_info': calibration}, pkl_name) cv.SaveImage(img_name, image) rospy.loginfo( 'Saved to %s and %s.' % (pkl_name, img_name))
ajibawa-2023/Python-Code-Large/train/row_99658
40
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_99658:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0333, 0.0167, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Expr_L2_C15", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0333, 0.0167, 0, 0.66, 0.0833, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Import_L3_C0", "label": "hrl_camera.ros_camera import rc", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.0167, 0, 0.66, 0.1667, 798, 0, 1, 0, 0, 798, 0, 0], "semantic": {"name": "hrl_camera.ros_camera", "arg_names": [], "import_names": ["rc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_camera.ros_camera as rc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Import_L4_C0", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0167, 0, 0.66, 0.25, 847, 0, 1, 0, 0, 847, 0, 0], "semantic": {"name": "hrl_lib.rutils", "arg_names": [], "import_names": ["ru"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.rutils as ru"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Import_L5_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0167, 0, 0.66, 0.3333, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Import_L6_C0", "label": "rospy import rospy", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.0167, 0, 0.66, 0.4167, 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_99658:Import_L7_C0", "label": "math import math", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1167, 0.0167, 0, 0.66, 0.5, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Import_L8_C0", "label": "cv import cv", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1333, 0.0167, 0, 0.66, 0.5833, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Import_L11_C0", "label": "tf import tf", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1833, 0.0167, 0, 0.66, 0.6667, 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_99658:Import_L12_C0", "label": "hrl_lib.tf_utils import tfu", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.0167, 0, 0.66, 0.75, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "hrl_lib.tf_utils", "arg_names": [], "import_names": ["tfu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.tf_utils as tfu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Import_L13_C0", "label": "tf.transformations import tr", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.2167, 0.0167, 0, 0.66, 0.8333, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L15_C0", "label": "if", "type": "if", "loc": [15, 17], "level": 0, "parent": null, "vector": [4, 0, 0.2667, 0.05, 0, 0.66, 0.9167, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n ls = ru.LaserScanner('point_cloud_srv')\n prosilica = rc.Prosilica('prosilica', 'streaming')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L16_C4", "label": "ls = LaserScanner()", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L15_C0", "vector": [14, 1, 0.2667, 0.0167, 1, 0.41, 0.0, 174, 3, 1, 0, 0, 232, 10, 1], "semantic": {"name": "ls", "arg_names": [], "import_names": [], "rhs_call_name": "LaserScanner", "annotation": ""}, "snippet": " ls = ru.LaserScanner('point_cloud_srv')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L17_C4", "label": "prosilica = Prosilica()", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L15_C0", "vector": [14, 1, 0.2833, 0.0167, 1, 0.41, 1.0, 501, 3, 2, 0, 0, 878, 10, 1], "semantic": {"name": "prosilica", "arg_names": [], "import_names": [], "rhs_call_name": "Prosilica", "annotation": ""}, "snippet": " prosilica = rc.Prosilica('prosilica', 'streaming')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "label": "if", "type": "if", "loc": [20, 58], "level": 0, "parent": null, "vector": [4, 0, 0.65, 0.65, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 23], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import sys\n\n base_name = sys.argv[1]\n test = 'laser'\n ls = ru.LaserScanner('point_cloud_srv')\n prosilica = rc.Prosilica('prosilica', 'streaming')\n tf_listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Import_L21_C4", "label": "sys import sys", "type": "import", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [1, 1, 0.35, 0.0167, 1, 0.93, 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_99658:Assign_L23_C4", "label": "base_name =", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [14, 1, 0.3833, 0.0167, 1, 0.93, 0.0435, 29, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "base_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " base_name = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L24_C4", "label": "test =", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [14, 1, 0.4, 0.0167, 1, 0.93, 0.087, 224, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test = 'laser'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L25_C4", "label": "ls = LaserScanner()", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [14, 1, 0.4167, 0.0167, 1, 0.93, 0.1304, 174, 3, 1, 0, 0, 232, 10, 1], "semantic": {"name": "ls", "arg_names": [], "import_names": [], "rhs_call_name": "LaserScanner", "annotation": ""}, "snippet": " ls = ru.LaserScanner('point_cloud_srv')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L26_C4", "label": "prosilica = Prosilica()", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [14, 1, 0.4333, 0.0167, 1, 0.93, 0.1739, 501, 3, 2, 0, 0, 878, 10, 1], "semantic": {"name": "prosilica", "arg_names": [], "import_names": [], "rhs_call_name": "Prosilica", "annotation": ""}, "snippet": " prosilica = rc.Prosilica('prosilica', 'streaming')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L27_C4", "label": "tf_listener = TransformListener()", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [14, 1, 0.45, 0.0167, 1, 0.93, 0.2174, 565, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "tf_listener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " tf_listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Expr_L29_C4", "label": "loginfo()", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [8, 1, 0.4833, 0.0167, 1, 0.93, 0.2609, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'Getting laser scan.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L30_C4", "label": "points = scan()", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [14, 1, 0.5, 0.0167, 1, 0.93, 0.3043, 738, 3, 3, 0, 0, 202, 10, 3], "semantic": {"name": "points", "arg_names": [], "import_names": [], "rhs_call_name": "scan", "annotation": ""}, "snippet": " points = ls.scan(math.radians(180.), math.radians(-180.), 20.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Expr_L31_C4", "label": "loginfo()", "type": "expression", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [8, 1, 0.5167, 0.0167, 1, 0.93, 0.3478, 607, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Size of point cloud: %d' % len(points.points))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Expr_L32_C4", "label": "loginfo()", "type": "expression", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [8, 1, 0.5333, 0.0167, 1, 0.93, 0.3913, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'Grabbing image.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L33_C4", "label": "image = get_frame()", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [14, 1, 0.55, 0.0167, 1, 0.93, 0.4348, 505, 3, 0, 0, 0, 489, 10, 1], "semantic": {"name": "image", "arg_names": [], "import_names": [], "rhs_call_name": "get_frame", "annotation": ""}, "snippet": " image = prosilica.get_frame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Expr_L34_C4", "label": "loginfo()", "type": "expression", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [8, 1, 0.5667, 0.0167, 1, 0.93, 0.4783, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'Grabbing transforms.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L38_C4", "label": "pro_T_bf = transform()", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [14, 1, 0.6333, 0.0167, 1, 0.93, 0.5217, 827, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "pro_T_bf", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " pro_T_bf = tfu.transform('/high_def_optical_frame', '/base_footprint', tf_listener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L41_C4", "label": "map_T_bf = transform()", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [14, 1, 0.6833, 0.0167, 1, 0.93, 0.5652, 527, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "map_T_bf", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " map_T_bf = tfu.transform('/map', '/base_footprint', tf_listener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Expr_L44_C4", "label": "loginfo()", "type": "expression", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [8, 1, 0.7333, 0.0167, 1, 0.93, 0.6087, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Waiting for camera_info.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L45_C4", "label": "calibration = ROSCameraCalibration()", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [14, 1, 0.75, 0.0167, 1, 0.93, 0.6522, 306, 3, 1, 0, 0, 289, 10, 1], "semantic": {"name": "calibration", "arg_names": [], "import_names": [], "rhs_call_name": "ROSCameraCalibration", "annotation": ""}, "snippet": " calibration = rc.ROSCameraCalibration('/prosilica/camera_info')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L46_C4", "label": "r = Rate()", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [14, 1, 0.7667, 0.0167, 1, 0.93, 0.6957, 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_99658:While_L47_C4", "label": "while", "type": "while", "loc": [47, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [5, 1, 0.7917, 0.0333, 1, 0.93, 0.7391, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown() and calibration.has_msg == False:\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Expr_L48_C8", "label": "sleep()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:While_L47_C4", "vector": [8, 2, 0.8, 0.0167, 2, 0.41, 0.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_99658:Expr_L50_C4", "label": "loginfo()", "type": "expression", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [8, 1, 0.8333, 0.0167, 1, 0.93, 0.7826, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Saving.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L51_C4", "label": "pkl_name =", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [14, 1, 0.85, 0.0167, 1, 0.93, 0.8261, 780, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pkl_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pkl_name = '%s.pkl' % base_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L52_C4", "label": "img_name =", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [14, 1, 0.8667, 0.0167, 1, 0.93, 0.8696, 460, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "img_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " img_name = '%s.png' % base_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Expr_L53_C4", "label": "save_pickle()", "type": "expression", "loc": [53, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [8, 1, 0.9083, 0.0667, 1, 0.93, 0.913, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle({'points': points, \n 'pro_T_bf': pro_T_bf, \n 'map_T_bf': map_T_bf, \n 'camera_info': calibration}, pkl_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Expr_L57_C4", "label": "SaveImage()", "type": "expression", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [8, 1, 0.95, 0.0167, 1, 0.93, 0.9565, 91, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "SaveImage", "arg_names": [], "import_names": [], "rhs_call_name": "SaveImage", "annotation": ""}, "snippet": " cv.SaveImage(img_name, image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99658:Expr_L58_C4", "label": "loginfo()", "type": "expression", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "vector": [8, 1, 0.9667, 0.0167, 1, 0.93, 1.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'Saved to %s and %s.' % (pkl_name, img_name))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Import_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Expr_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Expr_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:While_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:While_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Expr_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Expr_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99658:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99658:Expr_L58_C4"}]
import csv import roslib; roslib.load_manifest('hai_sandbox') from cv_bridge.cv_bridge import CvBridge, CvBridgeError import rospy import cv import sys import hrl_lib.rutils as ru import hrl_lib.tf_utils as tfu import tf.transformations as tr import tf import hrl_camera.ros_camera as cam from sensor_msgs.msg import CameraInfo import numpy as np import hai_sandbox.features as fea import os.path as pt import hrl_lib.util as ut import scipy.cluster.vq as vq import os def csv_bag_names(fname): csv_file = open(fname) for bag_name in csv.reader(csv_file): yield bag_name csv_file.close() if __name__ == '__main__': import sys fname = sys.argv[1] for path in csv_bag_names(fname): cmd ='python test08.py %s' % path[0] print cmd os.system(cmd)
ajibawa-2023/Python-Code-Large/train/row_99659
31
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_99659:Import_L1_C0", "label": "csv import csv", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0294, 0.0294, 0, 0.66, 0.0, 312, 0, 1, 0, 0, 312, 0, 0], "semantic": {"name": "csv", "arg_names": [], "import_names": ["csv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import csv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0294, 0, 0.66, 0.05, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:Expr_L2_C15", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0588, 0.0294, 0, 0.66, 0.1, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:ImportFrom_L3_C0", "label": "from cv_bridge.cv_bridge import CvBridge, CvBridgeError", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0882, 0.0294, 0, 0.66, 0.15, 356, 0, 2, 0, 0, 356, 0, 0], "semantic": {"name": "cv_bridge.cv_bridge", "arg_names": [], "import_names": ["CvBridge", "CvBridgeError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from cv_bridge.cv_bridge import CvBridge, CvBridgeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1176, 0.0294, 0, 0.66, 0.2, 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_99659:Import_L5_C0", "label": "cv import cv", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1471, 0.0294, 0, 0.66, 0.25, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:Import_L6_C0", "label": "sys import sys", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1765, 0.0294, 0, 0.66, 0.3, 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_99659:Import_L8_C0", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.2353, 0.0294, 0, 0.66, 0.35, 847, 0, 1, 0, 0, 847, 0, 0], "semantic": {"name": "hrl_lib.rutils", "arg_names": [], "import_names": ["ru"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.rutils as ru"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:Import_L9_C0", "label": "hrl_lib.tf_utils import tfu", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.2647, 0.0294, 0, 0.66, 0.4, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "hrl_lib.tf_utils", "arg_names": [], "import_names": ["tfu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.tf_utils as tfu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:Import_L10_C0", "label": "tf.transformations import tr", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.2941, 0.0294, 0, 0.66, 0.45, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:Import_L11_C0", "label": "tf import tf", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.3235, 0.0294, 0, 0.66, 0.5, 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_99659:Import_L12_C0", "label": "hrl_camera.ros_camera import cam", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.3529, 0.0294, 0, 0.66, 0.55, 798, 0, 1, 0, 0, 798, 0, 0], "semantic": {"name": "hrl_camera.ros_camera", "arg_names": [], "import_names": ["cam"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_camera.ros_camera as cam"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:ImportFrom_L13_C0", "label": "from sensor_msgs.msg import CameraInfo", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.3824, 0.0294, 0, 0.66, 0.6, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["CameraInfo"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import CameraInfo"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:Import_L14_C0", "label": "numpy import np", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.4118, 0.0294, 0, 0.66, 0.65, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:Import_L15_C0", "label": "hai_sandbox.features import fea", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.4412, 0.0294, 0, 0.66, 0.7, 673, 0, 1, 0, 0, 673, 0, 0], "semantic": {"name": "hai_sandbox.features", "arg_names": [], "import_names": ["fea"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hai_sandbox.features as fea"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:Import_L16_C0", "label": "os.path import pt", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.4706, 0.0294, 0, 0.66, 0.75, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["pt"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os.path as pt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:Import_L17_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.0294, 0, 0.66, 0.8, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:Import_L18_C0", "label": "scipy.cluster.vq import vq", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.5294, 0.0294, 0, 0.66, 0.85, 67, 0, 1, 0, 0, 67, 0, 0], "semantic": {"name": "scipy.cluster.vq", "arg_names": [], "import_names": ["vq"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.cluster.vq as vq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:Import_L19_C0", "label": "os import os", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.5588, 0.0294, 0, 0.66, 0.9, 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_99659:FunctionDef_L21_C0", "label": "csv_bag_names", "type": "function", "loc": [21, 25], "level": 0, "parent": null, "vector": [2, 0, 0.6765, 0.1471, 0, 0.66, 0.95, 898, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "csv_bag_names", "arg_names": ["fname"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def csv_bag_names(fname):\n csv_file = open(fname)\n for bag_name in csv.reader(csv_file):\n yield bag_name\n csv_file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:Assign_L22_C4", "label": "csv_file = open()", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99659:FunctionDef_L21_C0", "vector": [14, 1, 0.6471, 0.0294, 1, 0.12, 0.0, 661, 3, 1, 0, 0, 693, 10, 1], "semantic": {"name": "csv_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " csv_file = open(fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:For_L23_C4", "label": "for bag_name", "type": "for", "loc": [23, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99659:FunctionDef_L21_C0", "vector": [6, 1, 0.6912, 0.0588, 1, 0.12, 0.5, 985, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bag_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for bag_name in csv.reader(csv_file):\n yield bag_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:Expr_L24_C8", "label": "expression", "type": "expression", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99659:For_L23_C4", "vector": [8, 2, 0.7059, 0.0294, 2, 0.05, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield bag_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:Expr_L25_C4", "label": "close()", "type": "expression", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99659:FunctionDef_L21_C0", "vector": [8, 1, 0.7353, 0.0294, 1, 0.12, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " csv_file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:If_L27_C0", "label": "if", "type": "if", "loc": [27, 34], "level": 0, "parent": null, "vector": [4, 0, 0.8971, 0.2353, 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 import sys\n fname = sys.argv[1]\n\n for path in csv_bag_names(fname):\n cmd ='python test08.py %s' % path[0]\n print(cmd)\n os.system(cmd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:Import_L28_C4", "label": "sys import sys", "type": "import", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99659:If_L27_C0", "vector": [1, 1, 0.8235, 0.0294, 1, 0.52, 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_99659:Assign_L29_C4", "label": "fname =", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99659:If_L27_C0", "vector": [14, 1, 0.8529, 0.0294, 1, 0.52, 0.5, 190, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fname = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:For_L31_C4", "label": "for path", "type": "for", "loc": [31, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99659:If_L27_C0", "vector": [6, 1, 0.9559, 0.1176, 1, 0.52, 1.0, 358, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for path in csv_bag_names(fname):\n cmd ='python test08.py %s' % path[0]\n print(cmd)\n os.system(cmd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:Assign_L32_C8", "label": "cmd =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99659:For_L31_C4", "vector": [14, 2, 0.9412, 0.0294, 2, 0.39, 0.0, 604, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cmd ='python test08.py %s' % path[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:Expr_L33_C8", "label": "print()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99659:For_L31_C4", "vector": [8, 2, 0.9706, 0.0294, 2, 0.39, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(cmd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99659:Expr_L34_C8", "label": "system()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99659:For_L31_C4", "vector": [8, 2, 1.0, 0.0294, 2, 0.39, 1.0, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " os.system(cmd)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99659:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99659:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99659:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99659:For_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99659:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99659:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99659:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99659:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99659:If_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99659:Import_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99659:If_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99659:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99659:If_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99659:For_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99659:For_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99659:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99659:For_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99659:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99659:For_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99659:Expr_L34_C8"}]
import roslib; roslib.load_manifest('hai_sandbox') import rospy import tf.transformations as tr import hrl_lib.tf_utils as tfu import hrl_lib.util as ut import tf import geometry_msgs.msg as gm import trigger_msgs.msg as trm import sys import math import numpy as np class MoveBase: def __init__(self): rospy.init_node('drive') self.tw_pub = rospy.Publisher('base_controller/command', gm.Twist) self.tl = tf.TransformListener() def go_ang(self, ang, speed): dt = math.radians(ang) if dt > 0: sign = -1 elif dt < 0: sign = 1 else: sign = 0 self.tl.waitForTransform('base_footprint', 'odom_combined', rospy.Time(), rospy.Duration(10)) p0_base = tfu.transform('base_footprint', 'odom_combined', self.tl)# \ start_ang = tr.euler_from_matrix(p0_base[0:3, 0:3], 'sxyz')[2] r = rospy.Rate(100) dist_so_far = 0. last_ang = start_ang while not rospy.is_shutdown(): pcurrent_base = tfu.transform('base_footprint', 'odom_combined', self.tl) #\ current_ang = tr.euler_from_matrix(pcurrent_base[0:3, 0:3], 'sxyz')[2] dist_so_far = dist_so_far + (ut.standard_rad(current_ang - last_ang)) if dt > 0 and dist_so_far > dt: rospy.loginfo('stopped! %f %f' % (dist_so_far, dt)) break elif dt < 0 and dist_so_far < dt: rospy.loginfo('stopped! %f %f' % (dist_so_far, dt)) break elif dt == 0: rospy.loginfo('stopped! %f %f' % (dist_so_far, dt)) break tw = gm.Twist() tw.angular.z = math.radians(speed * sign) self.tw_pub.publish(tw) r.sleep() last_ang = current_ang def go_x(self, x, speed): print 'go x called!' vel = speed * np.sign(x) self.tl.waitForTransform('base_footprint', 'odom_combined', rospy.Time(), rospy.Duration(10)) p0_base = tfu.transform('base_footprint', 'odom_combined', self.tl) r = rospy.Rate(100) while not rospy.is_shutdown(): pcurrent_base = tfu.transform('base_footprint', 'odom_combined', self.tl) relative_trans = np.linalg.inv(p0_base) * pcurrent_base dist_moved = np.linalg.norm(relative_trans[0:3,3]) print "%s" % str(dist_moved) if dist_moved > np.abs(x): rospy.loginfo('stopped! error %f' % (np.abs(dist_moved-np.abs(x)))) break tw = gm.Twist() tw.linear.x = vel tw.linear.y = 0 tw.linear.z = 0 tw.angular.x = 0 tw.angular.y = 0 tw.angular.z = 0 self.tw_pub.publish(tw) r.sleep() if __name__ == '__main__': m = MoveBase() #m.go_ang(-390, 100) m.go_x(.2, .05)
ajibawa-2023/Python-Code-Large/train/row_99660
70
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_99660:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0112, 0.0112, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0112, 0.0112, 0, 0.66, 0.0769, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0225, 0.0112, 0, 0.66, 0.1538, 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_99660:Import_L3_C0", "label": "tf.transformations import tr", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0337, 0.0112, 0, 0.66, 0.2308, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Import_L4_C0", "label": "hrl_lib.tf_utils import tfu", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0449, 0.0112, 0, 0.66, 0.3077, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "hrl_lib.tf_utils", "arg_names": [], "import_names": ["tfu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.tf_utils as tfu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Import_L5_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0562, 0.0112, 0, 0.66, 0.3846, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Import_L6_C0", "label": "tf import tf", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0674, 0.0112, 0, 0.66, 0.4615, 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_99660:Import_L8_C0", "label": "geometry_msgs.msg import gm", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0899, 0.0112, 0, 0.66, 0.5385, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["gm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import geometry_msgs.msg as gm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Import_L9_C0", "label": "trigger_msgs.msg import trm", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1011, 0.0112, 0, 0.66, 0.6154, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "trigger_msgs.msg", "arg_names": [], "import_names": ["trm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import trigger_msgs.msg as trm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Import_L10_C0", "label": "sys import sys", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1124, 0.0112, 0, 0.66, 0.6923, 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_99660:Import_L11_C0", "label": "math import math", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1236, 0.0112, 0, 0.66, 0.7692, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Import_L12_C0", "label": "numpy import np", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1348, 0.0112, 0, 0.66, 0.8462, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:ClassDef_L14_C0", "label": "MoveBase", "type": "class", "loc": [14, 84], "level": 0, "parent": null, "vector": [3, 0, 0.5506, 0.7978, 0, 0.66, 0.9231, 11, 0, 3, 0, 0, 0, 0, 41], "semantic": {"name": "MoveBase", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MoveBase:\n def __init__(self):\n rospy.init_node('drive')\n self.tw_pub = rospy.Publisher('base_controller/command', gm.Twist)\n self.tl = tf.TransformListener()\n\n def go_ang(self, ang, speed):\n dt = math.radians(ang)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L15_C4", "label": "__init__", "type": "function", "loc": [15, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:ClassDef_L14_C0", "vector": [2, 1, 0.1854, 0.0449, 1, 0.92, 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 rospy.init_node('drive')\n self.tw_pub = rospy.Publisher('base_controller/command', gm.Twist)\n self.tl = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L16_C8", "label": "init_node()", "type": "expression", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L15_C4", "vector": [8, 2, 0.1798, 0.0112, 2, 0.56, 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('drive')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L17_C8", "label": "self.tw_pub = Publisher()", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L15_C4", "vector": [14, 2, 0.191, 0.0112, 2, 0.56, 0.5, 794, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.tw_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.tw_pub = rospy.Publisher('base_controller/command', gm.Twist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L18_C8", "label": "self.tl = TransformListener()", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L15_C4", "vector": [14, 2, 0.2022, 0.0112, 2, 0.56, 1.0, 790, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tl", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.tl = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L20_C4", "label": "go_ang", "type": "function", "loc": [20, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:ClassDef_L14_C0", "vector": [2, 1, 0.427, 0.4157, 1, 0.92, 0.5, 774, 0, 3, 0, 0, 0, 0, 18], "semantic": {"name": "go_ang", "arg_names": ["self", "ang", "speed"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def go_ang(self, ang, speed):\n dt = math.radians(ang)\n\n if dt > 0:\n sign = -1\n elif dt < 0:\n sign = 1\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L21_C8", "label": "dt = radians()", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L20_C4", "vector": [14, 2, 0.236, 0.0112, 2, 0.2, 0.0, 455, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "dt", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " dt = math.radians(ang)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L23_C8", "label": "if", "type": "if", "loc": [23, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L20_C4", "vector": [4, 2, 0.2865, 0.0674, 2, 0.2, 0.125, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dt > 0:\n sign = -1\n elif dt < 0:\n sign = 1\n else:\n sign = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L24_C12", "label": "sign =", "type": "assigned_variable", "loc": [24, 24], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L23_C8", "vector": [14, 3, 0.2697, 0.0112, 3, 0.35, 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_99660:If_L25_C8", "label": "if", "type": "if", "loc": [25, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L23_C8", "vector": [4, 3, 0.2978, 0.0449, 3, 0.35, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif dt < 0:\n sign = 1\n else:\n sign = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L26_C12", "label": "sign =", "type": "assigned_variable", "loc": [26, 26], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L25_C8", "vector": [14, 4, 0.2921, 0.0112, 4, 0.08, 0.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_99660:Assign_L28_C12", "label": "sign =", "type": "assigned_variable", "loc": [28, 28], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L25_C8", "vector": [14, 4, 0.3146, 0.0112, 4, 0.08, 1.0, 448, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "sign", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sign = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L30_C8", "label": "waitForTransform()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L20_C4", "vector": [8, 2, 0.3371, 0.0112, 2, 0.2, 0.25, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.tl.waitForTransform('base_footprint', 'odom_combined', rospy.Time(), rospy.Duration(10))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L31_C8", "label": "p0_base = transform()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L20_C4", "vector": [14, 2, 0.3483, 0.0112, 2, 0.2, 0.375, 460, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "p0_base", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " p0_base = tfu.transform('base_footprint', 'odom_combined', self.tl)# \\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L32_C8", "label": "start_ang =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L20_C4", "vector": [14, 2, 0.3596, 0.0112, 2, 0.2, 0.5, 804, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start_ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_ang = tr.euler_from_matrix(p0_base[0:3, 0:3], 'sxyz')[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L33_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L20_C4", "vector": [14, 2, 0.3708, 0.0112, 2, 0.2, 0.625, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " r = rospy.Rate(100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L34_C8", "label": "dist_so_far =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L20_C4", "vector": [14, 2, 0.382, 0.0112, 2, 0.2, 0.75, 38, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "dist_so_far", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dist_so_far = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L36_C8", "label": "last_ang =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L20_C4", "vector": [14, 2, 0.4045, 0.0112, 2, 0.2, 0.875, 1, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "last_ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " last_ang = start_ang"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L37_C8", "label": "while", "type": "while", "loc": [37, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L20_C4", "vector": [5, 2, 0.5225, 0.2247, 2, 0.2, 1.0, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n pcurrent_base = tfu.transform('base_footprint', 'odom_combined', self.tl) #\\\n current_ang = tr.euler_from_matrix(pcurrent_base[0:3, 0:3], 'sxyz')[2]\n dist_so_far = dist_so_far + (ut.standard_rad(current_ang - last_ang))\n if dt > 0 and dist_so_far > dt:\n rospy.loginfo('stopped! %f %f' % (dist_so_far, dt))\n break\n elif dt < 0 and dist_so_far < dt:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L38_C12", "label": "pcurrent_base = transform()", "type": "assigned_variable", "loc": [38, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L37_C8", "vector": [14, 3, 0.427, 0.0112, 3, 0.02, 0.0, 276, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "pcurrent_base", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " pcurrent_base = tfu.transform('base_footprint', 'odom_combined', self.tl) #\\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L39_C12", "label": "current_ang =", "type": "assigned_variable", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L37_C8", "vector": [14, 3, 0.4382, 0.0112, 3, 0.02, 0.125, 689, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "current_ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " current_ang = tr.euler_from_matrix(pcurrent_base[0:3, 0:3], 'sxyz')[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L40_C12", "label": "dist_so_far =", "type": "assigned_variable", "loc": [40, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L37_C8", "vector": [14, 3, 0.4494, 0.0112, 3, 0.02, 0.25, 38, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dist_so_far", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dist_so_far = dist_so_far + (ut.standard_rad(current_ang - last_ang))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L41_C12", "label": "if", "type": "if", "loc": [41, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L37_C8", "vector": [4, 3, 0.5056, 0.1011, 3, 0.02, 0.375, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dt > 0 and dist_so_far > dt:\n rospy.loginfo('stopped! %f %f' % (dist_so_far, dt))\n break\n elif dt < 0 and dist_so_far < dt:\n rospy.loginfo('stopped! %f %f' % (dist_so_far, dt))\n break \n elif dt == 0: \n rospy.loginfo('stopped! %f %f' % (dist_so_far, dt))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L42_C16", "label": "loginfo()", "type": "expression", "loc": [42, 42], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L41_C12", "vector": [8, 4, 0.4719, 0.0112, 4, 0.93, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('stopped! %f %f' % (dist_so_far, dt))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L44_C12", "label": "if", "type": "if", "loc": [44, 49], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L41_C12", "vector": [4, 4, 0.5225, 0.0674, 4, 0.93, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif dt < 0 and dist_so_far < dt:\n rospy.loginfo('stopped! %f %f' % (dist_so_far, dt))\n break \n elif dt == 0: \n rospy.loginfo('stopped! %f %f' % (dist_so_far, dt))\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L45_C16", "label": "loginfo()", "type": "expression", "loc": [45, 45], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L44_C12", "vector": [8, 5, 0.5056, 0.0112, 5, 0.37, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('stopped! %f %f' % (dist_so_far, dt))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L47_C12", "label": "if", "type": "if", "loc": [47, 49], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L44_C12", "vector": [4, 5, 0.5393, 0.0337, 5, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif dt == 0: \n rospy.loginfo('stopped! %f %f' % (dist_so_far, dt))\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L48_C16", "label": "loginfo()", "type": "expression", "loc": [48, 48], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L47_C12", "vector": [8, 6, 0.5393, 0.0112, 6, 0.91, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('stopped! %f %f' % (dist_so_far, dt))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L51_C12", "label": "tw = Twist()", "type": "assigned_variable", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L37_C8", "vector": [14, 3, 0.573, 0.0112, 3, 0.02, 0.5, 656, 3, 0, 0, 0, 9, 10, 1], "semantic": {"name": "tw", "arg_names": [], "import_names": [], "rhs_call_name": "Twist", "annotation": ""}, "snippet": " tw = gm.Twist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L52_C12", "label": "tw.angular.z = radians()", "type": "assigned_variable", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L37_C8", "vector": [14, 3, 0.5843, 0.0112, 3, 0.02, 0.625, 305, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "tw.angular.z", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " tw.angular.z = math.radians(speed * sign)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L54_C12", "label": "publish()", "type": "expression", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L37_C8", "vector": [8, 3, 0.6067, 0.0112, 3, 0.02, 0.75, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.tw_pub.publish(tw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L55_C12", "label": "sleep()", "type": "expression", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L37_C8", "vector": [8, 3, 0.618, 0.0112, 3, 0.02, 0.875, 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_99660:Assign_L56_C12", "label": "last_ang =", "type": "assigned_variable", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L37_C8", "vector": [14, 3, 0.6292, 0.0112, 3, 0.02, 1.0, 1, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "last_ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " last_ang = current_ang"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L58_C4", "label": "go_x", "type": "function", "loc": [58, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:ClassDef_L14_C0", "vector": [2, 1, 0.7978, 0.3034, 1, 0.92, 1.0, 335, 0, 3, 0, 0, 0, 0, 20], "semantic": {"name": "go_x", "arg_names": ["self", "x", "speed"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def go_x(self, x, speed):\n print('go x called!')\n vel = speed * np.sign(x)\n self.tl.waitForTransform('base_footprint', 'odom_combined', rospy.Time(), rospy.Duration(10))\n p0_base = tfu.transform('base_footprint', 'odom_combined', self.tl)\n r = rospy.Rate(100)\n\n while not rospy.is_shutdown():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L59_C8", "label": "print()", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L58_C4", "vector": [8, 2, 0.6629, 0.0112, 2, 0.67, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('go x called!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L60_C8", "label": "vel =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L58_C4", "vector": [14, 2, 0.6742, 0.0112, 2, 0.67, 0.2, 527, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel = speed * np.sign(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L61_C8", "label": "waitForTransform()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L58_C4", "vector": [8, 2, 0.6854, 0.0112, 2, 0.67, 0.4, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.tl.waitForTransform('base_footprint', 'odom_combined', rospy.Time(), rospy.Duration(10))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L62_C8", "label": "p0_base = transform()", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L58_C4", "vector": [14, 2, 0.6966, 0.0112, 2, 0.67, 0.6, 460, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "p0_base", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " p0_base = tfu.transform('base_footprint', 'odom_combined', self.tl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L63_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L58_C4", "vector": [14, 2, 0.7079, 0.0112, 2, 0.67, 0.8, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " r = rospy.Rate(100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "label": "while", "type": "while", "loc": [65, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L58_C4", "vector": [5, 2, 0.8371, 0.2247, 2, 0.67, 1.0, 0, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n pcurrent_base = tfu.transform('base_footprint', 'odom_combined', self.tl)\n relative_trans = np.linalg.inv(p0_base) * pcurrent_base\n dist_moved = np.linalg.norm(relative_trans[0:3,3])\n print(\"%s\" % str(dist_moved))\n \n if dist_moved > np.abs(x):\n rospy.loginfo('stopped! error %f' % (np.abs(dist_moved-np.abs(x))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L66_C12", "label": "pcurrent_base = transform()", "type": "assigned_variable", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "vector": [14, 3, 0.7416, 0.0112, 3, 0.25, 0.0, 276, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "pcurrent_base", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " pcurrent_base = tfu.transform('base_footprint', 'odom_combined', self.tl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L67_C12", "label": "relative_trans =", "type": "assigned_variable", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "vector": [14, 3, 0.7528, 0.0112, 3, 0.25, 0.0769, 832, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "relative_trans", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " relative_trans = np.linalg.inv(p0_base) * pcurrent_base"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L68_C12", "label": "dist_moved = norm()", "type": "assigned_variable", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "vector": [14, 3, 0.764, 0.0112, 3, 0.25, 0.1538, 696, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "dist_moved", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " dist_moved = np.linalg.norm(relative_trans[0:3,3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L69_C12", "label": "print()", "type": "expression", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "vector": [8, 3, 0.7753, 0.0112, 3, 0.25, 0.2308, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"%s\" % str(dist_moved))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L71_C12", "label": "if", "type": "if", "loc": [71, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "vector": [4, 3, 0.809, 0.0337, 3, 0.25, 0.3077, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dist_moved > np.abs(x):\n rospy.loginfo('stopped! error %f' % (np.abs(dist_moved-np.abs(x))))\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L72_C16", "label": "loginfo()", "type": "expression", "loc": [72, 72], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L71_C12", "vector": [8, 4, 0.809, 0.0112, 4, 0.13, 0.0, 607, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('stopped! error %f' % (np.abs(dist_moved-np.abs(x))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L75_C12", "label": "tw = Twist()", "type": "assigned_variable", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "vector": [14, 3, 0.8427, 0.0112, 3, 0.25, 0.3846, 656, 3, 0, 0, 0, 9, 10, 1], "semantic": {"name": "tw", "arg_names": [], "import_names": [], "rhs_call_name": "Twist", "annotation": ""}, "snippet": " tw = gm.Twist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L76_C12", "label": "tw.linear.x =", "type": "assigned_variable", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "vector": [14, 3, 0.8539, 0.0112, 3, 0.25, 0.4615, 338, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tw.linear.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tw.linear.x = vel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L77_C12", "label": "tw.linear.y =", "type": "assigned_variable", "loc": [77, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "vector": [14, 3, 0.8652, 0.0112, 3, 0.25, 0.5385, 571, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "tw.linear.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tw.linear.y = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L78_C12", "label": "tw.linear.z =", "type": "assigned_variable", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "vector": [14, 3, 0.8764, 0.0112, 3, 0.25, 0.6154, 94, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "tw.linear.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tw.linear.z = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L79_C12", "label": "tw.angular.x =", "type": "assigned_variable", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "vector": [14, 3, 0.8876, 0.0112, 3, 0.25, 0.6923, 307, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "tw.angular.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tw.angular.x = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L80_C12", "label": "tw.angular.y =", "type": "assigned_variable", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "vector": [14, 3, 0.8989, 0.0112, 3, 0.25, 0.7692, 797, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "tw.angular.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tw.angular.y = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L81_C12", "label": "tw.angular.z =", "type": "assigned_variable", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "vector": [14, 3, 0.9101, 0.0112, 3, 0.25, 0.8462, 305, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "tw.angular.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tw.angular.z = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L83_C12", "label": "publish()", "type": "expression", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "vector": [8, 3, 0.9326, 0.0112, 3, 0.25, 0.9231, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.tw_pub.publish(tw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L84_C12", "label": "sleep()", "type": "expression", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "vector": [8, 3, 0.9438, 0.0112, 3, 0.25, 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_99660:If_L86_C0", "label": "if", "type": "if", "loc": [86, 89], "level": 0, "parent": null, "vector": [4, 0, 0.9831, 0.0449, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n m = MoveBase()\n #m.go_ang(-390, 100)\n m.go_x(.2, .05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L87_C4", "label": "m = MoveBase()", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L86_C0", "vector": [14, 1, 0.9775, 0.0112, 1, 0.5, 0.0, 711, 3, 0, 0, 0, 11, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "MoveBase", "annotation": ""}, "snippet": " m = MoveBase()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L89_C4", "label": "go_x()", "type": "expression", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L86_C0", "vector": [8, 1, 1.0, 0.0112, 1, 0.5, 1.0, 335, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "go_x", "arg_names": [], "import_names": [], "rhs_call_name": "go_x", "annotation": ""}, "snippet": " m.go_x(.2, .05)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99660:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L23_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L24_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L23_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L25_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L26_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L25_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L28_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L38_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L40_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L41_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L42_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L41_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L44_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L45_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L44_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L47_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L48_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L71_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L72_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L77_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:While_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99660:If_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99660:Expr_L89_C4"}]
import csv import roslib; roslib.load_manifest('hai_sandbox') from cv_bridge.cv_bridge import CvBridge, CvBridgeError import rospy import cv import sys import hrl_lib.rutils as ru import hrl_lib.tf_utils as tfu import tf.transformations as tr import tf import hrl_camera.ros_camera as cam from sensor_msgs.msg import CameraInfo import numpy as np import hai_sandbox.features as fea import os.path as pt import hrl_lib.util as ut import scipy.cluster.vq as vq def csv_bag_names(fname): csv_file = open(fname) for bag_name in csv.reader(csv_file): yield bag_name csv_file.close() def gen_pkl_name(path_complete, ext): #path_complete = path_complete[0] path_bag, name_bag = pt.split(path_complete) root_name, _ = pt.splitext(name_bag) surf_path_complete = pt.join(path_bag, root_name + ext) return surf_path_complete def features_mat(features_list): features = [] for msg_t, surf in features_list: features.append(np.matrix(surf[1]).T) return np.column_stack(tuple(features)) def features_mat_compress(fmat, k): #k = max(int(round(fmat.shape[1] * percent)), 1) rospy.loginfo('compressing to %d centers' % k) center_indices = np.random.permutation(fmat.shape[1])[0:k] initial_centers = fmat[:, center_indices] kresults = vq.kmeans(np.array(fmat.T), np.array(initial_centers.T)) return np.matrix(kresults[0]).T def compress_pkl(surf_path_complete): features_list = ut.load_pickle(surf_path_complete) rospy.loginfo('making matrix') fmat = features_mat(features_list) rospy.loginfo('compressing') reduced_features = features_mat_compress(fmat, 1000) small_pickle_fname = gen_pkl_name(path_complete, '.surf_sm_pkl') ut.save_pickle(reduced_features, small_pickle_fname) rospy.loginfo('saved to %s' % small_pickle_fname) if __name__ == '__main__': ## # "compresss" large pkls path_complete = sys.argv[1] #for path_complete in csv_bag_names(fname): surf_path_complete = gen_pkl_name(path_complete, ext=".surf_pkl") rospy.loginfo('loading %s' % surf_path_complete) compress_pkl(surf_path_complete) rospy.loginfo('done') exit() #forearm_cam_l = '/l_forearm_cam/image_rect_color' #ws_l = '/wide_stereo/left/image_rect_color' #ws_r = '/wide_stereo/right/image_rect_color' #features_list = find_image_features(sys.argv[1], forearm_cam_l) #Find all features in all videos that we have #list_of_features_list = [] #list_of_features_list.append(reduced_features) #break #ut.save_pickle(list_of_features_list, 'reduced_all_features.pkl') #pdb.set_trace() #Put all features into one large matrix, cluster... #for message_t, surf in list_of_features_list: # keypoints, descriptors = surf #Kmean wants row vectors #What happens if we have many duplicated points? #whitened = vq.whiten(features) #book = np.array((whitened[0],whitened[2])) #vq.kmeans(whitened, book)
ajibawa-2023/Python-Code-Large/train/row_99662
55
114
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Import_L1_C0", "label": "csv import csv", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0088, 0.0088, 0, 0.66, 0.0, 312, 0, 1, 0, 0, 312, 0, 0], "semantic": {"name": "csv", "arg_names": [], "import_names": ["csv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import csv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0175, 0.0088, 0, 0.66, 0.0435, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L2_C15", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0175, 0.0088, 0, 0.66, 0.087, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:ImportFrom_L3_C0", "label": "from cv_bridge.cv_bridge import CvBridge, CvBridgeError", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0088, 0, 0.66, 0.1304, 356, 0, 2, 0, 0, 356, 0, 0], "semantic": {"name": "cv_bridge.cv_bridge", "arg_names": [], "import_names": ["CvBridge", "CvBridgeError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from cv_bridge.cv_bridge import CvBridge, CvBridgeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0351, 0.0088, 0, 0.66, 0.1739, 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_99662:Import_L5_C0", "label": "cv import cv", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0439, 0.0088, 0, 0.66, 0.2174, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Import_L6_C0", "label": "sys import sys", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0088, 0, 0.66, 0.2609, 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_99662:Import_L8_C0", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0702, 0.0088, 0, 0.66, 0.3043, 847, 0, 1, 0, 0, 847, 0, 0], "semantic": {"name": "hrl_lib.rutils", "arg_names": [], "import_names": ["ru"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.rutils as ru"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Import_L9_C0", "label": "hrl_lib.tf_utils import tfu", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0789, 0.0088, 0, 0.66, 0.3478, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "hrl_lib.tf_utils", "arg_names": [], "import_names": ["tfu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.tf_utils as tfu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Import_L10_C0", "label": "tf.transformations import tr", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0877, 0.0088, 0, 0.66, 0.3913, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Import_L11_C0", "label": "tf import tf", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0965, 0.0088, 0, 0.66, 0.4348, 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_99662:Import_L12_C0", "label": "hrl_camera.ros_camera import cam", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1053, 0.0088, 0, 0.66, 0.4783, 798, 0, 1, 0, 0, 798, 0, 0], "semantic": {"name": "hrl_camera.ros_camera", "arg_names": [], "import_names": ["cam"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_camera.ros_camera as cam"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:ImportFrom_L13_C0", "label": "from sensor_msgs.msg import CameraInfo", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.114, 0.0088, 0, 0.66, 0.5217, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["CameraInfo"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import CameraInfo"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Import_L14_C0", "label": "numpy import np", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1228, 0.0088, 0, 0.66, 0.5652, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Import_L15_C0", "label": "hai_sandbox.features import fea", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1316, 0.0088, 0, 0.66, 0.6087, 673, 0, 1, 0, 0, 673, 0, 0], "semantic": {"name": "hai_sandbox.features", "arg_names": [], "import_names": ["fea"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hai_sandbox.features as fea"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Import_L16_C0", "label": "os.path import pt", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1404, 0.0088, 0, 0.66, 0.6522, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["pt"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os.path as pt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Import_L17_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1491, 0.0088, 0, 0.66, 0.6957, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Import_L18_C0", "label": "scipy.cluster.vq import vq", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1579, 0.0088, 0, 0.66, 0.7391, 67, 0, 1, 0, 0, 67, 0, 0], "semantic": {"name": "scipy.cluster.vq", "arg_names": [], "import_names": ["vq"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.cluster.vq as vq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L20_C0", "label": "csv_bag_names", "type": "function", "loc": [20, 24], "level": 0, "parent": null, "vector": [2, 0, 0.193, 0.0439, 0, 0.66, 0.7826, 898, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "csv_bag_names", "arg_names": ["fname"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def csv_bag_names(fname):\n csv_file = open(fname)\n for bag_name in csv.reader(csv_file):\n yield bag_name\n csv_file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L21_C4", "label": "csv_file = open()", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L20_C0", "vector": [14, 1, 0.1842, 0.0088, 1, 0.88, 0.0, 661, 3, 1, 0, 0, 693, 10, 1], "semantic": {"name": "csv_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " csv_file = open(fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:For_L22_C4", "label": "for bag_name", "type": "for", "loc": [22, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L20_C0", "vector": [6, 1, 0.1974, 0.0175, 1, 0.88, 0.5, 985, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bag_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for bag_name in csv.reader(csv_file):\n yield bag_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L23_C8", "label": "expression", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:For_L22_C4", "vector": [8, 2, 0.2018, 0.0088, 2, 0.24, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield bag_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L24_C4", "label": "close()", "type": "expression", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L20_C0", "vector": [8, 1, 0.2105, 0.0088, 1, 0.88, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " csv_file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L26_C0", "label": "gen_pkl_name", "type": "function", "loc": [26, 31], "level": 0, "parent": null, "vector": [2, 0, 0.25, 0.0526, 0, 0.66, 0.8261, 412, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "gen_pkl_name", "arg_names": ["path_complete", "ext"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def gen_pkl_name(path_complete, ext):\n #path_complete = path_complete[0]\n path_bag, name_bag = pt.split(path_complete)\n root_name, _ = pt.splitext(name_bag)\n surf_path_complete = pt.join(path_bag, root_name + ext)\n return surf_path_complete"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L28_C4", "label": "path_bag, name_bag = split()", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L26_C0", "vector": [14, 1, 0.2456, 0.0088, 1, 0.54, 0.0, 666, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "path_bag, name_bag", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " path_bag, name_bag = pt.split(path_complete)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L29_C4", "label": "root_name, _ = splitext()", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L26_C0", "vector": [14, 1, 0.2544, 0.0088, 1, 0.54, 0.3333, 746, 3, 1, 0, 0, 622, 10, 1], "semantic": {"name": "root_name, _", "arg_names": [], "import_names": [], "rhs_call_name": "splitext", "annotation": ""}, "snippet": " root_name, _ = pt.splitext(name_bag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L30_C4", "label": "surf_path_complete = join()", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L26_C0", "vector": [14, 1, 0.2632, 0.0088, 1, 0.54, 0.6667, 96, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "surf_path_complete", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " surf_path_complete = pt.join(path_bag, root_name + ext)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Return_L31_C4", "label": "return", "type": "return", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L26_C0", "vector": [13, 1, 0.2719, 0.0088, 1, 0.54, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return surf_path_complete"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L33_C0", "label": "features_mat", "type": "function", "loc": [33, 37], "level": 0, "parent": null, "vector": [2, 0, 0.307, 0.0439, 0, 0.66, 0.8696, 555, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "features_mat", "arg_names": ["features_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def features_mat(features_list):\n features = []\n for msg_t, surf in features_list:\n features.append(np.matrix(surf[1]).T)\n return np.column_stack(tuple(features))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L34_C4", "label": "features =", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L33_C0", "vector": [14, 1, 0.2982, 0.0088, 1, 0.33, 0.0, 479, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "features", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " features = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:For_L35_C4", "label": "for msg_t, surf", "type": "for", "loc": [35, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L33_C0", "vector": [6, 1, 0.3114, 0.0175, 1, 0.33, 0.5, 679, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "msg_t, surf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for msg_t, surf in features_list:\n features.append(np.matrix(surf[1]).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L36_C8", "label": "append()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:For_L35_C4", "vector": [8, 2, 0.3158, 0.0088, 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": " features.append(np.matrix(surf[1]).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Return_L37_C4", "label": "return", "type": "return", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L33_C0", "vector": [13, 1, 0.3246, 0.0088, 1, 0.33, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.column_stack(tuple(features))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L39_C0", "label": "features_mat_compress", "type": "function", "loc": [39, 45], "level": 0, "parent": null, "vector": [2, 0, 0.3684, 0.0614, 0, 0.66, 0.913, 921, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "features_mat_compress", "arg_names": ["fmat", "k"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def features_mat_compress(fmat, k):\n #k = max(int(round(fmat.shape[1] * percent)), 1)\n rospy.loginfo('compressing to %d centers' % k)\n center_indices = np.random.permutation(fmat.shape[1])[0:k]\n initial_centers = fmat[:, center_indices]\n kresults = vq.kmeans(np.array(fmat.T), np.array(initial_centers.T))\n return np.matrix(kresults[0]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L41_C4", "label": "loginfo()", "type": "expression", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L39_C0", "vector": [8, 1, 0.3596, 0.0088, 1, 0.57, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('compressing to %d centers' % k)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L42_C4", "label": "center_indices =", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L39_C0", "vector": [14, 1, 0.3684, 0.0088, 1, 0.57, 0.25, 489, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "center_indices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " center_indices = np.random.permutation(fmat.shape[1])[0:k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L43_C4", "label": "initial_centers =", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L39_C0", "vector": [14, 1, 0.3772, 0.0088, 1, 0.57, 0.5, 421, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "initial_centers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " initial_centers = fmat[:, center_indices]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L44_C4", "label": "kresults = kmeans()", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L39_C0", "vector": [14, 1, 0.386, 0.0088, 1, 0.57, 0.75, 177, 3, 2, 0, 0, 622, 10, 3], "semantic": {"name": "kresults", "arg_names": [], "import_names": [], "rhs_call_name": "kmeans", "annotation": ""}, "snippet": " kresults = vq.kmeans(np.array(fmat.T), np.array(initial_centers.T))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Return_L45_C4", "label": "return", "type": "return", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L39_C0", "vector": [13, 1, 0.3947, 0.0088, 1, 0.57, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix(kresults[0]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L47_C0", "label": "compress_pkl", "type": "function", "loc": [47, 57], "level": 0, "parent": null, "vector": [2, 0, 0.4561, 0.0965, 0, 0.66, 0.9565, 138, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "compress_pkl", "arg_names": ["surf_path_complete"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compress_pkl(surf_path_complete):\n features_list = ut.load_pickle(surf_path_complete)\n\n rospy.loginfo('making matrix')\n fmat = features_mat(features_list)\n\n rospy.loginfo('compressing')\n reduced_features = features_mat_compress(fmat, 1000)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L48_C4", "label": "features_list = load_pickle()", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L47_C0", "vector": [14, 1, 0.4211, 0.0088, 1, 0.21, 0.0, 485, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "features_list", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " features_list = ut.load_pickle(surf_path_complete)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L50_C4", "label": "loginfo()", "type": "expression", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L47_C0", "vector": [8, 1, 0.4386, 0.0088, 1, 0.21, 0.1429, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('making matrix')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L51_C4", "label": "fmat = features_mat()", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L47_C0", "vector": [14, 1, 0.4474, 0.0088, 1, 0.21, 0.2857, 94, 3, 1, 0, 0, 555, 10, 1], "semantic": {"name": "fmat", "arg_names": [], "import_names": [], "rhs_call_name": "features_mat", "annotation": ""}, "snippet": " fmat = features_mat(features_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L53_C4", "label": "loginfo()", "type": "expression", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L47_C0", "vector": [8, 1, 0.4649, 0.0088, 1, 0.21, 0.4286, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('compressing')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L54_C4", "label": "reduced_features = features_mat_compress()", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L47_C0", "vector": [14, 1, 0.4737, 0.0088, 1, 0.21, 0.5714, 929, 3, 2, 0, 0, 921, 10, 1], "semantic": {"name": "reduced_features", "arg_names": [], "import_names": [], "rhs_call_name": "features_mat_compress", "annotation": ""}, "snippet": " reduced_features = features_mat_compress(fmat, 1000)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L55_C4", "label": "small_pickle_fname = gen_pkl_name()", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L47_C0", "vector": [14, 1, 0.4825, 0.0088, 1, 0.21, 0.7143, 399, 3, 2, 0, 0, 412, 10, 1], "semantic": {"name": "small_pickle_fname", "arg_names": [], "import_names": [], "rhs_call_name": "gen_pkl_name", "annotation": ""}, "snippet": " small_pickle_fname = gen_pkl_name(path_complete, '.surf_sm_pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L56_C4", "label": "save_pickle()", "type": "expression", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L47_C0", "vector": [8, 1, 0.4912, 0.0088, 1, 0.21, 0.8571, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(reduced_features, small_pickle_fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L57_C4", "label": "loginfo()", "type": "expression", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L47_C0", "vector": [8, 1, 0.5, 0.0088, 1, 0.21, 1.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('saved to %s' % small_pickle_fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:If_L59_C0", "label": "if", "type": "if", "loc": [59, 68], "level": 0, "parent": null, "vector": [4, 0, 0.557, 0.0877, 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 ##\n # \"compresss\" large pkls\n path_complete = sys.argv[1]\n #for path_complete in csv_bag_names(fname):\n surf_path_complete = gen_pkl_name(path_complete, ext=\".surf_pkl\")\n rospy.loginfo('loading %s' % surf_path_complete)\n compress_pkl(surf_path_complete)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L62_C4", "label": "path_complete =", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:If_L59_C0", "vector": [14, 1, 0.5439, 0.0088, 1, 0.81, 0.0, 98, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "path_complete", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " path_complete = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L64_C4", "label": "surf_path_complete = gen_pkl_name()", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:If_L59_C0", "vector": [14, 1, 0.5614, 0.0088, 1, 0.81, 0.2, 96, 3, 2, 0, 0, 412, 10, 1], "semantic": {"name": "surf_path_complete", "arg_names": [], "import_names": [], "rhs_call_name": "gen_pkl_name", "annotation": ""}, "snippet": " surf_path_complete = gen_pkl_name(path_complete, ext=\".surf_pkl\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L65_C4", "label": "loginfo()", "type": "expression", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:If_L59_C0", "vector": [8, 1, 0.5702, 0.0088, 1, 0.81, 0.4, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('loading %s' % surf_path_complete)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L66_C4", "label": "compress_pkl()", "type": "expression", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:If_L59_C0", "vector": [8, 1, 0.5789, 0.0088, 1, 0.81, 0.6, 138, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "compress_pkl", "arg_names": [], "import_names": [], "rhs_call_name": "compress_pkl", "annotation": ""}, "snippet": " compress_pkl(surf_path_complete)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L67_C4", "label": "loginfo()", "type": "expression", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:If_L59_C0", "vector": [8, 1, 0.5877, 0.0088, 1, 0.81, 0.8, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('done')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L68_C4", "label": "exit()", "type": "expression", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99662:If_L59_C0", "vector": [8, 1, 0.5965, 0.0088, 1, 0.81, 1.0, 436, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " exit()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:For_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:For_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Return_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:For_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:For_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Return_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Return_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:If_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:If_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:If_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:If_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:If_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99662:If_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99662:Expr_L68_C4"}]
import roslib; roslib.load_manifest('hai_sandbox') import rospy import glob import hrl_lib.rutils as ru import hrl_pr2_lib.devices as hpr2 import hai_sandbox.bag_processor as bp import hrl_lib.util as ut import visualization_msgs.msg as vm import numpy as np import hrl_lib.viz as viz import hai_sandbox.dimreduce as dimreduce import sensor_msgs.msg as sm import scipy.spatial as sp import pdb import scipy.stats as kde import pr2_msgs.msg as pm import threading ## # Takes in a folder, outputs a dictionary organized by data by contact segment, # topic, list of {'left', 'right', 't'} # def success_failure_classification_preprocess(folder_name): data_dict = None #counter = 0 for bag_name in glob.glob('%s/*.bag' % folder_name): print 'Loading bag %s' % bag_name topics_dict = ru.bag_sel(bag_name, ['/imitate_behavior_marker', '/pressure/l_gripper_motor', '/pressure/r_gripper_motor', '/accelerometer/l_gripper_motor', '/accelerometer/r_gripper_motor', '/joint_states', '/l_cart/command_pose', '/r_cart/command_pose']) ##break each mat into segments based on states #/imitate_behavior_marker #topics_dict['/imitate_behavior_marker']['t'] print 'There are %d marker messages.' % len(topics_dict['/imitate_behavior_marker']['msg']) time_segments = [[]] for marker_msg in topics_dict['/imitate_behavior_marker']['msg']: if len(time_segments[-1]) >= 2: time_segments.append([]) time_segments[-1].append(marker_msg.header.stamp.to_time()) if data_dict == None: data_dict = {} #organize by segment, then by type, then by what that type will store for i in range(len(time_segments)): data_dict[i] = {} ###pressure mat with times ##/pressure/l_gripper_motor ##/pressure/r_gripper_motor for ptop in ['/pressure/l_gripper_motor', '/pressure/r_gripper_motor']: p = topics_dict[ptop] psegs = bp.segment_msgs(time_segments, p['msg']) print '>> Separated records of %s (%s) into %d segments' % (ptop, bag_name, len(psegs)) #convert segments into mats for i, pseg in enumerate(psegs): #each col is an example in left-f and right_f left_f, right_f, ptimes = hpr2.pressure_state_to_mat(pseg) if not data_dict[i].has_key(ptop): data_dict[i][ptop] = [] data_dict[i][ptop].append({'left': left_f, 'right': right_f, 't': ptimes}) for ptop in ['/pressure/l_gripper_motor', '/pressure/r_gripper_motor']: for k in data_dict.keys(): print '>>', k, ptop, len(data_dict[k][ptop]) return data_dict def select_time(data, time_rec, time_start, time_end): #pdb.set_trace() return data[:, np.where(np.multiply(time_rec >= time_start, time_rec < time_end))[0]] def break_record_matrices_into_chunks(data_dict, segmented_matrices, \ minimal_trial_lengths, chunk_times, topic): #For each state data_sets = {} for state in range(len(data_dict.keys())): data_sets[state] = {} time_starts = np.arange(0, minimal_trial_lengths[state], chunk_times[state]) time_ends = np.arange(chunk_times[state], minimal_trial_lengths[state] + chunk_times[state], chunk_times[state]) #Go over all the records for record_number in range(len(data_dict[state][topic])): time_rec = segmented_matrices[record_number]['t'][state] time_rec = time_rec - time_rec[0] #Break them up into little chunks for tidx in range(len(time_starts)): if not data_sets[state].has_key(tidx): data_sets[state][tidx] = {} data_sets[state][tidx]['data'] = [] data_sets[state][tidx]['time'] = [time_starts[tidx], time_ends[tidx]] #pdb.set_trace() data_chunk = select_time(segmented_matrices[record_number]['mat'][state], time_rec, time_starts[tidx], time_ends[tidx]) data_sets[state][tidx]['data'].append(data_chunk) return data_sets class TimeSeriesVectorizer: def __init__(self): self.channels = {} self.buffer_lengths = {} def register_listener(self, vectorize_func, msg_type, topic, buffer_length_secs): self.buffer_lengths[topic] = buffer_length_secs def listener_func(msg): amat = vectorize_func(msg) t = np.matrix([msg.header.stamp.to_time()]) got_lock = False if self.channels[topic][0] == None: self.channels[topic] = [amat, t, threading.RLock()] else: lock = self.channels[topic][2] lock.acquire() got_lock = True #print 'l locked' new_record = [np.column_stack((self.channels[topic][0], amat)), np.column_stack((self.channels[topic][1], t)), lock] #print 'got something', new_record[0].shape self.channels[topic] = new_record #print 'after appending', self.channels[topic][0].shape, self.channels[topic][1].shape #print 'time recorded is', t[0,0] #print 'shape', self.channels[topic][0].shape #lock.release() #print 'l released' lock = self.channels[topic][2] if not got_lock: lock.acquire() #lock.acquire() #select only messages n-seconds ago n_seconds_ago = t[0,0] - buffer_length_secs records_in_range = (np.where(self.channels[topic][1] >= n_seconds_ago)[1]).A1 #print records_in_range, self.channels[topic][0].shape self.channels[topic][0] = self.channels[topic][0][:, records_in_range] self.channels[topic][1] = self.channels[topic][1][:, records_in_range] #print 'after shortening', self.channels[topic][0].shape, self.channels[topic][1].shape #print 'shape after selection...', self.channels[topic][0].shape lock.release() self.channels[topic] = [None] rospy.Subscriber(topic, msg_type, listener_func) def get_n_steps(self, topic, timestart, nsteps, wait=True): #print 'timestart is', timestart if self.channels[topic][0] != None: if timestart < self.channels[topic][1][0,0]: # [0,0] is the earliest, and [0,-1] is the latest #print self.channels[topic][1][0,0], self.channels[topic][1][0,-1], self.channels[topic][1].shape #print 'diff', self.channels[topic][1][0,0] - timestart #print 'diff', self.channels[topic][1][0,-1] - timestart #print timestart, self.channels[topic][1][0,0] raise RuntimeError('timestart <= self.channels[topic][1][0,0]') r = rospy.Rate(100) selected = None while selected == None: if self.channels[topic][0] == None: r.sleep() continue lock = self.channels[topic][2] lock.acquire() #print 'g locked' #print self.channels[topic][0].shape record_idxs = (np.where(self.channels[topic][1] > timestart)[1]).A1 #print self.channels[topic][0].shape, self.channels[topic][1].shape #print record_idxs #print record_idxs, self.channels[topic][0].shape records_from_time = self.channels[topic][0][:, record_idxs] #print 'records_from_time', records_from_time.shape, 'need', nsteps #print '>>' selected = records_from_time[:, :nsteps] lock.release() #print 'g released' #r.sleep() if selected.shape[1] < nsteps: if not wait: return None else: selected = None r.sleep() else: return selected def get_range(self, topic, time_start, time_end): times = self.channels[topic][1] selected = self.channels[topic][0][:, np.where((times > time_start) * (times <= time_end))] return selected #class SuccessProbabilityEstimator: class TestOnlineClassification: def __init__(self): rospy.init_node('success_classifier') self.vectorizer = TimeSeriesVectorizer() def pressure_vectorizer(pmsg): return np.row_stack((np.matrix((pmsg.l_finger_tip)).T, np.matrix((pmsg.r_finger_tip)).T)) self.vectorizer.register_listener(pressure_vectorizer, pm.PressureState, '/pressure/l_gripper_motor', 15.) def start_classifying(self): #print 'start_classifying' segment_idx = 0 segment_lengths = [10, 10, 10] n_segments = len(segment_lengths) for segment_idx in range(n_segments): n_steps = segment_lengths[segment_idx] #print 'getting_n_steps' selected = self.vectorizer.get_n_steps('/pressure/l_gripper_motor', \ rospy.get_rostime().to_time(), n_steps) print 'selected.shpae', selected.shape print selected print 'done!' class TimeSeriesClassifier: def __init__(self): rospy.init_node('time_series_classifier') self.vectorizer = TimeSeriesVectorizer() def pressure_vectorizer(pmsg): return np.row_stack((np.matrix((pmsg.l_finger_tip)).T, np.matrix((pmsg.r_finger_tip)).T)) self.vectorizer.register_listener(pressure_vectorizer, pm.PressureState, \ '/pressure/l_gripper_motor', 15.) #TEST this when you have robot time! def run(self): #models = self.models['models'] for state in range(len(self.models['models'])): for chunk_idx in range(len(self.models['models'][state])): xmat = self.fetch_data(state, chunk_idx) print self.probability(xmat, state, chunk_idx) def fetch_data(self, state, chunk_idx): chunk_params = self.models['chunk_params'] n_steps = chunk_params['chunk_dim'][state][chunk_idx] x_mat = self.vectorizer.get_n_steps('/pressure/l_gripper_motor', \ rospy.get_rostime().to_time(), n_steps) return x_mat def probability(self, x_mat, state, chunk_idx, successp): models = self.models['models'] chunk_params = self.models['chunk_params'] #Subtract out the mean x_vec = np.reshape(x_mat, (x_mat.shape[0] * x_mat.shape[1], 1)) - models[state][chunk_idx]['mean'] #project projected_x = np.array((models[state][chunk_idx]['project'].T * x_vec).T) succ_prob = models[state][chunk_idx]['kde'][0].evaluate(np.array(projected_x)) fail_prob = models[state][chunk_idx]['kde'][1].evaluate(np.array(projected_x)) succ_total = np.sum(models[state][chunk_idx]['labels']) / float(models[state][chunk_idx]['labels'].shape[1]) fail_total = 1 - succ_total if successp: prob = (succ_prob * succ_total) / ((fail_prob*fail_total) + (succ_total*succ_prob)) else: prob = (fail_prob * fail_total) / ((fail_prob*fail_total) + (succ_total*succ_prob)) #print succ_prob, fail_prob, fail_total, succ_total n_steps = chunk_params['chunk_dim'][state][chunk_idx] print 'frame size %d state %d chunk %d prob %.3f' % (n_steps, state, chunk_idx, prob) return prob def save_models(self, name='timeseries_pca_model.pkl'): print 'saving models' ut.save_pickle(self.models, name) def load_models(self, name='timeseries_pca_model.pkl'): print 'loading models' self.models = ut.load_pickle(name) #print self.models.__class__, self.models.keys() models = self.models['models'] for state in range(len(models.keys())): for chunk_idx in range(len(models[state])): #print models.keys() reduced_data = models[state][chunk_idx]['reduced'] #labels = np.column_stack((np.matrix(np.ones((1, num_pos))), np.matrix(np.zeros((1, num_neg))))) success_data = reduced_data[:, (np.where(models[state][chunk_idx]['labels'] > 0))[1].A1] failure_data = reduced_data[:, (np.where(models[state][chunk_idx]['labels'] == 0))[1].A1] models[state][chunk_idx]['kde'] = [kde.gaussian_kde(np.array(success_data)), kde.gaussian_kde(np.array(failure_data))] #models[state][chunk_idx]['tree'] = sp.KDTree(np.array(reduced_data.T)) def create_model(self, succ_pickle, fail_pickle): print 'creating model...' topic = '/pressure/l_gripper_motor' SEGMENT_LENGTH = 1.0 VARIANCE_KEEP = .7 # load in pickle print 'loading pickles' successes = ut.load_pickle(succ_pickle) failures = ut.load_pickle(fail_pickle) #chop data set into little chunks # data_sets[state][chunk_idx]['data', 'time'][chunk_record] print 'preprocess pickles' success_data_sets, failure_data_sets, chunk_params = self.preprocess_pickles(successes, \ failures, topic, SEGMENT_LENGTH) # turn each set of records into a matrix combined_sets = {} for dset_name, datasets in zip(['success', 'failure'], [success_data_sets, failure_data_sets]): #merge the two matrices from mat_set mat_set = self.create_matrix_from_chunked_datasets(datasets) for state in range(len(datasets.keys())): if not combined_sets.has_key(state): combined_sets[state] = {} for chunk_idx in range(len(datasets[state])): if not combined_sets[state].has_key(chunk_idx): combined_sets[state][chunk_idx] = {} combined_sets[state][chunk_idx][dset_name] = mat_set[state][chunk_idx]['data'] combined_sets[state][chunk_idx]['time'] = mat_set[state][chunk_idx]['time'] # run PCA over the entire set models = {} for state in range(len(combined_sets.keys())): models[state] = [] for chunk_idx in range(len(combined_sets[state])): print 'building model for state', state, 'chunk idx', chunk_idx # pdb.set_trace() data_chunk = np.column_stack((combined_sets[state][chunk_idx]['success'], \ combined_sets[state][chunk_idx]['failure'])) num_pos = combined_sets[state][chunk_idx]['success'].shape[1] num_neg = combined_sets[state][chunk_idx]['failure'].shape[1] labels = np.column_stack((np.matrix(np.ones((1, num_pos))), np.matrix(np.zeros((1, num_neg))))) projection_basis, dmean = dimreduce.pca_vectors(data_chunk, VARIANCE_KEEP) print 'pca_basis: number of dimensions', projection_basis.shape[1] reduced_data = projection_basis.T * (data_chunk-dmean) models[state].append({'time': combined_sets[state][chunk_idx]['time'], 'project': projection_basis, 'reduced': reduced_data, 'labels': labels, 'mean': dmean, 'data': data_chunk #'tree': sp.KDTree(np.array(reduced_data.T)) }) self.models = {'models':models, 'chunk_params': chunk_params} def create_matrix_from_chunked_datasets(self, datasets): mat_set = {} for state in range(len(datasets.keys())): mat_set[state] = {} for chunk_idx in range(len(datasets[state])): records_l = [] for chunk_record in range(len(datasets[state][chunk_idx]['data'])): a = datasets[state][chunk_idx]['data'][chunk_record] records_l.append(np.reshape(a, (a.shape[0]*a.shape[1], 1))) mat_set[state][chunk_idx] = {} mat_set[state][chunk_idx]['data'] = np.column_stack(records_l) mat_set[state][chunk_idx]['time'] = datasets[state][chunk_idx]['time'] return mat_set def preprocess_pickles(self, successes, failures, topic, segment_length): #Break matrices into segments based on state # list of list of 44xN matrices success_matrices_segmented_by_state = construct_list_of_segmented_matrices_from_trial_recording(successes, topic) failure_matrices_segmented_by_state = construct_list_of_segmented_matrices_from_trial_recording(failures, topic) #Calculate how long each chunk needs to be success_trial_durations = find_trial_durations(successes, topic) # trial_durations[state][trial number] failure_trial_durations = find_trial_durations(failures, topic) # trial_durations[state][trial number] #for state in range(len(times_dict.keys())): # durations = [state_times[-1] - state_times[0] for state_times in times_dict[state]] #pdb.set_trace() minimal_trial_lengths = [np.min(np.min(success_trial_durations[state]), np.min(failure_trial_durations[state])) \ for state in range(len(success_trial_durations.keys()))] chunk_times = [length/np.floor(length/segment_length) for length in minimal_trial_lengths] #make little chunks out of the matrices of pressure readings success_data_sets = break_record_matrices_into_chunks(successes, success_matrices_segmented_by_state, \ minimal_trial_lengths, chunk_times, topic) failure_data_sets = break_record_matrices_into_chunks(failures, failure_matrices_segmented_by_state, \ minimal_trial_lengths, chunk_times, topic) #Make sure the little chunks are of the same dimension across positive and negative examples chunk_dim = {} for state in range(len(successes.keys())): chunk_dim[state] = {} for chunk_idx in range(len(success_data_sets[state])): #figure minimum chunk lengths in array size chunk_length_successes = [success_data_sets[state][chunk_idx]['data'][chunk_record].shape[1] \ for chunk_record in range(len(success_data_sets[state][chunk_idx]['data']))] chunk_length_failures = [failure_data_sets[state][chunk_idx]['data'][chunk_record].shape[1] \ for chunk_record in range(len(failure_data_sets[state][chunk_idx]['data']))] #pdb.set_trace() shortest_chunk_length = np.min([np.min(chunk_length_successes), np.min(chunk_length_failures)]) chunk_dim[state][chunk_idx] = shortest_chunk_length #shorten data to shortest_chunk_length #if state == 0 and chunk_idx == 2: # pdb.set_trace() for state in range(len(successes.keys())): for chunk_idx in range(len(success_data_sets[state])): for dataset_idx, data_sets in enumerate([success_data_sets, failure_data_sets]): for chunk_record in range(len(data_sets[state][chunk_idx]['data'])): shortest_chunk_length = chunk_dim[state][chunk_idx] data_sets[state][chunk_idx]['data'][chunk_record] = \ data_sets[state][chunk_idx]['data'][chunk_record][:,:shortest_chunk_length] #if state == 0 and chunk_idx == 2: # #pdb.set_trace() # print data_sets[state][chunk_idx].__class__, 'len(data_sets[state][chunk_idx])', len(data_sets[state][chunk_idx]), 'dataset idx', dataset_idx, 'shortest_chunk_length', shortest_chunk_length, 'shape', data_sets[state][chunk_idx]['data'][chunk_record].shape chunk_params = {'chunk_dim': chunk_dim, 'trial_lengths': minimal_trial_lengths, 'chunk_times': chunk_times, 'topic': topic} return success_data_sets, failure_data_sets, chunk_params def preprocess_individual_pickle(self, apickle): data = ut.load_pickle(apickle) #models, chunk_params = self.models models = self.models['models'] chunk_params = self.models['chunk_params'] #break pickle into chunks given model. #chunks of equivalent time, chunks of equivalent dimensions data_segmented = construct_list_of_segmented_matrices_from_trial_recording(data, chunk_params['topic']) # 1) break into time chunks chunked_data = break_record_matrices_into_chunks(data, data_segmented, \ chunk_params['trial_lengths'], chunk_params['chunk_times'], chunk_params['topic']) # 2) shorten into appropriate dimensions for state in range(len(models)): for chunk_idx in range(len(models[state])): for chunk_record in range(len(chunked_data[state][chunk_idx]['data'])): chunk_length = chunk_params['chunk_dim'][state][chunk_idx] chunked_data[state][chunk_idx]['data'][chunk_record] =\ chunked_data[state][chunk_idx]['data'][chunk_record][:, :chunk_length] return chunked_data def classify_pickle(self, apickle): # a pickle can have multiple records... chunked_data = self.preprocess_individual_pickle(apickle) #mat_set = self.create_matrix_from_chunked_datasets(chunked_data) models = self.models['models'] total_ex = models[0][0]['labels'].shape[1] pos_ex = np.sum(models[0][0]['labels']) neg_ex = total_ex - pos_ex prior_pos = pos_ex / float(total_ex) prior_neg = neg_ex / float(total_ex) results = {} NEIGHBORS = 3 for record_idx in range(len(chunked_data[0][0]['data'])): for state in range(len(models)): if not results.has_key(state): results[state] = {} for chunk_idx in range(len(models[state])): if not results[state].has_key(chunk_idx): results[state][chunk_idx] = [] x_mat = chunked_data[state][chunk_idx]['data'][record_idx] x_vec = np.reshape(x_mat, (x_mat.shape[0] * x_mat.shape[1], 1)) projected_x = np.array((models[state][chunk_idx]['project'].T * x_vec).T) #match_idx = models[state][chunk_idx]['tree'].query(projected_x, NEIGHBORS)[1] #success_density = estimate_density(models[state][chunk_idx]['prob_trees'][0], projected_x) #failure_density = estimate_density(models[state][chunk_idx]['prob_trees'][1], projected_x) # p(x | suc) * p (suc) / sum(), p (x | fail) succ_prob = models[state][chunk_idx]['kde'][0].evaluate(np.array(projected_x)) fail_prob = models[state][chunk_idx]['kde'][1].evaluate(np.array(projected_x)) succ_total = np.sum(models[state][chunk_idx]['labels']) / float(models[state][chunk_idx]['labels'].shape[1]) fail_total = 1 - succ_total prob = (succ_prob * succ_total) / ((fail_prob*fail_total) + (succ_total*succ_prob)) if np.isnan(prob): prob = 0. results[state][chunk_idx].append(prob > .5) print 'record idx %d state %d chunk %d label prob %.2f success? %d' % (record_idx, state, chunk_idx, prob, prob > .5) print '=============================' for state in range(len(models)): for chunk_idx in range(len(models[state])): correct = np.sum(results[state][chunk_idx]) all_val = float(len(results[state][chunk_idx])) print all_val print 'state %d chunk %d results %.3f' % (state, chunk_idx, correct/all_val) def zero_out_time_in_trials(data_dict, topic): #print 'Finding times...' #pdb.set_trace() times_dict = {} # times_dict[state][ list of durations ] for state in range(len(data_dict.keys())): times_dict[state] = [] for record_number in range(len(data_dict[state][topic])): time_start = data_dict[0][topic][record_number]['t'][0] #pdb.set_trace() times_dict[state].append(data_dict[state][topic][record_number]['t'] - time_start) return times_dict def find_trial_durations(data_dict, topic): times_dict = {} # times_dict[state][ list of durations ] for state in range(len(data_dict.keys())): times_dict[state] = [] for record_number in range(len(data_dict[state][topic])): time_start = data_dict[state][topic][record_number]['t'][0] time_end = data_dict[state][topic][record_number]['t'][-1] times_dict[state].append(time_end - time_start) return times_dict def construct_pressure_marker_message(data_dict, topic, base_color=np.matrix([1.,0, 0, 1.]).T): #record_number = 0 STATE_SEPARATION_DIST = .4 points_ll = [] colors_ll = [] pressures_l = [] #Record the duration of each trial times_dict = zero_out_time_in_trials(data_dict, topic) #Use the durations to figure out offsets state_time_offsets = {} state_time_offsets[-1] = {'duration':0, 'offset':0} for state in range(len(times_dict.keys())): durations = [state_times[-1] - state_times[0] for state_times in times_dict[state]] duration_state = np.max(durations) state_time_offsets[state] = {'duration': duration_state, 'offset': state_time_offsets[state-1]['offset'] + state_time_offsets[state-1]['duration'] + STATE_SEPARATION_DIST} print 'state', state, 'offset', state_time_offsets[state]['offset'], 'duration', state_time_offsets[state]['duration'] #Create corrected timelines times_m_list = [] for record_number in range(len(data_dict[0][topic])): #For each state figure out the time offset & store in times_l times_l = [] for i in range(len(data_dict.keys())): #times_l.append(np.matrix(state_time_offsets[i]['offset'] + data_dict[i][topic][record_number]['t'] - data_dict[0][topic][record_number]['t'][0])) curr_times = data_dict[i][topic][record_number]['t'] curr_times = curr_times - curr_times[0] times_l.append(np.matrix(curr_times + state_time_offsets[i]['offset'])) #times_l.append(np.matrix( - data_dict[0][topic][record_number]['t'][0])) #Stack times_l to form times_m times_m = np.column_stack(times_l) times_m_list.append(times_m) print 'constructing segmented matrices...' pressure_mats = [] for lp in construct_list_of_segmented_matrices_from_trial_recording(data_dict, topic): p = np.column_stack(lp) p = p - p[:,0] pressure_mats.append(p) print 'creating colored points...' pressures, all_points, colors_mat = create_colored_3d_points_from_matrices(pressure_mats, times_m_list) print 'creating pointcloud message' #point_cloud = ru.np_to_colored_pointcloud(all_points, np.matrix(pressures) + min_pval, 'pressure_viz') point_cloud = ru.np_to_colored_pointcloud(all_points, np.matrix(pressures), 'pressure_viz') return point_cloud class DisplayDataWithRviz: def __init__(self): rospy.init_node('display_pressure_with_rviz') self.succ_marker = rospy.Publisher('succ_marker', vm.Marker) self.fail_marker = rospy.Publisher('fail_marker', vm.Marker) self.succ_pc_pub = rospy.Publisher('succ_pc', sm.PointCloud) self.fail_pc_pub = rospy.Publisher('fail_pc', sm.PointCloud) def display(self, succ_pickle, fail_pickle): # load in pickle print 'loading...' successes = ut.load_pickle(succ_pickle) failures = ut.load_pickle(fail_pickle) print 'Enter the topic number:' for i, k in enumerate(successes[0].keys()): print i, k topic = successes[0].keys()[int(raw_input())] red = np.matrix([1.,0, 0, 1.]).T green = np.matrix([0.,1., 0, 1.]).T print 'construct_pressure_marker_message(successes, topic, green)' #succ_marker, succ_pc = construct_pressure_marker_message(successes, topic, green) succ_pc = construct_pressure_marker_message(successes, topic, green) print 'construct_pressure_marker_message(failures, topic, red)' #fail_marker, fail_pc = construct_pressure_marker_message(failures, topic, red) fail_pc = construct_pressure_marker_message(failures, topic, red) print 'publishing...' r = rospy.Rate(10) while not rospy.is_shutdown(): self.succ_pc_pub.publish(succ_pc) self.fail_pc_pub.publish(fail_pc) r.sleep() ## # Create matrices split based on state # # @param data_dict [state number] [topic] [trial number] ['t' 'left' 'right'] # @param topic string # @return segmented_matrices[record_number][state_number]['t'] => 1xN array # ['mat'] => 44xN mat def construct_list_of_segmented_matrices_from_trial_recording(data_dict, topic): segmented_matrices = [] for record_number in range(len(data_dict[0][topic])): segmented_matrix = [] trecs = [] for state in range(len(data_dict.keys())): segmented_matrix.append(np.row_stack((data_dict[state][topic][record_number]['left'], data_dict[state][topic][record_number]['right']))) trecs.append(data_dict[state][topic][record_number]['t']) segmented_matrices.append({'mat': segmented_matrix, 't': trecs}) #segmented_matrices.append(segmented_matrix) return segmented_matrices #def construct_marker_message_from_list_of_segmented_matrices(segmented_matrix, slot_number, column_index): def create_colored_3d_points_from_matrices(matrices, index_list): points3d_l = [] colors_ll = [] mat_l = [] X_MULTIPLIER = 1/15. for i, mat in enumerate(matrices): X, Y = np.meshgrid(range(mat.shape[0]), range(mat.shape[1])) x_size = mat.shape[0] * X_MULTIPLIER X = np.matrix(X * X_MULTIPLIER) + x_size * i + (i * x_size / 3.) #Y = (np.matrix(np.ones((mat.shape[0], 1))) * times_m).T Y = (np.matrix(np.ones((mat.shape[0], 1))) * index_list[i]).T Z = np.matrix(np.zeros(mat.shape)).T points = np.row_stack((X.reshape(1, X.shape[0] * X.shape[1]), Y.reshape(1, Y.shape[0] * Y.shape[1]), Z.reshape(1, Z.shape[0] * Z.shape[1]))) colors = np.matrix(np.zeros((4, mat.shape[0]*mat.shape[1]))) mat_l.append(mat.T.reshape((1,mat.shape[1] * mat.shape[0]))) points3d_l.append(points) colors_ll.append(colors) all_mats = np.column_stack(mat_l) all_points = np.column_stack(points3d_l) all_colors = np.column_stack(colors_ll) return all_mats, all_points, all_colors #data_dict [state number] [topic] [trial number] ['t' 'left' 'right'] def average_reading_over_trials(data_dict, topic): #Construct list of list of matrices indexing [state][trial number] => contact information for both fingers contact_info = {} for state in data_dict.keys(): contact_info[state] = [] for trial in data_dict[state][topic]: contact_info[state].append(np.row_stack((trial['left'], trial['right']))) ret_dict = {} #shorten the trials to be the length of the shortest trial for state in contact_info.keys(): shortest_length = np.min([trial.shape[1] for trial in contact_info[state]]) trimmed_mats = [trial[:,:shortest_length] for trial in contact_info[state]] avg_reading = np.matrix(np.sum(np.concatenate([np.reshape(np.array(trial), (trial.shape[0], trial.shape[1], 1)) for trial in trimmed_mats], 2), 2) / len(trimmed_mats)) div_point = avg_reading.shape[0]/2. assert(div_point == 22) ret_dict[state] = {topic: [{'t': data_dict[state][topic][0]['t'][:shortest_length] ,#contact_info[state][0][:shortest_length], 'left': avg_reading[:div_point,:], 'right': avg_reading[div_point:,:]}] } return ret_dict def subtract_records(recorda, recordb, topic): ret_dict = {} for state in recorda.keys(): shortest_length = min(recorda[state][topic][0]['left'].shape[1], recordb[state][topic][0]['left'].shape[1]) ret_dict[state] = {topic: [{ 't': recorda[state][topic][0]['t'][:shortest_length], 'left': np.abs(recorda[state][topic][0]['left'][:,:shortest_length] - recordb[state][topic][0]['left'][:,:shortest_length]), 'right': np.abs(recorda[state][topic][0]['right'][:,:shortest_length] - recordb[state][topic][0]['right'][:,:shortest_length]) }]} return ret_dict #Debug this! class DiffDisplay: def __init__(self): rospy.init_node('diff_display') self.fail_marker = rospy.Publisher('diff_fail_avg', vm.Marker) self.fail_pc_pub = rospy.Publisher('diff_fail_pc', sm.PointCloud) self.succ_marker = rospy.Publisher('diff_succ_avg', vm.Marker) self.succ_pc_pub = rospy.Publisher('diff_succ_pc', sm.PointCloud) self.diff_marker = rospy.Publisher('diff_avg', vm.Marker) self.diff_pc_pub = rospy.Publisher('diff_pc', sm.PointCloud) def display(self, succ_pickle, fail_pickle): # load in pickle print 'loading...' successes = ut.load_pickle(succ_pickle) failures = ut.load_pickle(fail_pickle) topics = ['/pressure/l_gripper_motor', '/pressure/r_gripper_motor'] topic = topics[0] red = np.matrix([1., 0, 0, 1.]).T green = np.matrix([0., 1., 0, 1.]).T blue = np.matrix([0., 0, 1., 1.]).T #data_dict [state number] [topic] [trial number] ['t' 'left' 'right'] succ_avg = average_reading_over_trials(successes, topic) fail_avg = average_reading_over_trials(failures, topic) diff_avg = subtract_records(succ_avg, fail_avg, topic) succ_marker, succ_pc = construct_pressure_marker_message(succ_avg, topic, green) fail_marker, fail_pc = construct_pressure_marker_message(fail_avg, topic, red) diff_marker, diff_pc = construct_pressure_marker_message(diff_avg, topic, blue) r = rospy.Rate(10) print 'publishing...' while not rospy.is_shutdown(): self.succ_marker.publish(succ_marker) self.fail_marker.publish(fail_marker) self.succ_pc_pub.publish(succ_pc) self.fail_pc_pub.publish(fail_pc) self.diff_marker.publish(diff_marker) self.diff_pc_pub.publish(diff_pc) r.sleep() if __name__ == '__main__': import sys if 'preprocess' == sys.argv[1]: print 'Loading success bags..' succ_dict = success_failure_classification_preprocess(sys.argv[2]) print 'Saving success dict.' ut.save_pickle(succ_dict, '%s/success_data.pkl' % sys.argv[2]) print 'Loading failure bags..' fail_dict = success_failure_classification_preprocess(sys.argv[3]) print 'Saving failure dict.' ut.save_pickle(fail_dict, '%s/failure_data.pkl' % sys.argv[3]) print 'Done!' if 'learn' == sys.argv[1]: classifier = TimeSeriesClassifier() classifier.create_model(sys.argv[2], sys.argv[3]) classifier.save_models() if 'test' == sys.argv[1]: classifier = TimeSeriesClassifier() classifier.load_models() classifier.classify_pickle(sys.argv[2]) #Debug this to display failure cases if 'display' == sys.argv[1]: d = DisplayDataWithRviz() #data_dict [state number] [topic] [trial number] ['t' 'left' 'right'] d.display(sys.argv[2], sys.argv[3]) #Dbug this so that it displays the average value, and the diff between the averages. if 'diff' == sys.argv[1]: d = DiffDisplay() #data_dict [state number] [topic] [trial number] ['t' 'left' 'right'] d.display(sys.argv[2], sys.argv[3]) if 'run' == sys.argv[1]: #t = TestOnlineClassification() #t.start_classifying() t = TimeSeriesClassifier() t.load_models() t.run() #class VectorTimeSeriesClassifier: # # def __init__(self): # self.data = None # self.times = None # self.start_time = None # # def add_data(self, t, mat): # if self.data == None: # self.data = mat # self.times = [t] # else: # self.data = np.column_stack((self.data, mat)) # self.times.append(t) # # def start_collecting_data(self): # self.start_time = rospy.get_rostime().to_time() # # def get_data(self, start_time_in_segment): # #option 2 # #instead of gettting n data points back, can we interpolate? # #given start time, end time, and number of points needed # #we can interpolate to get those n points # # #option 1 # np.array(self.times) - rospy.get_rostime().to_time() # current_time = rospy.get_rostime().to_time() - self.start_time # start_time_in_segment #need to keep track of time since start #need to put data points into windows of data #want data in consecutive matrices of the same size as what the classifier will # expect if we're still using the same # format #a) #collect messages into data #break up chunks of data but keep it as one large matrix #b) #consume data chunks as long as there is enough #get a message with a time after when we should expect messages #spit out a chunk when there are enough data points ### how do we combine this event based classifier with RL? ## This seems better # might get into dead locks? # can we run this in one process? # rl agent executes a state # while classifier listen for messages # rl agent checks for state estimate. # # rl agent executes a state # waits for estimate... # take state estimate then act.
ajibawa-2023/Python-Code-Large/train/row_99663
490
858
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0012, 0.0012, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0012, 0.0012, 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": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0023, 0.0012, 0, 0.66, 0.0606, 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_99663:Import_L3_C0", "label": "glob import glob", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0035, 0.0012, 0, 0.66, 0.0909, 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_99663:Import_L4_C0", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0047, 0.0012, 0, 0.66, 0.1212, 847, 0, 1, 0, 0, 847, 0, 0], "semantic": {"name": "hrl_lib.rutils", "arg_names": [], "import_names": ["ru"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.rutils as ru"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Import_L5_C0", "label": "hrl_pr2_lib.devices import hpr2", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0058, 0.0012, 0, 0.66, 0.1515, 854, 0, 1, 0, 0, 854, 0, 0], "semantic": {"name": "hrl_pr2_lib.devices", "arg_names": [], "import_names": ["hpr2"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_pr2_lib.devices as hpr2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Import_L6_C0", "label": "hai_sandbox.bag_processor import bp", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.007, 0.0012, 0, 0.66, 0.1818, 342, 0, 1, 0, 0, 342, 0, 0], "semantic": {"name": "hai_sandbox.bag_processor", "arg_names": [], "import_names": ["bp"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hai_sandbox.bag_processor as bp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Import_L7_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0082, 0.0012, 0, 0.66, 0.2121, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Import_L8_C0", "label": "visualization_msgs.msg import vm", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0093, 0.0012, 0, 0.66, 0.2424, 124, 0, 1, 0, 0, 124, 0, 0], "semantic": {"name": "visualization_msgs.msg", "arg_names": [], "import_names": ["vm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import visualization_msgs.msg as vm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Import_L9_C0", "label": "numpy import np", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0105, 0.0012, 0, 0.66, 0.2727, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Import_L10_C0", "label": "hrl_lib.viz import viz", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0117, 0.0012, 0, 0.66, 0.303, 48, 0, 1, 0, 0, 48, 0, 0], "semantic": {"name": "hrl_lib.viz", "arg_names": [], "import_names": ["viz"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.viz as viz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Import_L11_C0", "label": "hai_sandbox.dimreduce import dimreduce", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0128, 0.0012, 0, 0.66, 0.3333, 886, 0, 1, 0, 0, 886, 0, 0], "semantic": {"name": "hai_sandbox.dimreduce", "arg_names": [], "import_names": ["dimreduce"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hai_sandbox.dimreduce as dimreduce"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Import_L12_C0", "label": "sensor_msgs.msg import sm", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.014, 0.0012, 0, 0.66, 0.3636, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["sm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sensor_msgs.msg as sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Import_L13_C0", "label": "scipy.spatial import sp", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0152, 0.0012, 0, 0.66, 0.3939, 384, 0, 1, 0, 0, 384, 0, 0], "semantic": {"name": "scipy.spatial", "arg_names": [], "import_names": ["sp"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.spatial as sp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Import_L14_C0", "label": "pdb import pdb", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0163, 0.0012, 0, 0.66, 0.4242, 91, 0, 1, 0, 0, 91, 0, 0], "semantic": {"name": "pdb", "arg_names": [], "import_names": ["pdb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pdb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Import_L15_C0", "label": "scipy.stats import kde", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0175, 0.0012, 0, 0.66, 0.4545, 413, 0, 1, 0, 0, 413, 0, 0], "semantic": {"name": "scipy.stats", "arg_names": [], "import_names": ["kde"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.stats as kde"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Import_L16_C0", "label": "pr2_msgs.msg import pm", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0186, 0.0012, 0, 0.66, 0.4848, 797, 0, 1, 0, 0, 797, 0, 0], "semantic": {"name": "pr2_msgs.msg", "arg_names": [], "import_names": ["pm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pr2_msgs.msg as pm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Import_L17_C0", "label": "threading import threading", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0198, 0.0012, 0, 0.66, 0.5152, 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_99663:FunctionDef_L24_C0", "label": "success_failure_classification_preprocess", "type": "function", "loc": [24, 74], "level": 0, "parent": null, "vector": [2, 0, 0.0571, 0.0594, 0, 0.66, 0.5455, 425, 0, 1, 1, 0, 0, 0, 21], "semantic": {"name": "success_failure_classification_preprocess", "arg_names": ["folder_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def success_failure_classification_preprocess(folder_name):\n data_dict = None\n #counter = 0\n for bag_name in glob.glob('%s/*.bag' % folder_name):\n print('Loading bag %s' % bag_name)\n topics_dict = ru.bag_sel(bag_name, \n ['/imitate_behavior_marker',\n '/pressure/l_gripper_motor', "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L25_C4", "label": "data_dict =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L24_C0", "vector": [14, 1, 0.0291, 0.0012, 1, 0.75, 0.0, 23, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "data_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_dict = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L27_C4", "label": "for bag_name", "type": "for", "loc": [27, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L24_C0", "vector": [6, 1, 0.0583, 0.0548, 1, 0.75, 0.5, 985, 3, 0, 0, 0, 0, 0, 21], "semantic": {"name": "bag_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for bag_name in glob.glob('%s/*.bag' % folder_name):\n print('Loading bag %s' % bag_name)\n topics_dict = ru.bag_sel(bag_name, \n ['/imitate_behavior_marker',\n '/pressure/l_gripper_motor', \n '/pressure/r_gripper_motor',\n '/accelerometer/l_gripper_motor', \n '/accelerometer/r_gripper_motor',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L28_C8", "label": "print()", "type": "expression", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L27_C4", "vector": [8, 2, 0.0326, 0.0012, 2, 0.15, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Loading bag %s' % bag_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L29_C8", "label": "topics_dict = bag_sel()", "type": "assigned_variable", "loc": [29, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L27_C4", "vector": [14, 2, 0.0385, 0.0105, 2, 0.15, 0.1429, 495, 3, 2, 0, 0, 463, 10, 1], "semantic": {"name": "topics_dict", "arg_names": [], "import_names": [], "rhs_call_name": "bag_sel", "annotation": ""}, "snippet": " topics_dict = ru.bag_sel(bag_name, \n ['/imitate_behavior_marker',\n '/pressure/l_gripper_motor', \n '/pressure/r_gripper_motor',\n '/accelerometer/l_gripper_motor', \n '/accelerometer/r_gripper_motor',\n '/joint_states', \n '/l_cart/command_pose', "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L42_C8", "label": "print()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L27_C4", "vector": [8, 2, 0.049, 0.0012, 2, 0.15, 0.2857, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('There are %d marker messages.' % len(topics_dict['/imitate_behavior_marker']['msg']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L43_C8", "label": "time_segments =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L27_C4", "vector": [14, 2, 0.0501, 0.0012, 2, 0.15, 0.4286, 92, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "time_segments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_segments = [[]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L44_C8", "label": "for marker_msg", "type": "for", "loc": [44, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L27_C4", "vector": [6, 2, 0.053, 0.0047, 2, 0.15, 0.5714, 368, 6, 0, 0, 0, 0, 0, 4], "semantic": {"name": "marker_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for marker_msg in topics_dict['/imitate_behavior_marker']['msg']:\n if len(time_segments[-1]) >= 2:\n time_segments.append([])\n time_segments[-1].append(marker_msg.header.stamp.to_time())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L45_C12", "label": "if", "type": "if", "loc": [45, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L44_C8", "vector": [4, 3, 0.053, 0.0023, 3, 0.34, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(time_segments[-1]) >= 2:\n time_segments.append([])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L46_C16", "label": "append()", "type": "expression", "loc": [46, 46], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L45_C12", "vector": [8, 4, 0.0536, 0.0012, 4, 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": " time_segments.append([])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L47_C12", "label": "append()", "type": "expression", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L44_C8", "vector": [8, 3, 0.0548, 0.0012, 3, 0.34, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " time_segments[-1].append(marker_msg.header.stamp.to_time())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L49_C8", "label": "if", "type": "if", "loc": [49, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L27_C4", "vector": [4, 2, 0.0594, 0.0058, 2, 0.15, 0.7143, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data_dict == None:\n data_dict = {}\n #organize by segment, then by type, then by what that type will store\n for i in range(len(time_segments)):\n data_dict[i] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L50_C12", "label": "data_dict =", "type": "assigned_variable", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L49_C8", "vector": [14, 3, 0.0583, 0.0012, 3, 0.71, 0.0, 23, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "data_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L52_C12", "label": "for i", "type": "for", "loc": [52, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L49_C8", "vector": [6, 3, 0.0612, 0.0023, 3, 0.71, 1.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(time_segments)):\n data_dict[i] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L53_C16", "label": "assign", "type": "assigned_variable", "loc": [53, 53], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L52_C12", "vector": [14, 4, 0.0618, 0.0012, 4, 0.78, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_dict[i] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L58_C8", "label": "for ptop", "type": "for", "loc": [58, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L27_C4", "vector": [6, 2, 0.0734, 0.0128, 2, 0.15, 0.8571, 454, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "ptop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for ptop in ['/pressure/l_gripper_motor', '/pressure/r_gripper_motor']:\n p = topics_dict[ptop]\n psegs = bp.segment_msgs(time_segments, p['msg'])\n print('>> Separated records of %s (%s) into %d segments' % (ptop, bag_name, len(psegs)))\n #convert segments into mats\n for i, pseg in enumerate(psegs):\n #each col is an example in left-f and right_f\n left_f, right_f, ptimes = hpr2.pressure_state_to_mat(pseg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L59_C12", "label": "p =", "type": "assigned_variable", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L58_C8", "vector": [14, 3, 0.0688, 0.0012, 3, 0.96, 0.0, 491, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = topics_dict[ptop]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L60_C12", "label": "psegs = segment_msgs()", "type": "assigned_variable", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L58_C8", "vector": [14, 3, 0.0699, 0.0012, 3, 0.96, 0.3333, 748, 3, 2, 0, 0, 465, 10, 1], "semantic": {"name": "psegs", "arg_names": [], "import_names": [], "rhs_call_name": "segment_msgs", "annotation": ""}, "snippet": " psegs = bp.segment_msgs(time_segments, p['msg'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L61_C12", "label": "print()", "type": "expression", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L58_C8", "vector": [8, 3, 0.0711, 0.0012, 3, 0.96, 0.6667, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('>> Separated records of %s (%s) into %d segments' % (ptop, bag_name, len(psegs)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L63_C12", "label": "for i, pseg", "type": "for", "loc": [63, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L58_C8", "vector": [6, 3, 0.0763, 0.007, 3, 0.96, 1.0, 770, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i, pseg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, pseg in enumerate(psegs):\n #each col is an example in left-f and right_f\n left_f, right_f, ptimes = hpr2.pressure_state_to_mat(pseg)\n if not data_dict[i].has_key(ptop):\n data_dict[i][ptop] = []\n data_dict[i][ptop].append({'left': left_f, 'right': right_f, 't': ptimes})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L65_C16", "label": "left_f, right_f, ptimes = pressure_state_to_mat()", "type": "assigned_variable", "loc": [65, 65], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L63_C12", "vector": [14, 4, 0.0758, 0.0012, 4, 0.27, 0.0, 733, 3, 1, 0, 0, 871, 10, 1], "semantic": {"name": "left_f, right_f, ptimes", "arg_names": [], "import_names": [], "rhs_call_name": "pressure_state_to_mat", "annotation": ""}, "snippet": " left_f, right_f, ptimes = hpr2.pressure_state_to_mat(pseg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L66_C16", "label": "if", "type": "if", "loc": [66, 67], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L63_C12", "vector": [4, 4, 0.0775, 0.0023, 4, 0.27, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not data_dict[i].has_key(ptop):\n data_dict[i][ptop] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L67_C20", "label": "assign", "type": "assigned_variable", "loc": [67, 67], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L66_C16", "vector": [14, 5, 0.0781, 0.0012, 5, 0.62, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_dict[i][ptop] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L68_C16", "label": "append()", "type": "expression", "loc": [68, 68], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L63_C12", "vector": [8, 4, 0.0793, 0.0012, 4, 0.27, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " data_dict[i][ptop].append({'left': left_f, 'right': right_f, 't': ptimes})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L71_C8", "label": "for ptop", "type": "for", "loc": [71, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L27_C4", "vector": [6, 2, 0.0839, 0.0035, 2, 0.15, 1.0, 454, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "ptop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for ptop in ['/pressure/l_gripper_motor', '/pressure/r_gripper_motor']:\n for k in data_dict.keys():\n print('>>', k, ptop, len(data_dict[k][ptop]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L72_C12", "label": "for k", "type": "for", "loc": [72, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L71_C8", "vector": [6, 3, 0.0845, 0.0023, 3, 0.79, 0.0, 954, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in data_dict.keys():\n print('>>', k, ptop, len(data_dict[k][ptop]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L73_C16", "label": "print()", "type": "expression", "loc": [73, 73], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L72_C12", "vector": [8, 4, 0.0851, 0.0012, 4, 0.33, 0.0, 535, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('>>', k, ptop, len(data_dict[k][ptop]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L74_C4", "label": "return", "type": "return", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L24_C0", "vector": [13, 1, 0.0862, 0.0012, 1, 0.75, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return data_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L76_C0", "label": "select_time", "type": "function", "loc": [76, 78], "level": 0, "parent": null, "vector": [2, 0, 0.0897, 0.0035, 0, 0.66, 0.5758, 591, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "select_time", "arg_names": ["data", "time_rec", "time_start", "time_end"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def select_time(data, time_rec, time_start, time_end):\n #pdb.set_trace()\n return data[:, np.where(np.multiply(time_rec >= time_start, time_rec < time_end))[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L78_C4", "label": "return", "type": "return", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L76_C0", "vector": [13, 1, 0.0909, 0.0012, 1, 0.09, 0.0, 0, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return data[:, np.where(np.multiply(time_rec >= time_start, time_rec < time_end))[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L80_C0", "label": "break_record_matrices_into_chunks", "type": "function", "loc": [80, 104], "level": 0, "parent": null, "vector": [2, 0, 0.1072, 0.0291, 0, 0.66, 0.6061, 762, 0, 5, 1, 0, 0, 0, 12], "semantic": {"name": "break_record_matrices_into_chunks", "arg_names": ["data_dict", "segmented_matrices", "minimal_trial_lengths", "chunk_times", "topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def break_record_matrices_into_chunks(data_dict, segmented_matrices, \\\n minimal_trial_lengths, chunk_times, topic):\n #For each state\n data_sets = {}\n for state in range(len(data_dict.keys())):\n data_sets[state] = {}\n time_starts = np.arange(0, minimal_trial_lengths[state], chunk_times[state])\n time_ends = np.arange(chunk_times[state], minimal_trial_lengths[state] + chunk_times[state], chunk_times[state])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L83_C4", "label": "data_sets =", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L80_C0", "vector": [14, 1, 0.0967, 0.0012, 1, 0.08, 0.0, 883, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "data_sets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_sets = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L84_C4", "label": "for state", "type": "for", "loc": [84, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L80_C0", "vector": [6, 1, 0.109, 0.0233, 1, 0.08, 0.5, 688, 3, 0, 0, 0, 0, 0, 12], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for state in range(len(data_dict.keys())):\n data_sets[state] = {}\n time_starts = np.arange(0, minimal_trial_lengths[state], chunk_times[state])\n time_ends = np.arange(chunk_times[state], minimal_trial_lengths[state] + chunk_times[state], chunk_times[state])\n\n #Go over all the records\n for record_number in range(len(data_dict[state][topic])):\n time_rec = segmented_matrices[record_number]['t'][state]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L85_C8", "label": "assign", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L84_C4", "vector": [14, 2, 0.0991, 0.0012, 2, 0.46, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_sets[state] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L86_C8", "label": "time_starts = arange()", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L84_C4", "vector": [14, 2, 0.1002, 0.0012, 2, 0.46, 0.3333, 912, 3, 3, 0, 0, 489, 10, 1], "semantic": {"name": "time_starts", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " time_starts = np.arange(0, minimal_trial_lengths[state], chunk_times[state])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L87_C8", "label": "time_ends = arange()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L84_C4", "vector": [14, 2, 0.1014, 0.0012, 2, 0.46, 0.6667, 465, 3, 3, 0, 0, 489, 10, 1], "semantic": {"name": "time_ends", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " time_ends = np.arange(chunk_times[state], minimal_trial_lengths[state] + chunk_times[state], chunk_times[state])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L90_C8", "label": "for record_number", "type": "for", "loc": [90, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L84_C4", "vector": [6, 2, 0.1125, 0.0163, 2, 0.46, 1.0, 75, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "record_number", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for record_number in range(len(data_dict[state][topic])):\n time_rec = segmented_matrices[record_number]['t'][state]\n time_rec = time_rec - time_rec[0]\n #Break them up into little chunks\n for tidx in range(len(time_starts)):\n if not data_sets[state].has_key(tidx):\n data_sets[state][tidx] = {}\n data_sets[state][tidx]['data'] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L91_C12", "label": "time_rec =", "type": "assigned_variable", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L90_C8", "vector": [14, 3, 0.1061, 0.0012, 3, 0.84, 0.0, 18, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_rec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_rec = segmented_matrices[record_number]['t'][state]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L92_C12", "label": "time_rec =", "type": "assigned_variable", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L90_C8", "vector": [14, 3, 0.1072, 0.0012, 3, 0.84, 0.5, 18, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_rec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_rec = time_rec - time_rec[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L94_C12", "label": "for tidx", "type": "for", "loc": [94, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L90_C8", "vector": [6, 3, 0.1148, 0.0117, 3, 0.84, 1.0, 985, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "tidx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for tidx in range(len(time_starts)):\n if not data_sets[state].has_key(tidx):\n data_sets[state][tidx] = {}\n data_sets[state][tidx]['data'] = []\n data_sets[state][tidx]['time'] = [time_starts[tidx], time_ends[tidx]]\n\n #pdb.set_trace()\n data_chunk = select_time(segmented_matrices[record_number]['mat'][state], time_rec, "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L95_C16", "label": "if", "type": "if", "loc": [95, 98], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L94_C12", "vector": [4, 4, 0.1125, 0.0047, 4, 0.07, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not data_sets[state].has_key(tidx):\n data_sets[state][tidx] = {}\n data_sets[state][tidx]['data'] = []\n data_sets[state][tidx]['time'] = [time_starts[tidx], time_ends[tidx]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L96_C20", "label": "assign", "type": "assigned_variable", "loc": [96, 96], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L95_C16", "vector": [14, 5, 0.1119, 0.0012, 5, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_sets[state][tidx] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L97_C20", "label": "assign", "type": "assigned_variable", "loc": [97, 97], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L95_C16", "vector": [14, 5, 0.1131, 0.0012, 5, 0.0, 0.5, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_sets[state][tidx]['data'] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L98_C20", "label": "assign", "type": "assigned_variable", "loc": [98, 98], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L95_C16", "vector": [14, 5, 0.1142, 0.0012, 5, 0.0, 1.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_sets[state][tidx]['time'] = [time_starts[tidx], time_ends[tidx]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L101_C16", "label": "data_chunk = select_time()", "type": "assigned_variable", "loc": [101, 102], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L94_C12", "vector": [14, 4, 0.1183, 0.0023, 4, 0.07, 0.5, 43, 3, 4, 0, 0, 591, 10, 1], "semantic": {"name": "data_chunk", "arg_names": [], "import_names": [], "rhs_call_name": "select_time", "annotation": ""}, "snippet": " data_chunk = select_time(segmented_matrices[record_number]['mat'][state], time_rec, \n time_starts[tidx], time_ends[tidx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L103_C16", "label": "append()", "type": "expression", "loc": [103, 103], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L94_C12", "vector": [8, 4, 0.12, 0.0012, 4, 0.07, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " data_sets[state][tidx]['data'].append(data_chunk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L104_C4", "label": "return", "type": "return", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L80_C0", "vector": [13, 1, 0.1212, 0.0012, 1, 0.08, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return data_sets"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L107_C0", "label": "TimeSeriesVectorizer", "type": "class", "loc": [107, 200], "level": 0, "parent": null, "vector": [3, 0, 0.1789, 0.1096, 0, 0.66, 0.6364, 17, 0, 5, 0, 0, 0, 0, 19], "semantic": {"name": "TimeSeriesVectorizer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TimeSeriesVectorizer:\n\n def __init__(self):\n self.channels = {}\n self.buffer_lengths = {}\n\n def register_listener(self, vectorize_func, msg_type, topic, buffer_length_secs):\n self.buffer_lengths[topic] = buffer_length_secs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L109_C4", "label": "__init__", "type": "function", "loc": [109, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L107_C0", "vector": [2, 1, 0.1282, 0.0035, 1, 0.95, 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.channels = {}\n self.buffer_lengths = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L110_C8", "label": "self.channels =", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L109_C4", "vector": [14, 2, 0.1282, 0.0012, 2, 0.4, 0.0, 991, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.channels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.channels = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L111_C8", "label": "self.buffer_lengths =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L109_C4", "vector": [14, 2, 0.1294, 0.0012, 2, 0.4, 1.0, 880, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.buffer_lengths", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.buffer_lengths = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L113_C4", "label": "register_listener", "type": "function", "loc": [113, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L107_C0", "vector": [2, 1, 0.155, 0.0478, 1, 0.95, 0.3333, 520, 0, 5, 0, 0, 0, 0, 11], "semantic": {"name": "register_listener", "arg_names": ["self", "vectorize_func", "msg_type", "topic", "buffer_length_secs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def register_listener(self, vectorize_func, msg_type, topic, buffer_length_secs):\n self.buffer_lengths[topic] = buffer_length_secs\n\n def listener_func(msg):\n amat = vectorize_func(msg)\n t = np.matrix([msg.header.stamp.to_time()])\n got_lock = False\n if self.channels[topic][0] == None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L114_C8", "label": "assign", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L113_C4", "vector": [14, 2, 0.1329, 0.0012, 2, 0.51, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.buffer_lengths[topic] = buffer_length_secs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "label": "listener_func", "type": "function", "loc": [116, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L113_C4", "vector": [2, 2, 0.155, 0.0408, 2, 0.51, 0.3333, 888, 0, 1, 0, 0, 0, 0, 10], "semantic": {"name": "listener_func", "arg_names": ["msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def listener_func(msg):\n amat = vectorize_func(msg)\n t = np.matrix([msg.header.stamp.to_time()])\n got_lock = False\n if self.channels[topic][0] == None:\n self.channels[topic] = [amat, t, threading.RLock()]\n else:\n lock = self.channels[topic][2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L117_C12", "label": "amat = vectorize_func()", "type": "assigned_variable", "loc": [117, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "vector": [14, 3, 0.1364, 0.0012, 3, 0.97, 0.0, 868, 3, 1, 0, 0, 19, 10, 1], "semantic": {"name": "amat", "arg_names": [], "import_names": [], "rhs_call_name": "vectorize_func", "annotation": ""}, "snippet": " amat = vectorize_func(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L118_C12", "label": "t = matrix()", "type": "assigned_variable", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "vector": [14, 3, 0.1375, 0.0012, 3, 0.97, 0.1, 15, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " t = np.matrix([msg.header.stamp.to_time()])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L119_C12", "label": "got_lock =", "type": "assigned_variable", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "vector": [14, 3, 0.1387, 0.0012, 3, 0.97, 0.2, 445, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "got_lock", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " got_lock = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L120_C12", "label": "if", "type": "if", "loc": [120, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "vector": [4, 3, 0.1463, 0.014, 3, 0.97, 0.3, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.channels[topic][0] == None:\n self.channels[topic] = [amat, t, threading.RLock()]\n else:\n lock = self.channels[topic][2]\n lock.acquire()\n got_lock = True\n #print 'l locked'\n new_record = [np.column_stack((self.channels[topic][0], amat)), "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L121_C16", "label": "assign", "type": "assigned_variable", "loc": [121, 121], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L120_C12", "vector": [14, 4, 0.141, 0.0012, 4, 0.72, 0.0, 0, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.channels[topic] = [amat, t, threading.RLock()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L123_C16", "label": "lock =", "type": "assigned_variable", "loc": [123, 123], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L120_C12", "vector": [14, 4, 0.1434, 0.0012, 4, 0.72, 0.2, 104, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lock", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lock = self.channels[topic][2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L124_C16", "label": "acquire()", "type": "expression", "loc": [124, 124], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L120_C12", "vector": [8, 4, 0.1445, 0.0012, 4, 0.72, 0.4, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L125_C16", "label": "got_lock =", "type": "assigned_variable", "loc": [125, 125], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L120_C12", "vector": [14, 4, 0.1457, 0.0012, 4, 0.72, 0.6, 445, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "got_lock", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " got_lock = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L127_C16", "label": "new_record =", "type": "assigned_variable", "loc": [127, 129], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L120_C12", "vector": [14, 4, 0.1492, 0.0035, 4, 0.72, 0.8, 493, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "new_record", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_record = [np.column_stack((self.channels[topic][0], amat)), \n np.column_stack((self.channels[topic][1], t)),\n lock]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L131_C16", "label": "assign", "type": "assigned_variable", "loc": [131, 131], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L120_C12", "vector": [14, 4, 0.1527, 0.0012, 4, 0.72, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.channels[topic] = new_record"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L138_C12", "label": "lock =", "type": "assigned_variable", "loc": [138, 138], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "vector": [14, 3, 0.1608, 0.0012, 3, 0.97, 0.4, 104, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lock", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lock = self.channels[topic][2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L139_C12", "label": "if", "type": "if", "loc": [139, 140], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "vector": [4, 3, 0.1626, 0.0023, 3, 0.97, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not got_lock:\n lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L140_C16", "label": "acquire()", "type": "expression", "loc": [140, 140], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L139_C12", "vector": [8, 4, 0.1632, 0.0012, 4, 0.2, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L143_C12", "label": "n_seconds_ago =", "type": "assigned_variable", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "vector": [14, 3, 0.1667, 0.0012, 3, 0.97, 0.6, 722, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "n_seconds_ago", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_seconds_ago = t[0,0] - buffer_length_secs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L144_C12", "label": "records_in_range =", "type": "assigned_variable", "loc": [144, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "vector": [14, 3, 0.1678, 0.0012, 3, 0.97, 0.7, 795, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "records_in_range", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " records_in_range = (np.where(self.channels[topic][1] >= n_seconds_ago)[1]).A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L146_C12", "label": "assign", "type": "assigned_variable", "loc": [146, 146], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "vector": [14, 3, 0.1702, 0.0012, 3, 0.97, 0.8, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.channels[topic][0] = self.channels[topic][0][:, records_in_range]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L147_C12", "label": "assign", "type": "assigned_variable", "loc": [147, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "vector": [14, 3, 0.1713, 0.0012, 3, 0.97, 0.9, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.channels[topic][1] = self.channels[topic][1][:, records_in_range]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L150_C12", "label": "release()", "type": "expression", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "vector": [8, 3, 0.1748, 0.0012, 3, 0.97, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L152_C8", "label": "assign", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L113_C4", "vector": [14, 2, 0.1772, 0.0012, 2, 0.51, 0.6667, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.channels[topic] = [None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L153_C8", "label": "Subscriber()", "type": "expression", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L113_C4", "vector": [8, 2, 0.1783, 0.0012, 2, 0.51, 1.0, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber(topic, msg_type, listener_func)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L155_C4", "label": "get_n_steps", "type": "function", "loc": [155, 195], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L107_C0", "vector": [2, 1, 0.204, 0.0478, 1, 0.95, 0.6667, 127, 0, 5, 1, 0, 0, 0, 7], "semantic": {"name": "get_n_steps", "arg_names": ["self", "topic", "timestart", "nsteps", "wait"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_n_steps(self, topic, timestart, nsteps, wait=True): \n #print 'timestart is', timestart\n if self.channels[topic][0] != None:\n if timestart < self.channels[topic][1][0,0]:\n # [0,0] is the earliest, and [0,-1] is the latest\n #print self.channels[topic][1][0,0], self.channels[topic][1][0,-1], self.channels[topic][1].shape\n #print 'diff', self.channels[topic][1][0,0] - timestart\n #print 'diff', self.channels[topic][1][0,-1] - timestart"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L157_C8", "label": "if", "type": "if", "loc": [157, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L155_C4", "vector": [4, 2, 0.1871, 0.0093, 2, 0.13, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.channels[topic][0] != None:\n if timestart < self.channels[topic][1][0,0]:\n # [0,0] is the earliest, and [0,-1] is the latest\n #print self.channels[topic][1][0,0], self.channels[topic][1][0,-1], self.channels[topic][1].shape\n #print 'diff', self.channels[topic][1][0,0] - timestart\n #print 'diff', self.channels[topic][1][0,-1] - timestart\n #print timestart, self.channels[topic][1][0,0]\n raise RuntimeError('timestart <= self.channels[topic][1][0,0]')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L158_C12", "label": "if", "type": "if", "loc": [158, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L157_C8", "vector": [4, 3, 0.1876, 0.0082, 3, 0.12, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if timestart < self.channels[topic][1][0,0]:\n # [0,0] is the earliest, and [0,-1] is the latest\n #print self.channels[topic][1][0,0], self.channels[topic][1][0,-1], self.channels[topic][1].shape\n #print 'diff', self.channels[topic][1][0,0] - timestart\n #print 'diff', self.channels[topic][1][0,-1] - timestart\n #print timestart, self.channels[topic][1][0,0]\n raise RuntimeError('timestart <= self.channels[topic][1][0,0]')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L166_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L155_C4", "vector": [14, 2, 0.1935, 0.0012, 2, 0.13, 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(100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L167_C8", "label": "selected =", "type": "assigned_variable", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L155_C4", "vector": [14, 2, 0.1946, 0.0012, 2, 0.13, 0.6667, 73, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "selected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " selected = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L168_C8", "label": "while", "type": "while", "loc": [168, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L155_C4", "vector": [5, 2, 0.2115, 0.0326, 2, 0.13, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while selected == None:\n if self.channels[topic][0] == None:\n r.sleep()\n continue\n\n lock = self.channels[topic][2]\n lock.acquire()\n #print 'g locked'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L169_C12", "label": "if", "type": "if", "loc": [169, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L168_C8", "vector": [4, 3, 0.1981, 0.0035, 3, 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.channels[topic][0] == None:\n r.sleep()\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L170_C16", "label": "sleep()", "type": "expression", "loc": [170, 170], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L169_C12", "vector": [8, 4, 0.1981, 0.0012, 4, 0.76, 0.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_99663:Assign_L173_C12", "label": "lock =", "type": "assigned_variable", "loc": [173, 173], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L168_C8", "vector": [14, 3, 0.2016, 0.0012, 3, 0.82, 0.1429, 104, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lock", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lock = self.channels[topic][2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L174_C12", "label": "acquire()", "type": "expression", "loc": [174, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L168_C8", "vector": [8, 3, 0.2028, 0.0012, 3, 0.82, 0.2857, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L177_C12", "label": "record_idxs =", "type": "assigned_variable", "loc": [177, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L168_C8", "vector": [14, 3, 0.2063, 0.0012, 3, 0.82, 0.4286, 633, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "record_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " record_idxs = (np.where(self.channels[topic][1] > timestart)[1]).A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L181_C12", "label": "records_from_time =", "type": "assigned_variable", "loc": [181, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L168_C8", "vector": [14, 3, 0.211, 0.0012, 3, 0.82, 0.5714, 502, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "records_from_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " records_from_time = self.channels[topic][0][:, record_idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L184_C12", "label": "selected =", "type": "assigned_variable", "loc": [184, 184], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L168_C8", "vector": [14, 3, 0.2145, 0.0012, 3, 0.82, 0.7143, 73, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "selected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " selected = records_from_time[:, :nsteps]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L185_C12", "label": "release()", "type": "expression", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L168_C8", "vector": [8, 3, 0.2156, 0.0012, 3, 0.82, 0.8571, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L188_C12", "label": "if", "type": "if", "loc": [188, 195], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L168_C8", "vector": [4, 3, 0.2232, 0.0093, 3, 0.82, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if selected.shape[1] < nsteps:\n if not wait:\n return None\n else:\n selected = None\n r.sleep()\n else:\n return selected"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L189_C16", "label": "if", "type": "if", "loc": [189, 193], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L188_C12", "vector": [4, 4, 0.2226, 0.0058, 4, 0.72, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not wait:\n return None\n else:\n selected = None\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L190_C20", "label": "return", "type": "return", "loc": [190, 190], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L189_C16", "vector": [13, 5, 0.2214, 0.0012, 5, 0.61, 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_99663:Assign_L192_C20", "label": "selected =", "type": "assigned_variable", "loc": [192, 192], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L189_C16", "vector": [14, 5, 0.2238, 0.0012, 5, 0.61, 0.5, 73, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "selected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " selected = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L193_C20", "label": "sleep()", "type": "expression", "loc": [193, 193], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L189_C16", "vector": [8, 5, 0.2249, 0.0012, 5, 0.61, 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_99663:Return_L195_C16", "label": "return", "type": "return", "loc": [195, 195], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L188_C12", "vector": [13, 4, 0.2273, 0.0012, 4, 0.72, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return selected"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L197_C4", "label": "get_range", "type": "function", "loc": [197, 200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L107_C0", "vector": [2, 1, 0.2314, 0.0047, 1, 0.95, 1.0, 931, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "get_range", "arg_names": ["self", "topic", "time_start", "time_end"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_range(self, topic, time_start, time_end):\n times = self.channels[topic][1]\n selected = self.channels[topic][0][:, np.where((times > time_start) * (times <= time_end))]\n return selected"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L198_C8", "label": "times =", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L197_C4", "vector": [14, 2, 0.2308, 0.0012, 2, 0.56, 0.0, 342, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "times", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " times = self.channels[topic][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L199_C8", "label": "selected =", "type": "assigned_variable", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L197_C4", "vector": [14, 2, 0.2319, 0.0012, 2, 0.56, 0.5, 73, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "selected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " selected = self.channels[topic][0][:, np.where((times > time_start) * (times <= time_end))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L200_C8", "label": "return", "type": "return", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L197_C4", "vector": [13, 2, 0.2331, 0.0012, 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 selected"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L204_C0", "label": "TestOnlineClassification", "type": "class", "loc": [204, 225], "level": 0, "parent": null, "vector": [3, 0, 0.25, 0.0256, 0, 0.66, 0.6667, 930, 0, 3, 0, 0, 0, 0, 14], "semantic": {"name": "TestOnlineClassification", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TestOnlineClassification:\n\n def __init__(self):\n rospy.init_node('success_classifier')\n self.vectorizer = TimeSeriesVectorizer()\n def pressure_vectorizer(pmsg):\n return np.row_stack((np.matrix((pmsg.l_finger_tip)).T, np.matrix((pmsg.r_finger_tip)).T))\n self.vectorizer.register_listener(pressure_vectorizer, pm.PressureState, '/pressure/l_gripper_motor', 15.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L206_C4", "label": "__init__", "type": "function", "loc": [206, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L204_C0", "vector": [2, 1, 0.243, 0.007, 1, 0.14, 0.0, 555, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n rospy.init_node('success_classifier')\n self.vectorizer = TimeSeriesVectorizer()\n def pressure_vectorizer(pmsg):\n return np.row_stack((np.matrix((pmsg.l_finger_tip)).T, np.matrix((pmsg.r_finger_tip)).T))\n self.vectorizer.register_listener(pressure_vectorizer, pm.PressureState, '/pressure/l_gripper_motor', 15.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L207_C8", "label": "init_node()", "type": "expression", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L206_C4", "vector": [8, 2, 0.2413, 0.0012, 2, 0.22, 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('success_classifier')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L208_C8", "label": "self.vectorizer = TimeSeriesVectorizer()", "type": "assigned_variable", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L206_C4", "vector": [14, 2, 0.2424, 0.0012, 2, 0.22, 0.3333, 670, 3, 0, 0, 0, 17, 10, 1], "semantic": {"name": "self.vectorizer", "arg_names": [], "import_names": [], "rhs_call_name": "TimeSeriesVectorizer", "annotation": ""}, "snippet": " self.vectorizer = TimeSeriesVectorizer()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L209_C8", "label": "pressure_vectorizer", "type": "function", "loc": [209, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L206_C4", "vector": [2, 2, 0.2442, 0.0023, 2, 0.22, 0.6667, 360, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "pressure_vectorizer", "arg_names": ["pmsg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pressure_vectorizer(pmsg):\n return np.row_stack((np.matrix((pmsg.l_finger_tip)).T, np.matrix((pmsg.r_finger_tip)).T))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L210_C12", "label": "return", "type": "return", "loc": [210, 210], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L209_C8", "vector": [13, 3, 0.2448, 0.0012, 3, 0.85, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.row_stack((np.matrix((pmsg.l_finger_tip)).T, np.matrix((pmsg.r_finger_tip)).T))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L211_C8", "label": "register_listener()", "type": "expression", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L206_C4", "vector": [8, 2, 0.2459, 0.0012, 2, 0.22, 1.0, 520, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "register_listener", "arg_names": [], "import_names": [], "rhs_call_name": "register_listener", "annotation": ""}, "snippet": " self.vectorizer.register_listener(pressure_vectorizer, pm.PressureState, '/pressure/l_gripper_motor', 15.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L213_C4", "label": "start_classifying", "type": "function", "loc": [213, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L204_C0", "vector": [2, 1, 0.2552, 0.0152, 1, 0.14, 1.0, 910, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "start_classifying", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_classifying(self):\n #print 'start_classifying'\n segment_idx = 0\n segment_lengths = [10, 10, 10]\n n_segments = len(segment_lengths)\n for segment_idx in range(n_segments):\n n_steps = segment_lengths[segment_idx]\n #print 'getting_n_steps'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L215_C8", "label": "segment_idx =", "type": "assigned_variable", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L213_C4", "vector": [14, 2, 0.2506, 0.0012, 2, 0.59, 0.0, 669, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "segment_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " segment_idx = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L216_C8", "label": "segment_lengths =", "type": "assigned_variable", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L213_C4", "vector": [14, 2, 0.2517, 0.0012, 2, 0.59, 0.25, 719, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "segment_lengths", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " segment_lengths = [10, 10, 10]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L217_C8", "label": "n_segments = len()", "type": "assigned_variable", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L213_C4", "vector": [14, 2, 0.2529, 0.0012, 2, 0.59, 0.5, 868, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_segments", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_segments = len(segment_lengths)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L218_C8", "label": "for segment_idx", "type": "for", "loc": [218, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L213_C4", "vector": [6, 2, 0.2576, 0.0082, 2, 0.59, 0.75, 669, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "segment_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for segment_idx in range(n_segments):\n n_steps = segment_lengths[segment_idx]\n #print 'getting_n_steps'\n selected = self.vectorizer.get_n_steps('/pressure/l_gripper_motor', \\\n rospy.get_rostime().to_time(), n_steps)\n print('selected.shpae', selected.shape)\n print(selected)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L219_C12", "label": "n_steps =", "type": "assigned_variable", "loc": [219, 219], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L218_C8", "vector": [14, 3, 0.2552, 0.0012, 3, 0.48, 0.0, 514, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "n_steps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_steps = segment_lengths[segment_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L221_C12", "label": "selected = get_n_steps()", "type": "assigned_variable", "loc": [221, 222], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L218_C8", "vector": [14, 3, 0.2582, 0.0023, 3, 0.48, 0.3333, 73, 3, 3, 0, 0, 127, 10, 3], "semantic": {"name": "selected", "arg_names": [], "import_names": [], "rhs_call_name": "get_n_steps", "annotation": ""}, "snippet": " selected = self.vectorizer.get_n_steps('/pressure/l_gripper_motor', \\\n rospy.get_rostime().to_time(), n_steps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L223_C12", "label": "print()", "type": "expression", "loc": [223, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L218_C8", "vector": [8, 3, 0.2599, 0.0012, 3, 0.48, 0.6667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('selected.shpae', selected.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L224_C12", "label": "print()", "type": "expression", "loc": [224, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L218_C8", "vector": [8, 3, 0.2611, 0.0012, 3, 0.48, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(selected)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L225_C8", "label": "print()", "type": "expression", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L213_C4", "vector": [8, 2, 0.2622, 0.0012, 2, 0.59, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('done!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "label": "TimeSeriesClassifier", "type": "class", "loc": [228, 502], "level": 0, "parent": null, "vector": [3, 0, 0.4254, 0.3205, 0, 0.66, 0.697, 701, 0, 12, 0, 0, 0, 0, 99], "semantic": {"name": "TimeSeriesClassifier", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TimeSeriesClassifier:\n\n def __init__(self):\n rospy.init_node('time_series_classifier')\n self.vectorizer = TimeSeriesVectorizer()\n def pressure_vectorizer(pmsg):\n return np.row_stack((np.matrix((pmsg.l_finger_tip)).T, np.matrix((pmsg.r_finger_tip)).T))\n self.vectorizer.register_listener(pressure_vectorizer, pm.PressureState, \\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L230_C4", "label": "__init__", "type": "function", "loc": [230, 236], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "vector": [2, 1, 0.2716, 0.0082, 1, 0.63, 0.0, 555, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n rospy.init_node('time_series_classifier')\n self.vectorizer = TimeSeriesVectorizer()\n def pressure_vectorizer(pmsg):\n return np.row_stack((np.matrix((pmsg.l_finger_tip)).T, np.matrix((pmsg.r_finger_tip)).T))\n self.vectorizer.register_listener(pressure_vectorizer, pm.PressureState, \\\n '/pressure/l_gripper_motor', 15.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L231_C8", "label": "init_node()", "type": "expression", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L230_C4", "vector": [8, 2, 0.2692, 0.0012, 2, 0.72, 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('time_series_classifier')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L232_C8", "label": "self.vectorizer = TimeSeriesVectorizer()", "type": "assigned_variable", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L230_C4", "vector": [14, 2, 0.2704, 0.0012, 2, 0.72, 0.3333, 670, 3, 0, 0, 0, 17, 10, 1], "semantic": {"name": "self.vectorizer", "arg_names": [], "import_names": [], "rhs_call_name": "TimeSeriesVectorizer", "annotation": ""}, "snippet": " self.vectorizer = TimeSeriesVectorizer()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L233_C8", "label": "pressure_vectorizer", "type": "function", "loc": [233, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L230_C4", "vector": [2, 2, 0.2721, 0.0023, 2, 0.72, 0.6667, 360, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "pressure_vectorizer", "arg_names": ["pmsg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pressure_vectorizer(pmsg):\n return np.row_stack((np.matrix((pmsg.l_finger_tip)).T, np.matrix((pmsg.r_finger_tip)).T))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L234_C12", "label": "return", "type": "return", "loc": [234, 234], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L233_C8", "vector": [13, 3, 0.2727, 0.0012, 3, 0.52, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.row_stack((np.matrix((pmsg.l_finger_tip)).T, np.matrix((pmsg.r_finger_tip)).T))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L235_C8", "label": "register_listener()", "type": "expression", "loc": [235, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L230_C4", "vector": [8, 2, 0.2745, 0.0023, 2, 0.72, 1.0, 520, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "register_listener", "arg_names": [], "import_names": [], "rhs_call_name": "register_listener", "annotation": ""}, "snippet": " self.vectorizer.register_listener(pressure_vectorizer, pm.PressureState, \\\n '/pressure/l_gripper_motor', 15.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L239_C4", "label": "run", "type": "function", "loc": [239, 244], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "vector": [2, 1, 0.2815, 0.007, 1, 0.63, 0.1, 679, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run(self):\n #models = self.models['models']\n for state in range(len(self.models['models'])):\n for chunk_idx in range(len(self.models['models'][state])):\n xmat = self.fetch_data(state, chunk_idx)\n print(self.probability(xmat, state, chunk_idx))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L241_C8", "label": "for state", "type": "for", "loc": [241, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L239_C4", "vector": [6, 2, 0.2826, 0.0047, 2, 0.18, 0.0, 688, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for state in range(len(self.models['models'])):\n for chunk_idx in range(len(self.models['models'][state])):\n xmat = self.fetch_data(state, chunk_idx)\n print(self.probability(xmat, state, chunk_idx))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L242_C12", "label": "for chunk_idx", "type": "for", "loc": [242, 244], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L241_C8", "vector": [6, 3, 0.2832, 0.0035, 3, 0.34, 0.0, 501, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "chunk_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for chunk_idx in range(len(self.models['models'][state])):\n xmat = self.fetch_data(state, chunk_idx)\n print(self.probability(xmat, state, chunk_idx))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L243_C16", "label": "xmat = fetch_data()", "type": "assigned_variable", "loc": [243, 243], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L242_C12", "vector": [14, 4, 0.2832, 0.0012, 4, 0.84, 0.0, 381, 3, 2, 0, 0, 309, 10, 1], "semantic": {"name": "xmat", "arg_names": [], "import_names": [], "rhs_call_name": "fetch_data", "annotation": ""}, "snippet": " xmat = self.fetch_data(state, chunk_idx)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L244_C16", "label": "print()", "type": "expression", "loc": [244, 244], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L242_C12", "vector": [8, 4, 0.2844, 0.0012, 4, 0.84, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(self.probability(xmat, state, chunk_idx))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L246_C4", "label": "fetch_data", "type": "function", "loc": [246, 251], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "vector": [2, 1, 0.2896, 0.007, 1, 0.63, 0.2, 309, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "fetch_data", "arg_names": ["self", "state", "chunk_idx"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def fetch_data(self, state, chunk_idx):\n chunk_params = self.models['chunk_params']\n n_steps = chunk_params['chunk_dim'][state][chunk_idx]\n x_mat = self.vectorizer.get_n_steps('/pressure/l_gripper_motor', \\\n rospy.get_rostime().to_time(), n_steps)\n return x_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L247_C8", "label": "chunk_params =", "type": "assigned_variable", "loc": [247, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L246_C4", "vector": [14, 2, 0.2879, 0.0012, 2, 0.07, 0.0, 844, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "chunk_params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " chunk_params = self.models['chunk_params']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L248_C8", "label": "n_steps =", "type": "assigned_variable", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L246_C4", "vector": [14, 2, 0.289, 0.0012, 2, 0.07, 0.3333, 514, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "n_steps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_steps = chunk_params['chunk_dim'][state][chunk_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L249_C8", "label": "x_mat = get_n_steps()", "type": "assigned_variable", "loc": [249, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L246_C4", "vector": [14, 2, 0.2908, 0.0023, 2, 0.07, 0.6667, 590, 3, 3, 0, 0, 127, 10, 3], "semantic": {"name": "x_mat", "arg_names": [], "import_names": [], "rhs_call_name": "get_n_steps", "annotation": ""}, "snippet": " x_mat = self.vectorizer.get_n_steps('/pressure/l_gripper_motor', \\\n rospy.get_rostime().to_time(), n_steps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L251_C8", "label": "return", "type": "return", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L246_C4", "vector": [13, 2, 0.2925, 0.0012, 2, 0.07, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return x_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "label": "probability", "type": "function", "loc": [253, 275], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "vector": [2, 1, 0.3077, 0.0268, 1, 0.63, 0.3, 916, 0, 5, 1, 0, 0, 0, 9], "semantic": {"name": "probability", "arg_names": ["self", "x_mat", "state", "chunk_idx", "successp"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def probability(self, x_mat, state, chunk_idx, successp):\n models = self.models['models']\n chunk_params = self.models['chunk_params']\n\n #Subtract out the mean\n x_vec = np.reshape(x_mat, (x_mat.shape[0] * x_mat.shape[1], 1)) - models[state][chunk_idx]['mean']\n #project\n projected_x = np.array((models[state][chunk_idx]['project'].T * x_vec).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L254_C8", "label": "models =", "type": "assigned_variable", "loc": [254, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "vector": [14, 2, 0.296, 0.0012, 2, 0.02, 0.0, 495, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " models = self.models['models']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L255_C8", "label": "chunk_params =", "type": "assigned_variable", "loc": [255, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "vector": [14, 2, 0.2972, 0.0012, 2, 0.02, 0.0909, 844, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "chunk_params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " chunk_params = self.models['chunk_params']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L258_C8", "label": "x_vec =", "type": "assigned_variable", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "vector": [14, 2, 0.3007, 0.0012, 2, 0.02, 0.1818, 703, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "x_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_vec = np.reshape(x_mat, (x_mat.shape[0] * x_mat.shape[1], 1)) - models[state][chunk_idx]['mean']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L260_C8", "label": "projected_x = array()", "type": "assigned_variable", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "vector": [14, 2, 0.303, 0.0012, 2, 0.02, 0.2727, 172, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "projected_x", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " projected_x = np.array((models[state][chunk_idx]['project'].T * x_vec).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L262_C8", "label": "succ_prob = evaluate()", "type": "assigned_variable", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "vector": [14, 2, 0.3054, 0.0012, 2, 0.02, 0.3636, 835, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "succ_prob", "arg_names": [], "import_names": [], "rhs_call_name": "evaluate", "annotation": ""}, "snippet": " succ_prob = models[state][chunk_idx]['kde'][0].evaluate(np.array(projected_x))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L263_C8", "label": "fail_prob = evaluate()", "type": "assigned_variable", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "vector": [14, 2, 0.3065, 0.0012, 2, 0.02, 0.4545, 187, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "fail_prob", "arg_names": [], "import_names": [], "rhs_call_name": "evaluate", "annotation": ""}, "snippet": " fail_prob = models[state][chunk_idx]['kde'][1].evaluate(np.array(projected_x))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L264_C8", "label": "succ_total =", "type": "assigned_variable", "loc": [264, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "vector": [14, 2, 0.3077, 0.0012, 2, 0.02, 0.5455, 936, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "succ_total", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " succ_total = np.sum(models[state][chunk_idx]['labels']) / float(models[state][chunk_idx]['labels'].shape[1]) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L265_C8", "label": "fail_total =", "type": "assigned_variable", "loc": [265, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "vector": [14, 2, 0.3089, 0.0012, 2, 0.02, 0.6364, 182, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fail_total", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fail_total = 1 - succ_total"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L267_C8", "label": "if", "type": "if", "loc": [267, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "vector": [4, 2, 0.3129, 0.0047, 2, 0.02, 0.7273, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if successp:\n prob = (succ_prob * succ_total) / ((fail_prob*fail_total) + (succ_total*succ_prob))\n else:\n prob = (fail_prob * fail_total) / ((fail_prob*fail_total) + (succ_total*succ_prob))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L268_C12", "label": "prob =", "type": "assigned_variable", "loc": [268, 268], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L267_C8", "vector": [14, 3, 0.3124, 0.0012, 3, 0.43, 0.0, 24, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prob", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prob = (succ_prob * succ_total) / ((fail_prob*fail_total) + (succ_total*succ_prob))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L270_C12", "label": "prob =", "type": "assigned_variable", "loc": [270, 270], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L267_C8", "vector": [14, 3, 0.3147, 0.0012, 3, 0.43, 1.0, 24, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prob", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prob = (fail_prob * fail_total) / ((fail_prob*fail_total) + (succ_total*succ_prob))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L273_C8", "label": "n_steps =", "type": "assigned_variable", "loc": [273, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "vector": [14, 2, 0.3182, 0.0012, 2, 0.02, 0.8182, 514, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "n_steps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_steps = chunk_params['chunk_dim'][state][chunk_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L274_C8", "label": "print()", "type": "expression", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "vector": [8, 2, 0.3193, 0.0012, 2, 0.02, 0.9091, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('frame size %d state %d chunk %d prob %.3f' % (n_steps, state, chunk_idx, prob))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L275_C8", "label": "return", "type": "return", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "vector": [13, 2, 0.3205, 0.0012, 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 prob"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L277_C4", "label": "save_models", "type": "function", "loc": [277, 279], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "vector": [2, 1, 0.324, 0.0035, 1, 0.63, 0.4, 427, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "save_models", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def save_models(self, name='timeseries_pca_model.pkl'):\n print('saving models')\n ut.save_pickle(self.models, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L278_C8", "label": "print()", "type": "expression", "loc": [278, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L277_C4", "vector": [8, 2, 0.324, 0.0012, 2, 0.09, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('saving models')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L279_C8", "label": "save_pickle()", "type": "expression", "loc": [279, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L277_C4", "vector": [8, 2, 0.3252, 0.0012, 2, 0.09, 1.0, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(self.models, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L281_C4", "label": "load_models", "type": "function", "loc": [281, 296], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "vector": [2, 1, 0.3362, 0.0186, 1, 0.63, 0.5, 685, 0, 2, 0, 0, 0, 0, 13], "semantic": {"name": "load_models", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def load_models(self, name='timeseries_pca_model.pkl'):\n print('loading models')\n self.models = ut.load_pickle(name)\n #print self.models.__class__, self.models.keys()\n models = self.models['models']\n for state in range(len(models.keys())):\n for chunk_idx in range(len(models[state])):\n #print models.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L282_C8", "label": "print()", "type": "expression", "loc": [282, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L281_C4", "vector": [8, 2, 0.3287, 0.0012, 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('loading models')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L283_C8", "label": "self.models = load_pickle()", "type": "assigned_variable", "loc": [283, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L281_C4", "vector": [14, 2, 0.3298, 0.0012, 2, 0.12, 0.3333, 134, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "self.models", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " self.models = ut.load_pickle(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L285_C8", "label": "models =", "type": "assigned_variable", "loc": [285, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L281_C4", "vector": [14, 2, 0.3322, 0.0012, 2, 0.12, 0.6667, 495, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " models = self.models['models']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L286_C8", "label": "for state", "type": "for", "loc": [286, 296], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L281_C4", "vector": [6, 2, 0.3392, 0.0128, 2, 0.12, 1.0, 688, 3, 0, 0, 0, 0, 0, 11], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for state in range(len(models.keys())):\n for chunk_idx in range(len(models[state])):\n #print models.keys()\n reduced_data = models[state][chunk_idx]['reduced'] \n\n #labels = np.column_stack((np.matrix(np.ones((1, num_pos))), np.matrix(np.zeros((1, num_neg)))))\n success_data = reduced_data[:, (np.where(models[state][chunk_idx]['labels'] > 0))[1].A1]\n failure_data = reduced_data[:, (np.where(models[state][chunk_idx]['labels'] == 0))[1].A1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L287_C12", "label": "for chunk_idx", "type": "for", "loc": [287, 296], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L286_C8", "vector": [6, 3, 0.3397, 0.0117, 3, 0.86, 0.0, 501, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "chunk_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for chunk_idx in range(len(models[state])):\n #print models.keys()\n reduced_data = models[state][chunk_idx]['reduced'] \n\n #labels = np.column_stack((np.matrix(np.ones((1, num_pos))), np.matrix(np.zeros((1, num_neg)))))\n success_data = reduced_data[:, (np.where(models[state][chunk_idx]['labels'] > 0))[1].A1]\n failure_data = reduced_data[:, (np.where(models[state][chunk_idx]['labels'] == 0))[1].A1]\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L289_C16", "label": "reduced_data =", "type": "assigned_variable", "loc": [289, 289], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L287_C12", "vector": [14, 4, 0.3368, 0.0012, 4, 0.62, 0.0, 960, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "reduced_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " reduced_data = models[state][chunk_idx]['reduced'] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L292_C16", "label": "success_data =", "type": "assigned_variable", "loc": [292, 292], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L287_C12", "vector": [14, 4, 0.3403, 0.0012, 4, 0.62, 0.3333, 414, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "success_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " success_data = reduced_data[:, (np.where(models[state][chunk_idx]['labels'] > 0))[1].A1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L293_C16", "label": "failure_data =", "type": "assigned_variable", "loc": [293, 293], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L287_C12", "vector": [14, 4, 0.3415, 0.0012, 4, 0.62, 0.6667, 660, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "failure_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " failure_data = reduced_data[:, (np.where(models[state][chunk_idx]['labels'] == 0))[1].A1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L295_C16", "label": "assign", "type": "assigned_variable", "loc": [295, 296], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L287_C12", "vector": [14, 4, 0.3444, 0.0023, 4, 0.62, 1.0, 0, 0, 0, 0, 0, 0, 5, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " models[state][chunk_idx]['kde'] = [kde.gaussian_kde(np.array(success_data)), \n kde.gaussian_kde(np.array(failure_data))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "label": "create_model", "type": "function", "loc": [299, 356], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "vector": [2, 1, 0.3817, 0.0676, 1, 0.63, 0.6, 682, 0, 3, 0, 0, 0, 0, 30], "semantic": {"name": "create_model", "arg_names": ["self", "succ_pickle", "fail_pickle"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_model(self, succ_pickle, fail_pickle):\n print('creating model...')\n topic = '/pressure/l_gripper_motor'\n SEGMENT_LENGTH = 1.0\n VARIANCE_KEEP = .7\n\n # load in pickle\n print('loading pickles')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L300_C8", "label": "print()", "type": "expression", "loc": [300, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "vector": [8, 2, 0.3497, 0.0012, 2, 0.62, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('creating model...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L301_C8", "label": "topic =", "type": "assigned_variable", "loc": [301, 301], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "vector": [14, 2, 0.3508, 0.0012, 2, 0.62, 0.0769, 225, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " topic = '/pressure/l_gripper_motor'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L302_C8", "label": "SEGMENT_LENGTH =", "type": "assigned_variable", "loc": [302, 302], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "vector": [14, 2, 0.352, 0.0012, 2, 0.62, 0.1538, 254, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "SEGMENT_LENGTH", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " SEGMENT_LENGTH = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L303_C8", "label": "VARIANCE_KEEP =", "type": "assigned_variable", "loc": [303, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "vector": [14, 2, 0.3531, 0.0012, 2, 0.62, 0.2308, 187, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "VARIANCE_KEEP", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " VARIANCE_KEEP = .7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L306_C8", "label": "print()", "type": "expression", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "vector": [8, 2, 0.3566, 0.0012, 2, 0.62, 0.3077, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('loading pickles')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L307_C8", "label": "successes = load_pickle()", "type": "assigned_variable", "loc": [307, 307], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "vector": [14, 2, 0.3578, 0.0012, 2, 0.62, 0.3846, 797, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "successes", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " successes = ut.load_pickle(succ_pickle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L308_C8", "label": "failures = load_pickle()", "type": "assigned_variable", "loc": [308, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "vector": [14, 2, 0.359, 0.0012, 2, 0.62, 0.4615, 276, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "failures", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " failures = ut.load_pickle(fail_pickle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L312_C8", "label": "print()", "type": "expression", "loc": [312, 312], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "vector": [8, 2, 0.3636, 0.0012, 2, 0.62, 0.5385, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('preprocess pickles')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L313_C8", "label": "success_data_sets, failure_data_sets, chunk_params = preprocess_pickles()", "type": "assigned_variable", "loc": [313, 314], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "vector": [14, 2, 0.3654, 0.0023, 2, 0.62, 0.6154, 384, 3, 4, 0, 0, 514, 10, 1], "semantic": {"name": "success_data_sets, failure_data_sets, chunk_params", "arg_names": [], "import_names": [], "rhs_call_name": "preprocess_pickles", "annotation": ""}, "snippet": " success_data_sets, failure_data_sets, chunk_params = self.preprocess_pickles(successes, \\\n failures, topic, SEGMENT_LENGTH)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L317_C8", "label": "combined_sets =", "type": "assigned_variable", "loc": [317, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "vector": [14, 2, 0.3695, 0.0012, 2, 0.62, 0.6923, 195, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "combined_sets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " combined_sets = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L318_C8", "label": "for dset_name, datasets", "type": "for", "loc": [318, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "vector": [6, 2, 0.3765, 0.0128, 2, 0.62, 0.7692, 963, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "dset_name, datasets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for dset_name, datasets in zip(['success', 'failure'], [success_data_sets, failure_data_sets]):\n #merge the two matrices from mat_set\n mat_set = self.create_matrix_from_chunked_datasets(datasets)\n for state in range(len(datasets.keys())):\n if not combined_sets.has_key(state):\n combined_sets[state] = {}\n for chunk_idx in range(len(datasets[state])):\n if not combined_sets[state].has_key(chunk_idx):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L320_C12", "label": "mat_set = create_matrix_from_chunked_datasets()", "type": "assigned_variable", "loc": [320, 320], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L318_C8", "vector": [14, 3, 0.373, 0.0012, 3, 0.7, 0.0, 20, 3, 1, 0, 0, 967, 10, 1], "semantic": {"name": "mat_set", "arg_names": [], "import_names": [], "rhs_call_name": "create_matrix_from_chunked_datasets", "annotation": ""}, "snippet": " mat_set = self.create_matrix_from_chunked_datasets(datasets)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L321_C12", "label": "for state", "type": "for", "loc": [321, 328], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L318_C8", "vector": [6, 3, 0.3782, 0.0093, 3, 0.7, 1.0, 688, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for state in range(len(datasets.keys())):\n if not combined_sets.has_key(state):\n combined_sets[state] = {}\n for chunk_idx in range(len(datasets[state])):\n if not combined_sets[state].has_key(chunk_idx):\n combined_sets[state][chunk_idx] = {}\n combined_sets[state][chunk_idx][dset_name] = mat_set[state][chunk_idx]['data']\n combined_sets[state][chunk_idx]['time'] = mat_set[state][chunk_idx]['time']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L322_C16", "label": "if", "type": "if", "loc": [322, 323], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L321_C12", "vector": [4, 4, 0.3759, 0.0023, 4, 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 combined_sets.has_key(state):\n combined_sets[state] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L323_C20", "label": "assign", "type": "assigned_variable", "loc": [323, 323], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L322_C16", "vector": [14, 5, 0.3765, 0.0012, 5, 0.5, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " combined_sets[state] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L324_C16", "label": "for chunk_idx", "type": "for", "loc": [324, 328], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L321_C12", "vector": [6, 4, 0.38, 0.0058, 4, 0.16, 1.0, 501, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "chunk_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for chunk_idx in range(len(datasets[state])):\n if not combined_sets[state].has_key(chunk_idx):\n combined_sets[state][chunk_idx] = {}\n combined_sets[state][chunk_idx][dset_name] = mat_set[state][chunk_idx]['data']\n combined_sets[state][chunk_idx]['time'] = mat_set[state][chunk_idx]['time']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L325_C20", "label": "if", "type": "if", "loc": [325, 326], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L324_C16", "vector": [4, 5, 0.3794, 0.0023, 5, 0.25, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not combined_sets[state].has_key(chunk_idx):\n combined_sets[state][chunk_idx] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L326_C24", "label": "assign", "type": "assigned_variable", "loc": [326, 326], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L325_C20", "vector": [14, 6, 0.38, 0.0012, 6, 0.53, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " combined_sets[state][chunk_idx] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L327_C20", "label": "assign", "type": "assigned_variable", "loc": [327, 327], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L324_C16", "vector": [14, 5, 0.3811, 0.0012, 5, 0.25, 0.5, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " combined_sets[state][chunk_idx][dset_name] = mat_set[state][chunk_idx]['data']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L328_C20", "label": "assign", "type": "assigned_variable", "loc": [328, 328], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L324_C16", "vector": [14, 5, 0.3823, 0.0012, 5, 0.25, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " combined_sets[state][chunk_idx]['time'] = mat_set[state][chunk_idx]['time']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L331_C8", "label": "models =", "type": "assigned_variable", "loc": [331, 331], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "vector": [14, 2, 0.3858, 0.0012, 2, 0.62, 0.8462, 495, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " models = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L332_C8", "label": "for state", "type": "for", "loc": [332, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "vector": [6, 2, 0.3992, 0.0256, 2, 0.62, 0.9231, 688, 3, 0, 0, 0, 0, 0, 15], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for state in range(len(combined_sets.keys())):\n models[state] = []\n for chunk_idx in range(len(combined_sets[state])):\n print('building model for state', state, 'chunk idx', chunk_idx)\n # pdb.set_trace()\n data_chunk = np.column_stack((combined_sets[state][chunk_idx]['success'], \\\n combined_sets[state][chunk_idx]['failure']))\n num_pos = combined_sets[state][chunk_idx]['success'].shape[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L333_C12", "label": "assign", "type": "assigned_variable", "loc": [333, 333], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L332_C8", "vector": [14, 3, 0.3881, 0.0012, 3, 0.82, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " models[state] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L334_C12", "label": "for chunk_idx", "type": "for", "loc": [334, 353], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L332_C8", "vector": [6, 3, 0.4003, 0.0233, 3, 0.82, 1.0, 501, 3, 0, 0, 0, 0, 0, 12], "semantic": {"name": "chunk_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for chunk_idx in range(len(combined_sets[state])):\n print('building model for state', state, 'chunk idx', chunk_idx)\n # pdb.set_trace()\n data_chunk = np.column_stack((combined_sets[state][chunk_idx]['success'], \\\n combined_sets[state][chunk_idx]['failure']))\n num_pos = combined_sets[state][chunk_idx]['success'].shape[1]\n num_neg = combined_sets[state][chunk_idx]['failure'].shape[1]\n labels = np.column_stack((np.matrix(np.ones((1, num_pos))), np.matrix(np.zeros((1, num_neg)))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L335_C16", "label": "print()", "type": "expression", "loc": [335, 335], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L334_C12", "vector": [8, 4, 0.3904, 0.0012, 4, 0.19, 0.0, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('building model for state', state, 'chunk idx', chunk_idx)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L337_C16", "label": "data_chunk = column_stack()", "type": "assigned_variable", "loc": [337, 338], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L334_C12", "vector": [14, 4, 0.3934, 0.0023, 4, 0.19, 0.125, 43, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "data_chunk", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " data_chunk = np.column_stack((combined_sets[state][chunk_idx]['success'], \\\n combined_sets[state][chunk_idx]['failure']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L339_C16", "label": "num_pos =", "type": "assigned_variable", "loc": [339, 339], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L334_C12", "vector": [14, 4, 0.3951, 0.0012, 4, 0.19, 0.25, 855, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "num_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num_pos = combined_sets[state][chunk_idx]['success'].shape[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L340_C16", "label": "num_neg =", "type": "assigned_variable", "loc": [340, 340], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L334_C12", "vector": [14, 4, 0.3963, 0.0012, 4, 0.19, 0.375, 627, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "num_neg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num_neg = combined_sets[state][chunk_idx]['failure'].shape[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L341_C16", "label": "labels = column_stack()", "type": "assigned_variable", "loc": [341, 341], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L334_C12", "vector": [14, 4, 0.3974, 0.0012, 4, 0.19, 0.5, 283, 3, 1, 0, 0, 724, 10, 5], "semantic": {"name": "labels", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " labels = np.column_stack((np.matrix(np.ones((1, num_pos))), np.matrix(np.zeros((1, num_neg)))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L343_C16", "label": "projection_basis, dmean = pca_vectors()", "type": "assigned_variable", "loc": [343, 343], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L334_C12", "vector": [14, 4, 0.3998, 0.0012, 4, 0.19, 0.625, 931, 3, 2, 0, 0, 712, 10, 1], "semantic": {"name": "projection_basis, dmean", "arg_names": [], "import_names": [], "rhs_call_name": "pca_vectors", "annotation": ""}, "snippet": " projection_basis, dmean = dimreduce.pca_vectors(data_chunk, VARIANCE_KEEP)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L344_C16", "label": "print()", "type": "expression", "loc": [344, 344], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L334_C12", "vector": [8, 4, 0.4009, 0.0012, 4, 0.19, 0.75, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('pca_basis: number of dimensions', projection_basis.shape[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L345_C16", "label": "reduced_data =", "type": "assigned_variable", "loc": [345, 345], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L334_C12", "vector": [14, 4, 0.4021, 0.0012, 4, 0.19, 0.875, 960, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "reduced_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " reduced_data = projection_basis.T * (data_chunk-dmean)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L346_C16", "label": "append()", "type": "expression", "loc": [346, 353], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L334_C12", "vector": [8, 4, 0.4073, 0.0093, 4, 0.19, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " models[state].append({'time': combined_sets[state][chunk_idx]['time'],\n 'project': projection_basis,\n 'reduced': reduced_data,\n 'labels': labels,\n 'mean': dmean,\n 'data': data_chunk\n #'tree': sp.KDTree(np.array(reduced_data.T))\n })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L355_C8", "label": "self.models =", "type": "assigned_variable", "loc": [355, 356], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "vector": [14, 2, 0.4143, 0.0023, 2, 0.62, 1.0, 134, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.models = {'models':models, \n 'chunk_params': chunk_params}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L359_C4", "label": "create_matrix_from_chunked_datasets", "type": "function", "loc": [359, 372], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "vector": [2, 1, 0.426, 0.0163, 1, 0.63, 0.7, 967, 0, 2, 1, 0, 0, 0, 10], "semantic": {"name": "create_matrix_from_chunked_datasets", "arg_names": ["self", "datasets"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_matrix_from_chunked_datasets(self, datasets):\n mat_set = {}\n for state in range(len(datasets.keys())):\n mat_set[state] = {}\n for chunk_idx in range(len(datasets[state])):\n records_l = []\n for chunk_record in range(len(datasets[state][chunk_idx]['data'])):\n a = datasets[state][chunk_idx]['data'][chunk_record]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L360_C8", "label": "mat_set =", "type": "assigned_variable", "loc": [360, 360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L359_C4", "vector": [14, 2, 0.4196, 0.0012, 2, 0.66, 0.0, 20, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "mat_set", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mat_set = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L361_C8", "label": "for state", "type": "for", "loc": [361, 371], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L359_C4", "vector": [6, 2, 0.4266, 0.0128, 2, 0.66, 0.5, 688, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for state in range(len(datasets.keys())):\n mat_set[state] = {}\n for chunk_idx in range(len(datasets[state])):\n records_l = []\n for chunk_record in range(len(datasets[state][chunk_idx]['data'])):\n a = datasets[state][chunk_idx]['data'][chunk_record]\n records_l.append(np.reshape(a, (a.shape[0]*a.shape[1], 1)))\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L362_C12", "label": "assign", "type": "assigned_variable", "loc": [362, 362], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L361_C8", "vector": [14, 3, 0.4219, 0.0012, 3, 0.6, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mat_set[state] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L363_C12", "label": "for chunk_idx", "type": "for", "loc": [363, 371], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L361_C8", "vector": [6, 3, 0.4277, 0.0105, 3, 0.6, 1.0, 501, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "chunk_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for chunk_idx in range(len(datasets[state])):\n records_l = []\n for chunk_record in range(len(datasets[state][chunk_idx]['data'])):\n a = datasets[state][chunk_idx]['data'][chunk_record]\n records_l.append(np.reshape(a, (a.shape[0]*a.shape[1], 1)))\n\n mat_set[state][chunk_idx] = {}\n mat_set[state][chunk_idx]['data'] = np.column_stack(records_l) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L364_C16", "label": "records_l =", "type": "assigned_variable", "loc": [364, 364], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L363_C12", "vector": [14, 4, 0.4242, 0.0012, 4, 0.86, 0.0, 449, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "records_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " records_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L365_C16", "label": "for chunk_record", "type": "for", "loc": [365, 367], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L363_C12", "vector": [6, 4, 0.4266, 0.0035, 4, 0.86, 0.25, 811, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "chunk_record", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for chunk_record in range(len(datasets[state][chunk_idx]['data'])):\n a = datasets[state][chunk_idx]['data'][chunk_record]\n records_l.append(np.reshape(a, (a.shape[0]*a.shape[1], 1)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L366_C20", "label": "a =", "type": "assigned_variable", "loc": [366, 366], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L365_C16", "vector": [14, 5, 0.4266, 0.0012, 5, 0.64, 0.0, 475, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " a = datasets[state][chunk_idx]['data'][chunk_record]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L367_C20", "label": "append()", "type": "expression", "loc": [367, 367], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L365_C16", "vector": [8, 5, 0.4277, 0.0012, 5, 0.64, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " records_l.append(np.reshape(a, (a.shape[0]*a.shape[1], 1)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L369_C16", "label": "assign", "type": "assigned_variable", "loc": [369, 369], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L363_C12", "vector": [14, 4, 0.4301, 0.0012, 4, 0.86, 0.5, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mat_set[state][chunk_idx] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L370_C16", "label": " = column_stack()", "type": "assigned_variable", "loc": [370, 370], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L363_C12", "vector": [14, 4, 0.4312, 0.0012, 4, 0.86, 0.75, 0, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " mat_set[state][chunk_idx]['data'] = np.column_stack(records_l) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L371_C16", "label": "assign", "type": "assigned_variable", "loc": [371, 371], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L363_C12", "vector": [14, 4, 0.4324, 0.0012, 4, 0.86, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mat_set[state][chunk_idx]['time'] = datasets[state][chunk_idx]['time']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L372_C8", "label": "return", "type": "return", "loc": [372, 372], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L359_C4", "vector": [13, 2, 0.4336, 0.0012, 2, 0.66, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mat_set"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "label": "preprocess_pickles", "type": "function", "loc": [374, 429], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "vector": [2, 1, 0.4679, 0.0653, 1, 0.63, 0.8, 514, 0, 5, 1, 0, 0, 0, 33], "semantic": {"name": "preprocess_pickles", "arg_names": ["self", "successes", "failures", "topic", "segment_length"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def preprocess_pickles(self, successes, failures, topic, segment_length):\n #Break matrices into segments based on state\n # list of list of 44xN matrices\n success_matrices_segmented_by_state = construct_list_of_segmented_matrices_from_trial_recording(successes, topic)\n failure_matrices_segmented_by_state = construct_list_of_segmented_matrices_from_trial_recording(failures, topic)\n\n #Calculate how long each chunk needs to be\n success_trial_durations = find_trial_durations(successes, topic) # trial_durations[state][trial number]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L377_C8", "label": "success_matrices_segmented_by_state = construct_list_of_segmented_matrices_from_trial_recording()", "type": "assigned_variable", "loc": [377, 377], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "vector": [14, 2, 0.4394, 0.0012, 2, 0.7, 0.0, 260, 3, 2, 0, 0, 603, 10, 1], "semantic": {"name": "success_matrices_segmented_by_state", "arg_names": [], "import_names": [], "rhs_call_name": "construct_list_of_segmented_matrices_from_trial_recording", "annotation": ""}, "snippet": " success_matrices_segmented_by_state = construct_list_of_segmented_matrices_from_trial_recording(successes, topic)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L378_C8", "label": "failure_matrices_segmented_by_state = construct_list_of_segmented_matrices_from_trial_recording()", "type": "assigned_variable", "loc": [378, 378], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "vector": [14, 2, 0.4406, 0.0012, 2, 0.7, 0.0833, 474, 3, 2, 0, 0, 603, 10, 1], "semantic": {"name": "failure_matrices_segmented_by_state", "arg_names": [], "import_names": [], "rhs_call_name": "construct_list_of_segmented_matrices_from_trial_recording", "annotation": ""}, "snippet": " failure_matrices_segmented_by_state = construct_list_of_segmented_matrices_from_trial_recording(failures, topic)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L381_C8", "label": "success_trial_durations = find_trial_durations()", "type": "assigned_variable", "loc": [381, 381], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "vector": [14, 2, 0.4441, 0.0012, 2, 0.7, 0.1667, 213, 3, 2, 0, 0, 234, 10, 1], "semantic": {"name": "success_trial_durations", "arg_names": [], "import_names": [], "rhs_call_name": "find_trial_durations", "annotation": ""}, "snippet": " success_trial_durations = find_trial_durations(successes, topic) # trial_durations[state][trial number]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L382_C8", "label": "failure_trial_durations = find_trial_durations()", "type": "assigned_variable", "loc": [382, 382], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "vector": [14, 2, 0.4452, 0.0012, 2, 0.7, 0.25, 327, 3, 2, 0, 0, 234, 10, 1], "semantic": {"name": "failure_trial_durations", "arg_names": [], "import_names": [], "rhs_call_name": "find_trial_durations", "annotation": ""}, "snippet": " failure_trial_durations = find_trial_durations(failures, topic) # trial_durations[state][trial number]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L387_C8", "label": "minimal_trial_lengths =", "type": "assigned_variable", "loc": [387, 388], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "vector": [14, 2, 0.4516, 0.0023, 2, 0.7, 0.3333, 613, 5, 0, 0, 0, 0, 0, 6], "semantic": {"name": "minimal_trial_lengths", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " minimal_trial_lengths = [np.min(np.min(success_trial_durations[state]), np.min(failure_trial_durations[state])) \\\n for state in range(len(success_trial_durations.keys()))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L389_C8", "label": "chunk_times =", "type": "assigned_variable", "loc": [389, 389], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "vector": [14, 2, 0.4534, 0.0012, 2, 0.7, 0.4167, 860, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "chunk_times", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " chunk_times = [length/np.floor(length/segment_length) for length in minimal_trial_lengths]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L392_C8", "label": "success_data_sets = break_record_matrices_into_chunks()", "type": "assigned_variable", "loc": [392, 393], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "vector": [14, 2, 0.4575, 0.0023, 2, 0.7, 0.5, 989, 3, 5, 0, 0, 762, 10, 1], "semantic": {"name": "success_data_sets", "arg_names": [], "import_names": [], "rhs_call_name": "break_record_matrices_into_chunks", "annotation": ""}, "snippet": " success_data_sets = break_record_matrices_into_chunks(successes, success_matrices_segmented_by_state, \\\n minimal_trial_lengths, chunk_times, topic)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L394_C8", "label": "failure_data_sets = break_record_matrices_into_chunks()", "type": "assigned_variable", "loc": [394, 395], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "vector": [14, 2, 0.4598, 0.0023, 2, 0.7, 0.5833, 121, 3, 5, 0, 0, 762, 10, 1], "semantic": {"name": "failure_data_sets", "arg_names": [], "import_names": [], "rhs_call_name": "break_record_matrices_into_chunks", "annotation": ""}, "snippet": " failure_data_sets = break_record_matrices_into_chunks(failures, failure_matrices_segmented_by_state, \\\n minimal_trial_lengths, chunk_times, topic)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L398_C8", "label": "chunk_dim =", "type": "assigned_variable", "loc": [398, 398], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "vector": [14, 2, 0.4639, 0.0012, 2, 0.7, 0.6667, 107, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "chunk_dim", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " chunk_dim = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L399_C8", "label": "for state", "type": "for", "loc": [399, 409], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "vector": [6, 2, 0.4709, 0.0128, 2, 0.7, 0.75, 688, 3, 0, 0, 0, 0, 0, 12], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for state in range(len(successes.keys())):\n chunk_dim[state] = {}\n for chunk_idx in range(len(success_data_sets[state])):\n #figure minimum chunk lengths in array size\n chunk_length_successes = [success_data_sets[state][chunk_idx]['data'][chunk_record].shape[1] \\\n for chunk_record in range(len(success_data_sets[state][chunk_idx]['data']))]\n chunk_length_failures = [failure_data_sets[state][chunk_idx]['data'][chunk_record].shape[1] \\\n for chunk_record in range(len(failure_data_sets[state][chunk_idx]['data']))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L400_C12", "label": "assign", "type": "assigned_variable", "loc": [400, 400], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L399_C8", "vector": [14, 3, 0.4662, 0.0012, 3, 0.07, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " chunk_dim[state] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L401_C12", "label": "for chunk_idx", "type": "for", "loc": [401, 409], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L399_C8", "vector": [6, 3, 0.472, 0.0105, 3, 0.07, 1.0, 501, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "chunk_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for chunk_idx in range(len(success_data_sets[state])):\n #figure minimum chunk lengths in array size\n chunk_length_successes = [success_data_sets[state][chunk_idx]['data'][chunk_record].shape[1] \\\n for chunk_record in range(len(success_data_sets[state][chunk_idx]['data']))]\n chunk_length_failures = [failure_data_sets[state][chunk_idx]['data'][chunk_record].shape[1] \\\n for chunk_record in range(len(failure_data_sets[state][chunk_idx]['data']))]\n #pdb.set_trace()\n shortest_chunk_length = np.min([np.min(chunk_length_successes), np.min(chunk_length_failures)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L403_C16", "label": "chunk_length_successes =", "type": "assigned_variable", "loc": [403, 404], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L401_C12", "vector": [14, 4, 0.4703, 0.0023, 4, 0.06, 0.0, 193, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "chunk_length_successes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " chunk_length_successes = [success_data_sets[state][chunk_idx]['data'][chunk_record].shape[1] \\\n for chunk_record in range(len(success_data_sets[state][chunk_idx]['data']))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L405_C16", "label": "chunk_length_failures =", "type": "assigned_variable", "loc": [405, 406], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L401_C12", "vector": [14, 4, 0.4726, 0.0023, 4, 0.06, 0.3333, 651, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "chunk_length_failures", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " chunk_length_failures = [failure_data_sets[state][chunk_idx]['data'][chunk_record].shape[1] \\\n for chunk_record in range(len(failure_data_sets[state][chunk_idx]['data']))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L408_C16", "label": "shortest_chunk_length = min()", "type": "assigned_variable", "loc": [408, 408], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L401_C12", "vector": [14, 4, 0.4755, 0.0012, 4, 0.06, 0.6667, 458, 3, 1, 0, 0, 867, 10, 3], "semantic": {"name": "shortest_chunk_length", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " shortest_chunk_length = np.min([np.min(chunk_length_successes), np.min(chunk_length_failures)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L409_C16", "label": "assign", "type": "assigned_variable", "loc": [409, 409], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L401_C12", "vector": [14, 4, 0.4767, 0.0012, 4, 0.06, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " chunk_dim[state][chunk_idx] = shortest_chunk_length"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L414_C8", "label": "for state", "type": "for", "loc": [414, 420], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "vector": [6, 2, 0.486, 0.0082, 2, 0.7, 0.8333, 688, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for state in range(len(successes.keys())):\n for chunk_idx in range(len(success_data_sets[state])): \n for dataset_idx, data_sets in enumerate([success_data_sets, failure_data_sets]):\n for chunk_record in range(len(data_sets[state][chunk_idx]['data'])):\n shortest_chunk_length = chunk_dim[state][chunk_idx]\n data_sets[state][chunk_idx]['data'][chunk_record] = \\\n data_sets[state][chunk_idx]['data'][chunk_record][:,:shortest_chunk_length]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L415_C12", "label": "for chunk_idx", "type": "for", "loc": [415, 420], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L414_C8", "vector": [6, 3, 0.4866, 0.007, 3, 0.68, 0.0, 501, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "chunk_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for chunk_idx in range(len(success_data_sets[state])): \n for dataset_idx, data_sets in enumerate([success_data_sets, failure_data_sets]):\n for chunk_record in range(len(data_sets[state][chunk_idx]['data'])):\n shortest_chunk_length = chunk_dim[state][chunk_idx]\n data_sets[state][chunk_idx]['data'][chunk_record] = \\\n data_sets[state][chunk_idx]['data'][chunk_record][:,:shortest_chunk_length]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L416_C16", "label": "for dataset_idx, data_sets", "type": "for", "loc": [416, 420], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L415_C12", "vector": [6, 4, 0.4872, 0.0058, 4, 0.9, 0.0, 330, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "dataset_idx, data_sets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for dataset_idx, data_sets in enumerate([success_data_sets, failure_data_sets]):\n for chunk_record in range(len(data_sets[state][chunk_idx]['data'])):\n shortest_chunk_length = chunk_dim[state][chunk_idx]\n data_sets[state][chunk_idx]['data'][chunk_record] = \\\n data_sets[state][chunk_idx]['data'][chunk_record][:,:shortest_chunk_length]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L417_C20", "label": "for chunk_record", "type": "for", "loc": [417, 420], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L416_C16", "vector": [6, 5, 0.4878, 0.0047, 5, 0.7, 0.0, 811, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "chunk_record", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for chunk_record in range(len(data_sets[state][chunk_idx]['data'])):\n shortest_chunk_length = chunk_dim[state][chunk_idx]\n data_sets[state][chunk_idx]['data'][chunk_record] = \\\n data_sets[state][chunk_idx]['data'][chunk_record][:,:shortest_chunk_length]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L418_C24", "label": "shortest_chunk_length =", "type": "assigned_variable", "loc": [418, 418], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L417_C20", "vector": [14, 6, 0.4872, 0.0012, 6, 0.22, 0.0, 458, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "shortest_chunk_length", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " shortest_chunk_length = chunk_dim[state][chunk_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L419_C24", "label": "assign", "type": "assigned_variable", "loc": [419, 420], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L417_C20", "vector": [14, 6, 0.4889, 0.0023, 6, 0.22, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_sets[state][chunk_idx]['data'][chunk_record] = \\\n data_sets[state][chunk_idx]['data'][chunk_record][:,:shortest_chunk_length]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L425_C8", "label": "chunk_params =", "type": "assigned_variable", "loc": [425, 428], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "vector": [14, 2, 0.4971, 0.0047, 2, 0.7, 0.9167, 844, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "chunk_params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " chunk_params = {'chunk_dim': chunk_dim,\n 'trial_lengths': minimal_trial_lengths,\n 'chunk_times': chunk_times,\n 'topic': topic}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L429_C8", "label": "return", "type": "return", "loc": [429, 429], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "vector": [13, 2, 0.5, 0.0012, 2, 0.7, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return success_data_sets, failure_data_sets, chunk_params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L431_C4", "label": "preprocess_individual_pickle", "type": "function", "loc": [431, 452], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "vector": [2, 1, 0.5146, 0.0256, 1, 0.63, 0.9, 220, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "preprocess_individual_pickle", "arg_names": ["self", "apickle"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def preprocess_individual_pickle(self, apickle):\n data = ut.load_pickle(apickle)\n #models, chunk_params = self.models\n models = self.models['models']\n chunk_params = self.models['chunk_params']\n #break pickle into chunks given model.\n #chunks of equivalent time, chunks of equivalent dimensions\n data_segmented = construct_list_of_segmented_matrices_from_trial_recording(data, chunk_params['topic'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L432_C8", "label": "data = load_pickle()", "type": "assigned_variable", "loc": [432, 432], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L431_C4", "vector": [14, 2, 0.5035, 0.0012, 2, 0.04, 0.0, 929, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " data = ut.load_pickle(apickle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L434_C8", "label": "models =", "type": "assigned_variable", "loc": [434, 434], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L431_C4", "vector": [14, 2, 0.5058, 0.0012, 2, 0.04, 0.1667, 495, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " models = self.models['models']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L435_C8", "label": "chunk_params =", "type": "assigned_variable", "loc": [435, 435], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L431_C4", "vector": [14, 2, 0.507, 0.0012, 2, 0.04, 0.3333, 844, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "chunk_params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " chunk_params = self.models['chunk_params']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L438_C8", "label": "data_segmented = construct_list_of_segmented_matrices_from_trial_recording()", "type": "assigned_variable", "loc": [438, 438], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L431_C4", "vector": [14, 2, 0.5105, 0.0012, 2, 0.04, 0.5, 963, 3, 2, 0, 0, 603, 10, 1], "semantic": {"name": "data_segmented", "arg_names": [], "import_names": [], "rhs_call_name": "construct_list_of_segmented_matrices_from_trial_recording", "annotation": ""}, "snippet": " data_segmented = construct_list_of_segmented_matrices_from_trial_recording(data, chunk_params['topic'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L441_C8", "label": "chunked_data = break_record_matrices_into_chunks()", "type": "assigned_variable", "loc": [441, 442], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L431_C4", "vector": [14, 2, 0.5146, 0.0023, 2, 0.04, 0.6667, 921, 3, 5, 0, 0, 762, 10, 1], "semantic": {"name": "chunked_data", "arg_names": [], "import_names": [], "rhs_call_name": "break_record_matrices_into_chunks", "annotation": ""}, "snippet": " chunked_data = break_record_matrices_into_chunks(data, data_segmented, \\\n chunk_params['trial_lengths'], chunk_params['chunk_times'], chunk_params['topic'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L445_C8", "label": "for state", "type": "for", "loc": [445, 450], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L431_C4", "vector": [6, 2, 0.5216, 0.007, 2, 0.04, 0.8333, 688, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for state in range(len(models)):\n for chunk_idx in range(len(models[state])):\n for chunk_record in range(len(chunked_data[state][chunk_idx]['data'])):\n chunk_length = chunk_params['chunk_dim'][state][chunk_idx]\n chunked_data[state][chunk_idx]['data'][chunk_record] =\\\n chunked_data[state][chunk_idx]['data'][chunk_record][:, :chunk_length]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L446_C12", "label": "for chunk_idx", "type": "for", "loc": [446, 450], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L445_C8", "vector": [6, 3, 0.5221, 0.0058, 3, 0.82, 0.0, 501, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "chunk_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for chunk_idx in range(len(models[state])):\n for chunk_record in range(len(chunked_data[state][chunk_idx]['data'])):\n chunk_length = chunk_params['chunk_dim'][state][chunk_idx]\n chunked_data[state][chunk_idx]['data'][chunk_record] =\\\n chunked_data[state][chunk_idx]['data'][chunk_record][:, :chunk_length]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L447_C16", "label": "for chunk_record", "type": "for", "loc": [447, 450], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L446_C12", "vector": [6, 4, 0.5227, 0.0047, 4, 0.52, 0.0, 811, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "chunk_record", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for chunk_record in range(len(chunked_data[state][chunk_idx]['data'])):\n chunk_length = chunk_params['chunk_dim'][state][chunk_idx]\n chunked_data[state][chunk_idx]['data'][chunk_record] =\\\n chunked_data[state][chunk_idx]['data'][chunk_record][:, :chunk_length]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L448_C20", "label": "chunk_length =", "type": "assigned_variable", "loc": [448, 448], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L447_C16", "vector": [14, 5, 0.5221, 0.0012, 5, 0.0, 0.0, 679, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "chunk_length", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " chunk_length = chunk_params['chunk_dim'][state][chunk_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L449_C20", "label": "assign", "type": "assigned_variable", "loc": [449, 450], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L447_C16", "vector": [14, 5, 0.5239, 0.0023, 5, 0.0, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " chunked_data[state][chunk_idx]['data'][chunk_record] =\\\n chunked_data[state][chunk_idx]['data'][chunk_record][:, :chunk_length]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L452_C8", "label": "return", "type": "return", "loc": [452, 452], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L431_C4", "vector": [13, 2, 0.5268, 0.0012, 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 chunked_data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "label": "classify_pickle", "type": "function", "loc": [454, 502], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "vector": [2, 1, 0.5571, 0.0571, 1, 0.63, 1.0, 222, 0, 2, 0, 0, 0, 0, 33], "semantic": {"name": "classify_pickle", "arg_names": ["self", "apickle"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def classify_pickle(self, apickle):\n # a pickle can have multiple records...\n chunked_data = self.preprocess_individual_pickle(apickle)\n #mat_set = self.create_matrix_from_chunked_datasets(chunked_data)\n models = self.models['models']\n\n total_ex = models[0][0]['labels'].shape[1]\n pos_ex = np.sum(models[0][0]['labels'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L456_C8", "label": "chunked_data = preprocess_individual_pickle()", "type": "assigned_variable", "loc": [456, 456], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "vector": [14, 2, 0.5315, 0.0012, 2, 0.28, 0.0, 921, 3, 1, 0, 0, 220, 10, 1], "semantic": {"name": "chunked_data", "arg_names": [], "import_names": [], "rhs_call_name": "preprocess_individual_pickle", "annotation": ""}, "snippet": " chunked_data = self.preprocess_individual_pickle(apickle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L458_C8", "label": "models =", "type": "assigned_variable", "loc": [458, 458], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "vector": [14, 2, 0.5338, 0.0012, 2, 0.28, 0.1, 495, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " models = self.models['models']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L460_C8", "label": "total_ex =", "type": "assigned_variable", "loc": [460, 460], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "vector": [14, 2, 0.5361, 0.0012, 2, 0.28, 0.2, 88, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "total_ex", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " total_ex = models[0][0]['labels'].shape[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L461_C8", "label": "pos_ex = sum()", "type": "assigned_variable", "loc": [461, 461], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "vector": [14, 2, 0.5373, 0.0012, 2, 0.28, 0.3, 656, 3, 1, 0, 0, 824, 10, 1], "semantic": {"name": "pos_ex", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " pos_ex = np.sum(models[0][0]['labels'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L462_C8", "label": "neg_ex =", "type": "assigned_variable", "loc": [462, 462], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "vector": [14, 2, 0.5385, 0.0012, 2, 0.28, 0.4, 225, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "neg_ex", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " neg_ex = total_ex - pos_ex"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L463_C8", "label": "prior_pos =", "type": "assigned_variable", "loc": [463, 463], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "vector": [14, 2, 0.5396, 0.0012, 2, 0.28, 0.5, 478, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "prior_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prior_pos = pos_ex / float(total_ex)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L464_C8", "label": "prior_neg =", "type": "assigned_variable", "loc": [464, 464], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "vector": [14, 2, 0.5408, 0.0012, 2, 0.28, 0.6, 650, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "prior_neg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prior_neg = neg_ex / float(total_ex)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L466_C8", "label": "results =", "type": "assigned_variable", "loc": [466, 466], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "vector": [14, 2, 0.5431, 0.0012, 2, 0.28, 0.7, 143, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "results", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " results = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L467_C8", "label": "NEIGHBORS =", "type": "assigned_variable", "loc": [467, 467], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "vector": [14, 2, 0.5443, 0.0012, 2, 0.28, 0.8, 625, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NEIGHBORS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " NEIGHBORS = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L468_C8", "label": "for record_idx", "type": "for", "loc": [468, 495], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "vector": [6, 2, 0.5612, 0.0326, 2, 0.28, 0.9, 769, 3, 0, 0, 0, 0, 0, 20], "semantic": {"name": "record_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for record_idx in range(len(chunked_data[0][0]['data'])):\n for state in range(len(models)):\n if not results.has_key(state):\n results[state] = {}\n for chunk_idx in range(len(models[state])):\n if not results[state].has_key(chunk_idx):\n results[state][chunk_idx] = []\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L469_C12", "label": "for state", "type": "for", "loc": [469, 494], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L468_C8", "vector": [6, 3, 0.5612, 0.0303, 3, 0.83, 0.0, 688, 3, 0, 0, 0, 0, 0, 17], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for state in range(len(models)):\n if not results.has_key(state):\n results[state] = {}\n for chunk_idx in range(len(models[state])):\n if not results[state].has_key(chunk_idx):\n results[state][chunk_idx] = []\n\n x_mat = chunked_data[state][chunk_idx]['data'][record_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L470_C16", "label": "if", "type": "if", "loc": [470, 471], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L469_C12", "vector": [4, 4, 0.5484, 0.0023, 4, 0.68, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not results.has_key(state):\n results[state] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L471_C20", "label": "assign", "type": "assigned_variable", "loc": [471, 471], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L470_C16", "vector": [14, 5, 0.549, 0.0012, 5, 0.24, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " results[state] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "label": "for chunk_idx", "type": "for", "loc": [472, 494], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L469_C12", "vector": [6, 4, 0.5629, 0.0268, 4, 0.68, 1.0, 501, 3, 0, 0, 0, 0, 0, 14], "semantic": {"name": "chunk_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for chunk_idx in range(len(models[state])):\n if not results[state].has_key(chunk_idx):\n results[state][chunk_idx] = []\n\n x_mat = chunked_data[state][chunk_idx]['data'][record_idx]\n x_vec = np.reshape(x_mat, (x_mat.shape[0] * x_mat.shape[1], 1))\n projected_x = np.array((models[state][chunk_idx]['project'].T * x_vec).T)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L473_C20", "label": "if", "type": "if", "loc": [473, 474], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "vector": [4, 5, 0.5519, 0.0023, 5, 0.78, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not results[state].has_key(chunk_idx):\n results[state][chunk_idx] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L474_C24", "label": "assign", "type": "assigned_variable", "loc": [474, 474], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L473_C20", "vector": [14, 6, 0.5524, 0.0012, 6, 0.58, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " results[state][chunk_idx] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L476_C20", "label": "x_mat =", "type": "assigned_variable", "loc": [476, 476], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "vector": [14, 5, 0.5548, 0.0012, 5, 0.78, 0.0909, 590, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_mat = chunked_data[state][chunk_idx]['data'][record_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L477_C20", "label": "x_vec = reshape()", "type": "assigned_variable", "loc": [477, 477], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "vector": [14, 5, 0.5559, 0.0012, 5, 0.78, 0.1818, 703, 3, 2, 0, 0, 276, 10, 1], "semantic": {"name": "x_vec", "arg_names": [], "import_names": [], "rhs_call_name": "reshape", "annotation": ""}, "snippet": " x_vec = np.reshape(x_mat, (x_mat.shape[0] * x_mat.shape[1], 1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L478_C20", "label": "projected_x = array()", "type": "assigned_variable", "loc": [478, 478], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "vector": [14, 5, 0.5571, 0.0012, 5, 0.78, 0.2727, 172, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "projected_x", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " projected_x = np.array((models[state][chunk_idx]['project'].T * x_vec).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L484_C20", "label": "succ_prob = evaluate()", "type": "assigned_variable", "loc": [484, 484], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "vector": [14, 5, 0.5641, 0.0012, 5, 0.78, 0.3636, 835, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "succ_prob", "arg_names": [], "import_names": [], "rhs_call_name": "evaluate", "annotation": ""}, "snippet": " succ_prob = models[state][chunk_idx]['kde'][0].evaluate(np.array(projected_x))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L485_C20", "label": "fail_prob = evaluate()", "type": "assigned_variable", "loc": [485, 485], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "vector": [14, 5, 0.5653, 0.0012, 5, 0.78, 0.4545, 187, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "fail_prob", "arg_names": [], "import_names": [], "rhs_call_name": "evaluate", "annotation": ""}, "snippet": " fail_prob = models[state][chunk_idx]['kde'][1].evaluate(np.array(projected_x))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L486_C20", "label": "succ_total =", "type": "assigned_variable", "loc": [486, 486], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "vector": [14, 5, 0.5664, 0.0012, 5, 0.78, 0.5455, 936, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "succ_total", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " succ_total = np.sum(models[state][chunk_idx]['labels']) / float(models[state][chunk_idx]['labels'].shape[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L487_C20", "label": "fail_total =", "type": "assigned_variable", "loc": [487, 487], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "vector": [14, 5, 0.5676, 0.0012, 5, 0.78, 0.6364, 182, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fail_total", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fail_total = 1 - succ_total"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L489_C20", "label": "prob =", "type": "assigned_variable", "loc": [489, 489], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "vector": [14, 5, 0.5699, 0.0012, 5, 0.78, 0.7273, 24, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prob", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prob = (succ_prob * succ_total) / ((fail_prob*fail_total) + (succ_total*succ_prob))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L490_C20", "label": "if", "type": "if", "loc": [490, 491], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "vector": [4, 5, 0.5717, 0.0023, 5, 0.78, 0.8182, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.isnan(prob):\n prob = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L491_C24", "label": "prob =", "type": "assigned_variable", "loc": [491, 491], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L490_C20", "vector": [14, 6, 0.5723, 0.0012, 6, 0.5, 0.0, 24, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "prob", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prob = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L493_C20", "label": "append()", "type": "expression", "loc": [493, 493], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "vector": [8, 5, 0.5746, 0.0012, 5, 0.78, 0.9091, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " results[state][chunk_idx].append(prob > .5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L494_C20", "label": "print()", "type": "expression", "loc": [494, 494], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "vector": [8, 5, 0.5758, 0.0012, 5, 0.78, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('record idx %d state %d chunk %d label prob %.2f success? %d' % (record_idx, state, chunk_idx, prob, prob > .5))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L495_C12", "label": "print()", "type": "expression", "loc": [495, 495], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L468_C8", "vector": [8, 3, 0.5769, 0.0012, 3, 0.83, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('=============================')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L497_C8", "label": "for state", "type": "for", "loc": [497, 502], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "vector": [6, 2, 0.5822, 0.007, 2, 0.28, 1.0, 688, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for state in range(len(models)):\n for chunk_idx in range(len(models[state])):\n correct = np.sum(results[state][chunk_idx])\n all_val = float(len(results[state][chunk_idx]))\n print(all_val)\n print('state %d chunk %d results %.3f' % (state, chunk_idx, correct/all_val))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L498_C12", "label": "for chunk_idx", "type": "for", "loc": [498, 502], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L497_C8", "vector": [6, 3, 0.5828, 0.0058, 3, 0.45, 0.0, 501, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "chunk_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for chunk_idx in range(len(models[state])):\n correct = np.sum(results[state][chunk_idx])\n all_val = float(len(results[state][chunk_idx]))\n print(all_val)\n print('state %d chunk %d results %.3f' % (state, chunk_idx, correct/all_val))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L499_C16", "label": "correct = sum()", "type": "assigned_variable", "loc": [499, 499], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L498_C12", "vector": [14, 4, 0.5816, 0.0012, 4, 0.64, 0.0, 757, 3, 1, 0, 0, 824, 10, 1], "semantic": {"name": "correct", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " correct = np.sum(results[state][chunk_idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L500_C16", "label": "all_val = float()", "type": "assigned_variable", "loc": [500, 500], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L498_C12", "vector": [14, 4, 0.5828, 0.0012, 4, 0.64, 0.3333, 627, 3, 1, 0, 0, 639, 10, 2], "semantic": {"name": "all_val", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": " all_val = float(len(results[state][chunk_idx]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L501_C16", "label": "print()", "type": "expression", "loc": [501, 501], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L498_C12", "vector": [8, 4, 0.5839, 0.0012, 4, 0.64, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(all_val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L502_C16", "label": "print()", "type": "expression", "loc": [502, 502], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L498_C12", "vector": [8, 4, 0.5851, 0.0012, 4, 0.64, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('state %d chunk %d results %.3f' % (state, chunk_idx, correct/all_val))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L505_C0", "label": "zero_out_time_in_trials", "type": "function", "loc": [505, 515], "level": 0, "parent": null, "vector": [2, 0, 0.5944, 0.0128, 0, 0.66, 0.7273, 829, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "zero_out_time_in_trials", "arg_names": ["data_dict", "topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def zero_out_time_in_trials(data_dict, topic):\n #print 'Finding times...'\n #pdb.set_trace()\n times_dict = {} # times_dict[state][ list of durations ]\n for state in range(len(data_dict.keys())):\n times_dict[state] = []\n for record_number in range(len(data_dict[state][topic])):\n time_start = data_dict[0][topic][record_number]['t'][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L508_C4", "label": "times_dict =", "type": "assigned_variable", "loc": [508, 508], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L505_C0", "vector": [14, 1, 0.5921, 0.0012, 1, 0.64, 0.0, 448, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "times_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " times_dict = {} # times_dict[state][ list of durations ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L509_C4", "label": "for state", "type": "for", "loc": [509, 514], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L505_C0", "vector": [6, 1, 0.5962, 0.007, 1, 0.64, 0.5, 688, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for state in range(len(data_dict.keys())):\n times_dict[state] = []\n for record_number in range(len(data_dict[state][topic])):\n time_start = data_dict[0][topic][record_number]['t'][0]\n #pdb.set_trace()\n times_dict[state].append(data_dict[state][topic][record_number]['t'] - time_start)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L510_C8", "label": "assign", "type": "assigned_variable", "loc": [510, 510], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L509_C4", "vector": [14, 2, 0.5944, 0.0012, 2, 0.77, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " times_dict[state] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L511_C8", "label": "for record_number", "type": "for", "loc": [511, 514], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L509_C4", "vector": [6, 2, 0.5973, 0.0047, 2, 0.77, 1.0, 75, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "record_number", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for record_number in range(len(data_dict[state][topic])):\n time_start = data_dict[0][topic][record_number]['t'][0]\n #pdb.set_trace()\n times_dict[state].append(data_dict[state][topic][record_number]['t'] - time_start)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L512_C12", "label": "time_start =", "type": "assigned_variable", "loc": [512, 512], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L511_C8", "vector": [14, 3, 0.5967, 0.0012, 3, 0.55, 0.0, 833, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_start = data_dict[0][topic][record_number]['t'][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L514_C12", "label": "append()", "type": "expression", "loc": [514, 514], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L511_C8", "vector": [8, 3, 0.5991, 0.0012, 3, 0.55, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " times_dict[state].append(data_dict[state][topic][record_number]['t'] - time_start)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L515_C4", "label": "return", "type": "return", "loc": [515, 515], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L505_C0", "vector": [13, 1, 0.6002, 0.0012, 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 times_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L517_C0", "label": "find_trial_durations", "type": "function", "loc": [517, 525], "level": 0, "parent": null, "vector": [2, 0, 0.6072, 0.0105, 0, 0.66, 0.7576, 234, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "find_trial_durations", "arg_names": ["data_dict", "topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def find_trial_durations(data_dict, topic):\n times_dict = {} # times_dict[state][ list of durations ]\n for state in range(len(data_dict.keys())):\n times_dict[state] = []\n for record_number in range(len(data_dict[state][topic])):\n time_start = data_dict[state][topic][record_number]['t'][0]\n time_end = data_dict[state][topic][record_number]['t'][-1]\n times_dict[state].append(time_end - time_start)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L518_C4", "label": "times_dict =", "type": "assigned_variable", "loc": [518, 518], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L517_C0", "vector": [14, 1, 0.6037, 0.0012, 1, 0.86, 0.0, 448, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "times_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " times_dict = {} # times_dict[state][ list of durations ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L519_C4", "label": "for state", "type": "for", "loc": [519, 524], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L517_C0", "vector": [6, 1, 0.6078, 0.007, 1, 0.86, 0.5, 688, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for state in range(len(data_dict.keys())):\n times_dict[state] = []\n for record_number in range(len(data_dict[state][topic])):\n time_start = data_dict[state][topic][record_number]['t'][0]\n time_end = data_dict[state][topic][record_number]['t'][-1]\n times_dict[state].append(time_end - time_start)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L520_C8", "label": "assign", "type": "assigned_variable", "loc": [520, 520], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L519_C4", "vector": [14, 2, 0.6061, 0.0012, 2, 0.05, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " times_dict[state] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L521_C8", "label": "for record_number", "type": "for", "loc": [521, 524], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L519_C4", "vector": [6, 2, 0.609, 0.0047, 2, 0.05, 1.0, 75, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "record_number", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for record_number in range(len(data_dict[state][topic])):\n time_start = data_dict[state][topic][record_number]['t'][0]\n time_end = data_dict[state][topic][record_number]['t'][-1]\n times_dict[state].append(time_end - time_start)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L522_C12", "label": "time_start =", "type": "assigned_variable", "loc": [522, 522], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L521_C8", "vector": [14, 3, 0.6084, 0.0012, 3, 0.69, 0.0, 833, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_start = data_dict[state][topic][record_number]['t'][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L523_C12", "label": "time_end =", "type": "assigned_variable", "loc": [523, 523], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L521_C8", "vector": [14, 3, 0.6096, 0.0012, 3, 0.69, 0.5, 609, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_end", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_end = data_dict[state][topic][record_number]['t'][-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L524_C12", "label": "append()", "type": "expression", "loc": [524, 524], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L521_C8", "vector": [8, 3, 0.6107, 0.0012, 3, 0.69, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " times_dict[state].append(time_end - time_start)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L525_C4", "label": "return", "type": "return", "loc": [525, 525], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L517_C0", "vector": [13, 1, 0.6119, 0.0012, 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 times_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "label": "construct_pressure_marker_message", "type": "function", "loc": [527, 578], "level": 0, "parent": null, "vector": [2, 0, 0.6439, 0.0606, 0, 0.66, 0.7879, 707, 0, 3, 1, 0, 0, 0, 25], "semantic": {"name": "construct_pressure_marker_message", "arg_names": ["data_dict", "topic", "base_color"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def construct_pressure_marker_message(data_dict, topic, base_color=np.matrix([1.,0, 0, 1.]).T):\n #record_number = 0\n STATE_SEPARATION_DIST = .4\n points_ll = []\n colors_ll = []\n pressures_l = []\n \n #Record the duration of each trial"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L529_C4", "label": "STATE_SEPARATION_DIST =", "type": "assigned_variable", "loc": [529, 529], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "vector": [14, 1, 0.6166, 0.0012, 1, 0.92, 0.0, 951, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "STATE_SEPARATION_DIST", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " STATE_SEPARATION_DIST = .4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L530_C4", "label": "points_ll =", "type": "assigned_variable", "loc": [530, 530], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "vector": [14, 1, 0.6177, 0.0012, 1, 0.92, 0.0588, 47, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "points_ll", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " points_ll = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L531_C4", "label": "colors_ll =", "type": "assigned_variable", "loc": [531, 531], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "vector": [14, 1, 0.6189, 0.0012, 1, 0.92, 0.1176, 746, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "colors_ll", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " colors_ll = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L532_C4", "label": "pressures_l =", "type": "assigned_variable", "loc": [532, 532], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "vector": [14, 1, 0.62, 0.0012, 1, 0.92, 0.1765, 121, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pressures_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pressures_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L535_C4", "label": "times_dict = zero_out_time_in_trials()", "type": "assigned_variable", "loc": [535, 535], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "vector": [14, 1, 0.6235, 0.0012, 1, 0.92, 0.2353, 448, 3, 2, 0, 0, 829, 10, 1], "semantic": {"name": "times_dict", "arg_names": [], "import_names": [], "rhs_call_name": "zero_out_time_in_trials", "annotation": ""}, "snippet": " times_dict = zero_out_time_in_trials(data_dict, topic)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L537_C4", "label": "state_time_offsets =", "type": "assigned_variable", "loc": [537, 537], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "vector": [14, 1, 0.6259, 0.0012, 1, 0.92, 0.2941, 241, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "state_time_offsets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " state_time_offsets = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L538_C4", "label": "assign", "type": "assigned_variable", "loc": [538, 538], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "vector": [14, 1, 0.627, 0.0012, 1, 0.92, 0.3529, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " state_time_offsets[-1] = {'duration':0, 'offset':0}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L539_C4", "label": "for state", "type": "for", "loc": [539, 544], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "vector": [6, 1, 0.6311, 0.007, 1, 0.92, 0.4118, 688, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for state in range(len(times_dict.keys())):\n durations = [state_times[-1] - state_times[0] for state_times in times_dict[state]]\n duration_state = np.max(durations)\n state_time_offsets[state] = {'duration': duration_state,\n 'offset': state_time_offsets[state-1]['offset'] + state_time_offsets[state-1]['duration'] + STATE_SEPARATION_DIST}\n print('state', state, 'offset', state_time_offsets[state]['offset'], 'duration', state_time_offsets[state]['duration'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L540_C8", "label": "durations =", "type": "assigned_variable", "loc": [540, 540], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L539_C4", "vector": [14, 2, 0.6294, 0.0012, 2, 0.27, 0.0, 807, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "durations", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " durations = [state_times[-1] - state_times[0] for state_times in times_dict[state]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L541_C8", "label": "duration_state = max()", "type": "assigned_variable", "loc": [541, 541], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L539_C4", "vector": [14, 2, 0.6305, 0.0012, 2, 0.27, 0.3333, 174, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "duration_state", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " duration_state = np.max(durations)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L542_C8", "label": "assign", "type": "assigned_variable", "loc": [542, 543], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L539_C4", "vector": [14, 2, 0.6323, 0.0023, 2, 0.27, 0.6667, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " state_time_offsets[state] = {'duration': duration_state,\n 'offset': state_time_offsets[state-1]['offset'] + state_time_offsets[state-1]['duration'] + STATE_SEPARATION_DIST}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L544_C8", "label": "print()", "type": "expression", "loc": [544, 544], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L539_C4", "vector": [8, 2, 0.634, 0.0012, 2, 0.27, 1.0, 535, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('state', state, 'offset', state_time_offsets[state]['offset'], 'duration', state_time_offsets[state]['duration'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L547_C4", "label": "times_m_list =", "type": "assigned_variable", "loc": [547, 547], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "vector": [14, 1, 0.6375, 0.0012, 1, 0.92, 0.4706, 881, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "times_m_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " times_m_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L548_C4", "label": "for record_number", "type": "for", "loc": [548, 560], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "vector": [6, 1, 0.6457, 0.0152, 1, 0.92, 0.5294, 75, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "record_number", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for record_number in range(len(data_dict[0][topic])):\n\n #For each state figure out the time offset & store in times_l\n times_l = []\n for i in range(len(data_dict.keys())):\n #times_l.append(np.matrix(state_time_offsets[i]['offset'] + data_dict[i][topic][record_number]['t'] - data_dict[0][topic][record_number]['t'][0]))\n curr_times = data_dict[i][topic][record_number]['t']\n curr_times = curr_times - curr_times[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L551_C8", "label": "times_l =", "type": "assigned_variable", "loc": [551, 551], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L548_C4", "vector": [14, 2, 0.6422, 0.0012, 2, 0.22, 0.0, 737, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "times_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " times_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L552_C8", "label": "for i", "type": "for", "loc": [552, 556], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L548_C4", "vector": [6, 2, 0.6457, 0.0058, 2, 0.22, 0.3333, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(data_dict.keys())):\n #times_l.append(np.matrix(state_time_offsets[i]['offset'] + data_dict[i][topic][record_number]['t'] - data_dict[0][topic][record_number]['t'][0]))\n curr_times = data_dict[i][topic][record_number]['t']\n curr_times = curr_times - curr_times[0]\n times_l.append(np.matrix(curr_times + state_time_offsets[i]['offset']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L554_C12", "label": "curr_times =", "type": "assigned_variable", "loc": [554, 554], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L552_C8", "vector": [14, 3, 0.6457, 0.0012, 3, 0.71, 0.0, 516, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "curr_times", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " curr_times = data_dict[i][topic][record_number]['t']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L555_C12", "label": "curr_times =", "type": "assigned_variable", "loc": [555, 555], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L552_C8", "vector": [14, 3, 0.6469, 0.0012, 3, 0.71, 0.5, 516, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "curr_times", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " curr_times = curr_times - curr_times[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L556_C12", "label": "append()", "type": "expression", "loc": [556, 556], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L552_C8", "vector": [8, 3, 0.648, 0.0012, 3, 0.71, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " times_l.append(np.matrix(curr_times + state_time_offsets[i]['offset']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L559_C8", "label": "times_m = column_stack()", "type": "assigned_variable", "loc": [559, 559], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L548_C4", "vector": [14, 2, 0.6515, 0.0012, 2, 0.22, 0.6667, 738, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "times_m", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " times_m = np.column_stack(times_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L560_C8", "label": "append()", "type": "expression", "loc": [560, 560], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L548_C4", "vector": [8, 2, 0.6527, 0.0012, 2, 0.22, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " times_m_list.append(times_m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L564_C4", "label": "print()", "type": "expression", "loc": [564, 564], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "vector": [8, 1, 0.6573, 0.0012, 1, 0.92, 0.5882, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('constructing segmented matrices...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L565_C4", "label": "pressure_mats =", "type": "assigned_variable", "loc": [565, 565], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "vector": [14, 1, 0.6585, 0.0012, 1, 0.92, 0.6471, 261, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pressure_mats", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pressure_mats = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L566_C4", "label": "for lp", "type": "for", "loc": [566, 570], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "vector": [6, 1, 0.662, 0.0058, 1, 0.92, 0.7059, 721, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "lp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for lp in construct_list_of_segmented_matrices_from_trial_recording(data_dict, topic):\n p = np.column_stack(lp) \n p = p - p[:,0]\n\n pressure_mats.append(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L567_C8", "label": "p = column_stack()", "type": "assigned_variable", "loc": [567, 567], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L566_C4", "vector": [14, 2, 0.6608, 0.0012, 2, 0.56, 0.0, 491, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " p = np.column_stack(lp) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L568_C8", "label": "p =", "type": "assigned_variable", "loc": [568, 568], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L566_C4", "vector": [14, 2, 0.662, 0.0012, 2, 0.56, 0.5, 491, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = p - p[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L570_C8", "label": "append()", "type": "expression", "loc": [570, 570], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L566_C4", "vector": [8, 2, 0.6643, 0.0012, 2, 0.56, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " pressure_mats.append(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L572_C4", "label": "print()", "type": "expression", "loc": [572, 572], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "vector": [8, 1, 0.6667, 0.0012, 1, 0.92, 0.7647, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('creating colored points...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L573_C4", "label": "pressures, all_points, colors_mat = create_colored_3d_points_from_matrices()", "type": "assigned_variable", "loc": [573, 573], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "vector": [14, 1, 0.6678, 0.0012, 1, 0.92, 0.8235, 277, 3, 2, 0, 0, 604, 10, 1], "semantic": {"name": "pressures, all_points, colors_mat", "arg_names": [], "import_names": [], "rhs_call_name": "create_colored_3d_points_from_matrices", "annotation": ""}, "snippet": " pressures, all_points, colors_mat = create_colored_3d_points_from_matrices(pressure_mats, times_m_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L575_C4", "label": "print()", "type": "expression", "loc": [575, 575], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "vector": [8, 1, 0.6702, 0.0012, 1, 0.92, 0.8824, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('creating pointcloud message')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L577_C4", "label": "point_cloud = np_to_colored_pointcloud()", "type": "assigned_variable", "loc": [577, 577], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "vector": [14, 1, 0.6725, 0.0012, 1, 0.92, 0.9412, 194, 3, 3, 0, 0, 816, 10, 2], "semantic": {"name": "point_cloud", "arg_names": [], "import_names": [], "rhs_call_name": "np_to_colored_pointcloud", "annotation": ""}, "snippet": " point_cloud = ru.np_to_colored_pointcloud(all_points, np.matrix(pressures), 'pressure_viz')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L578_C4", "label": "return", "type": "return", "loc": [578, 578], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "vector": [13, 1, 0.6737, 0.0012, 1, 0.92, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return point_cloud"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L580_C0", "label": "DisplayDataWithRviz", "type": "class", "loc": [580, 614], "level": 0, "parent": null, "vector": [3, 0, 0.6958, 0.0408, 0, 0.66, 0.8182, 765, 0, 2, 0, 0, 0, 0, 27], "semantic": {"name": "DisplayDataWithRviz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DisplayDataWithRviz:\n\n def __init__(self):\n rospy.init_node('display_pressure_with_rviz')\n self.succ_marker = rospy.Publisher('succ_marker', vm.Marker)\n self.fail_marker = rospy.Publisher('fail_marker', vm.Marker)\n\n self.succ_pc_pub = rospy.Publisher('succ_pc', sm.PointCloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L582_C4", "label": "__init__", "type": "function", "loc": [582, 588], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L580_C0", "vector": [2, 1, 0.6818, 0.0082, 1, 0.05, 0.0, 555, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n rospy.init_node('display_pressure_with_rviz')\n self.succ_marker = rospy.Publisher('succ_marker', vm.Marker)\n self.fail_marker = rospy.Publisher('fail_marker', vm.Marker)\n\n self.succ_pc_pub = rospy.Publisher('succ_pc', sm.PointCloud)\n self.fail_pc_pub = rospy.Publisher('fail_pc', sm.PointCloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L583_C8", "label": "init_node()", "type": "expression", "loc": [583, 583], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L582_C4", "vector": [8, 2, 0.6795, 0.0012, 2, 0.54, 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('display_pressure_with_rviz')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L584_C8", "label": "self.succ_marker = Publisher()", "type": "assigned_variable", "loc": [584, 584], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L582_C4", "vector": [14, 2, 0.6807, 0.0012, 2, 0.54, 0.25, 43, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.succ_marker", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.succ_marker = rospy.Publisher('succ_marker', vm.Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L585_C8", "label": "self.fail_marker = Publisher()", "type": "assigned_variable", "loc": [585, 585], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L582_C4", "vector": [14, 2, 0.6818, 0.0012, 2, 0.54, 0.5, 668, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.fail_marker", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.fail_marker = rospy.Publisher('fail_marker', vm.Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L587_C8", "label": "self.succ_pc_pub = Publisher()", "type": "assigned_variable", "loc": [587, 587], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L582_C4", "vector": [14, 2, 0.6841, 0.0012, 2, 0.54, 0.75, 536, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.succ_pc_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.succ_pc_pub = rospy.Publisher('succ_pc', sm.PointCloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L588_C8", "label": "self.fail_pc_pub = Publisher()", "type": "assigned_variable", "loc": [588, 588], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L582_C4", "vector": [14, 2, 0.6853, 0.0012, 2, 0.54, 1.0, 924, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.fail_pc_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.fail_pc_pub = rospy.Publisher('fail_pc', sm.PointCloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "label": "display", "type": "function", "loc": [590, 614], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L580_C0", "vector": [2, 1, 0.7016, 0.0291, 1, 0.05, 1.0, 669, 0, 3, 0, 0, 0, 0, 22], "semantic": {"name": "display", "arg_names": ["self", "succ_pickle", "fail_pickle"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def display(self, succ_pickle, fail_pickle):\n # load in pickle\n print('loading...')\n successes = ut.load_pickle(succ_pickle)\n failures = ut.load_pickle(fail_pickle)\n\n print('Enter the topic number:')\n for i, k in enumerate(successes[0].keys()):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L592_C8", "label": "print()", "type": "expression", "loc": [592, 592], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "vector": [8, 2, 0.69, 0.0012, 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('loading...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L593_C8", "label": "successes = load_pickle()", "type": "assigned_variable", "loc": [593, 593], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "vector": [14, 2, 0.6911, 0.0012, 2, 0.18, 0.0714, 797, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "successes", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " successes = ut.load_pickle(succ_pickle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L594_C8", "label": "failures = load_pickle()", "type": "assigned_variable", "loc": [594, 594], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "vector": [14, 2, 0.6923, 0.0012, 2, 0.18, 0.1429, 276, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "failures", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " failures = ut.load_pickle(fail_pickle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L596_C8", "label": "print()", "type": "expression", "loc": [596, 596], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "vector": [8, 2, 0.6946, 0.0012, 2, 0.18, 0.2143, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Enter the topic number:')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L597_C8", "label": "for i, k", "type": "for", "loc": [597, 598], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "vector": [6, 2, 0.6964, 0.0023, 2, 0.18, 0.2857, 992, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i, k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, k in enumerate(successes[0].keys()):\n print(i, k)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L598_C12", "label": "print()", "type": "expression", "loc": [598, 598], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L597_C8", "vector": [8, 3, 0.697, 0.0012, 3, 0.9, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(i, k)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L599_C8", "label": "topic =", "type": "assigned_variable", "loc": [599, 599], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "vector": [14, 2, 0.6981, 0.0012, 2, 0.18, 0.3571, 225, 6, 0, 0, 0, 0, 0, 3], "semantic": {"name": "topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " topic = successes[0].keys()[int(raw_input())]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L601_C8", "label": "red =", "type": "assigned_variable", "loc": [601, 601], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "vector": [14, 2, 0.7005, 0.0012, 2, 0.18, 0.4286, 903, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "red", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " red = np.matrix([1.,0, 0, 1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L602_C8", "label": "green =", "type": "assigned_variable", "loc": [602, 602], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "vector": [14, 2, 0.7016, 0.0012, 2, 0.18, 0.5, 128, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "green", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " green = np.matrix([0.,1., 0, 1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L603_C8", "label": "print()", "type": "expression", "loc": [603, 603], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "vector": [8, 2, 0.7028, 0.0012, 2, 0.18, 0.5714, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('construct_pressure_marker_message(successes, topic, green)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L605_C8", "label": "succ_pc = construct_pressure_marker_message()", "type": "assigned_variable", "loc": [605, 605], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "vector": [14, 2, 0.7051, 0.0012, 2, 0.18, 0.6429, 79, 3, 3, 0, 0, 707, 10, 1], "semantic": {"name": "succ_pc", "arg_names": [], "import_names": [], "rhs_call_name": "construct_pressure_marker_message", "annotation": ""}, "snippet": " succ_pc = construct_pressure_marker_message(successes, topic, green)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L606_C8", "label": "print()", "type": "expression", "loc": [606, 606], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "vector": [8, 2, 0.7063, 0.0012, 2, 0.18, 0.7143, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('construct_pressure_marker_message(failures, topic, red)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L608_C8", "label": "fail_pc = construct_pressure_marker_message()", "type": "assigned_variable", "loc": [608, 608], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "vector": [14, 2, 0.7086, 0.0012, 2, 0.18, 0.7857, 81, 3, 3, 0, 0, 707, 10, 1], "semantic": {"name": "fail_pc", "arg_names": [], "import_names": [], "rhs_call_name": "construct_pressure_marker_message", "annotation": ""}, "snippet": " fail_pc = construct_pressure_marker_message(failures, topic, red)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L609_C8", "label": "print()", "type": "expression", "loc": [609, 609], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "vector": [8, 2, 0.7098, 0.0012, 2, 0.18, 0.8571, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('publishing...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L610_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [610, 610], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "vector": [14, 2, 0.711, 0.0012, 2, 0.18, 0.9286, 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_99663:While_L611_C8", "label": "while", "type": "while", "loc": [611, 614], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "vector": [5, 2, 0.7139, 0.0047, 2, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n self.succ_pc_pub.publish(succ_pc)\n self.fail_pc_pub.publish(fail_pc)\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L612_C12", "label": "publish()", "type": "expression", "loc": [612, 612], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L611_C8", "vector": [8, 3, 0.7133, 0.0012, 3, 0.66, 0.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.succ_pc_pub.publish(succ_pc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L613_C12", "label": "publish()", "type": "expression", "loc": [613, 613], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L611_C8", "vector": [8, 3, 0.7145, 0.0012, 3, 0.66, 0.5, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.fail_pc_pub.publish(fail_pc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L614_C12", "label": "sleep()", "type": "expression", "loc": [614, 614], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L611_C8", "vector": [8, 3, 0.7156, 0.0012, 3, 0.66, 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_99663:FunctionDef_L623_C0", "label": "construct_list_of_segmented_matrices_from_trial_recording", "type": "function", "loc": [623, 635], "level": 0, "parent": null, "vector": [2, 0, 0.7331, 0.0152, 0, 0.66, 0.8485, 603, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "construct_list_of_segmented_matrices_from_trial_recording", "arg_names": ["data_dict", "topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def construct_list_of_segmented_matrices_from_trial_recording(data_dict, topic):\n segmented_matrices = []\n for record_number in range(len(data_dict[0][topic])):\n segmented_matrix = []\n trecs = []\n for state in range(len(data_dict.keys())):\n segmented_matrix.append(np.row_stack((data_dict[state][topic][record_number]['left'], \n data_dict[state][topic][record_number]['right'])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L624_C4", "label": "segmented_matrices =", "type": "assigned_variable", "loc": [624, 624], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L623_C0", "vector": [14, 1, 0.7273, 0.0012, 1, 0.18, 0.0, 229, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "segmented_matrices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " segmented_matrices = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L625_C4", "label": "for record_number", "type": "for", "loc": [625, 633], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L623_C0", "vector": [6, 1, 0.7331, 0.0105, 1, 0.18, 0.5, 75, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "record_number", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for record_number in range(len(data_dict[0][topic])):\n segmented_matrix = []\n trecs = []\n for state in range(len(data_dict.keys())):\n segmented_matrix.append(np.row_stack((data_dict[state][topic][record_number]['left'], \n data_dict[state][topic][record_number]['right'])))\n trecs.append(data_dict[state][topic][record_number]['t'])\n segmented_matrices.append({'mat': segmented_matrix,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L626_C8", "label": "segmented_matrix =", "type": "assigned_variable", "loc": [626, 626], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L625_C4", "vector": [14, 2, 0.7296, 0.0012, 2, 0.47, 0.0, 37, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "segmented_matrix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " segmented_matrix = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L627_C8", "label": "trecs =", "type": "assigned_variable", "loc": [627, 627], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L625_C4", "vector": [14, 2, 0.7308, 0.0012, 2, 0.47, 0.3333, 715, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "trecs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trecs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L628_C8", "label": "for state", "type": "for", "loc": [628, 631], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L625_C4", "vector": [6, 2, 0.7337, 0.0047, 2, 0.47, 0.6667, 688, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for state in range(len(data_dict.keys())):\n segmented_matrix.append(np.row_stack((data_dict[state][topic][record_number]['left'], \n data_dict[state][topic][record_number]['right'])))\n trecs.append(data_dict[state][topic][record_number]['t'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L629_C12", "label": "append()", "type": "expression", "loc": [629, 630], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L628_C8", "vector": [8, 3, 0.7337, 0.0023, 3, 0.88, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " segmented_matrix.append(np.row_stack((data_dict[state][topic][record_number]['left'], \n data_dict[state][topic][record_number]['right'])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L631_C12", "label": "append()", "type": "expression", "loc": [631, 631], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L628_C8", "vector": [8, 3, 0.7354, 0.0012, 3, 0.88, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " trecs.append(data_dict[state][topic][record_number]['t'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L632_C8", "label": "append()", "type": "expression", "loc": [632, 633], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L625_C4", "vector": [8, 2, 0.7372, 0.0023, 2, 0.47, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " segmented_matrices.append({'mat': segmented_matrix,\n 't': trecs})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L635_C4", "label": "return", "type": "return", "loc": [635, 635], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L623_C0", "vector": [13, 1, 0.7401, 0.0012, 1, 0.18, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return segmented_matrices"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L638_C0", "label": "create_colored_3d_points_from_matrices", "type": "function", "loc": [638, 663], "level": 0, "parent": null, "vector": [2, 0, 0.7582, 0.0303, 0, 0.66, 0.8788, 604, 0, 2, 1, 0, 0, 0, 22], "semantic": {"name": "create_colored_3d_points_from_matrices", "arg_names": ["matrices", "index_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_colored_3d_points_from_matrices(matrices, index_list):\n points3d_l = []\n colors_ll = []\n mat_l = []\n X_MULTIPLIER = 1/15.\n\n for i, mat in enumerate(matrices):\n X, Y = np.meshgrid(range(mat.shape[0]), range(mat.shape[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L639_C4", "label": "points3d_l =", "type": "assigned_variable", "loc": [639, 639], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L638_C0", "vector": [14, 1, 0.7448, 0.0012, 1, 0.82, 0.0, 220, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "points3d_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " points3d_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L640_C4", "label": "colors_ll =", "type": "assigned_variable", "loc": [640, 640], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L638_C0", "vector": [14, 1, 0.7459, 0.0012, 1, 0.82, 0.125, 746, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "colors_ll", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " colors_ll = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L641_C4", "label": "mat_l =", "type": "assigned_variable", "loc": [641, 641], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L638_C0", "vector": [14, 1, 0.7471, 0.0012, 1, 0.82, 0.25, 328, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "mat_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mat_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L642_C4", "label": "X_MULTIPLIER =", "type": "assigned_variable", "loc": [642, 642], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L638_C0", "vector": [14, 1, 0.7483, 0.0012, 1, 0.82, 0.375, 804, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "X_MULTIPLIER", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " X_MULTIPLIER = 1/15."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4", "label": "for i, mat", "type": "for", "loc": [644, 658], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L638_C0", "vector": [6, 1, 0.7587, 0.0175, 1, 0.82, 0.5, 126, 3, 0, 0, 0, 0, 0, 19], "semantic": {"name": "i, mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, mat in enumerate(matrices):\n X, Y = np.meshgrid(range(mat.shape[0]), range(mat.shape[1]))\n x_size = mat.shape[0] * X_MULTIPLIER\n X = np.matrix(X * X_MULTIPLIER) + x_size * i + (i * x_size / 3.)\n #Y = (np.matrix(np.ones((mat.shape[0], 1))) * times_m).T\n Y = (np.matrix(np.ones((mat.shape[0], 1))) * index_list[i]).T\n Z = np.matrix(np.zeros(mat.shape)).T\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L645_C8", "label": "X, Y = meshgrid()", "type": "assigned_variable", "loc": [645, 645], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4", "vector": [14, 2, 0.7517, 0.0012, 2, 0.71, 0.0, 835, 3, 2, 0, 0, 500, 10, 3], "semantic": {"name": "X, Y", "arg_names": [], "import_names": [], "rhs_call_name": "meshgrid", "annotation": ""}, "snippet": " X, Y = np.meshgrid(range(mat.shape[0]), range(mat.shape[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L646_C8", "label": "x_size =", "type": "assigned_variable", "loc": [646, 646], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4", "vector": [14, 2, 0.7529, 0.0012, 2, 0.71, 0.1111, 702, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_size = mat.shape[0] * X_MULTIPLIER"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L647_C8", "label": "X =", "type": "assigned_variable", "loc": [647, 647], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4", "vector": [14, 2, 0.7541, 0.0012, 2, 0.71, 0.2222, 783, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "X", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " X = np.matrix(X * X_MULTIPLIER) + x_size * i + (i * x_size / 3.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L649_C8", "label": "Y =", "type": "assigned_variable", "loc": [649, 649], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4", "vector": [14, 2, 0.7564, 0.0012, 2, 0.71, 0.3333, 24, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "Y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " Y = (np.matrix(np.ones((mat.shape[0], 1))) * index_list[i]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L650_C8", "label": "Z =", "type": "assigned_variable", "loc": [650, 650], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4", "vector": [14, 2, 0.7576, 0.0012, 2, 0.71, 0.4444, 664, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "Z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " Z = np.matrix(np.zeros(mat.shape)).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L652_C8", "label": "points = row_stack()", "type": "assigned_variable", "loc": [652, 654], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4", "vector": [14, 2, 0.7611, 0.0035, 2, 0.71, 0.5556, 738, 3, 1, 0, 0, 612, 10, 4], "semantic": {"name": "points", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " points = np.row_stack((X.reshape(1, X.shape[0] * X.shape[1]),\n Y.reshape(1, Y.shape[0] * Y.shape[1]),\n Z.reshape(1, Z.shape[0] * Z.shape[1])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L655_C8", "label": "colors = matrix()", "type": "assigned_variable", "loc": [655, 655], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4", "vector": [14, 2, 0.7634, 0.0012, 2, 0.71, 0.6667, 656, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "colors", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " colors = np.matrix(np.zeros((4, mat.shape[0]*mat.shape[1])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L656_C8", "label": "append()", "type": "expression", "loc": [656, 656], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4", "vector": [8, 2, 0.7646, 0.0012, 2, 0.71, 0.7778, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " mat_l.append(mat.T.reshape((1,mat.shape[1] * mat.shape[0])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L657_C8", "label": "append()", "type": "expression", "loc": [657, 657], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4", "vector": [8, 2, 0.7657, 0.0012, 2, 0.71, 0.8889, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " points3d_l.append(points)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L658_C8", "label": "append()", "type": "expression", "loc": [658, 658], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4", "vector": [8, 2, 0.7669, 0.0012, 2, 0.71, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " colors_ll.append(colors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L660_C4", "label": "all_mats = column_stack()", "type": "assigned_variable", "loc": [660, 660], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L638_C0", "vector": [14, 1, 0.7692, 0.0012, 1, 0.82, 0.625, 190, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "all_mats", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " all_mats = np.column_stack(mat_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L661_C4", "label": "all_points = column_stack()", "type": "assigned_variable", "loc": [661, 661], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L638_C0", "vector": [14, 1, 0.7704, 0.0012, 1, 0.82, 0.75, 979, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "all_points", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " all_points = np.column_stack(points3d_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L662_C4", "label": "all_colors = column_stack()", "type": "assigned_variable", "loc": [662, 662], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L638_C0", "vector": [14, 1, 0.7716, 0.0012, 1, 0.82, 0.875, 904, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "all_colors", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " all_colors = np.column_stack(colors_ll)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L663_C4", "label": "return", "type": "return", "loc": [663, 663], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L638_C0", "vector": [13, 1, 0.7727, 0.0012, 1, 0.82, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return all_mats, all_points, all_colors"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L666_C0", "label": "average_reading_over_trials", "type": "function", "loc": [666, 685], "level": 0, "parent": null, "vector": [2, 0, 0.7873, 0.0233, 0, 0.66, 0.9091, 36, 0, 2, 1, 0, 0, 0, 11], "semantic": {"name": "average_reading_over_trials", "arg_names": ["data_dict", "topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def average_reading_over_trials(data_dict, topic):\n #Construct list of list of matrices indexing [state][trial number] => contact information for both fingers\n contact_info = {}\n for state in data_dict.keys():\n contact_info[state] = []\n for trial in data_dict[state][topic]:\n contact_info[state].append(np.row_stack((trial['left'], trial['right'])))\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L668_C4", "label": "contact_info =", "type": "assigned_variable", "loc": [668, 668], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L666_C0", "vector": [14, 1, 0.7786, 0.0012, 1, 0.68, 0.0, 206, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "contact_info", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " contact_info = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L669_C4", "label": "for state", "type": "for", "loc": [669, 672], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L666_C0", "vector": [6, 1, 0.7815, 0.0047, 1, 0.68, 0.25, 688, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for state in data_dict.keys():\n contact_info[state] = []\n for trial in data_dict[state][topic]:\n contact_info[state].append(np.row_stack((trial['left'], trial['right'])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L670_C8", "label": "assign", "type": "assigned_variable", "loc": [670, 670], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L669_C4", "vector": [14, 2, 0.7809, 0.0012, 2, 0.83, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " contact_info[state] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L671_C8", "label": "for trial", "type": "for", "loc": [671, 672], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L669_C4", "vector": [6, 2, 0.7826, 0.0023, 2, 0.83, 1.0, 437, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "trial", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for trial in data_dict[state][topic]:\n contact_info[state].append(np.row_stack((trial['left'], trial['right'])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L672_C12", "label": "append()", "type": "expression", "loc": [672, 672], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L671_C8", "vector": [8, 3, 0.7832, 0.0012, 3, 0.92, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " contact_info[state].append(np.row_stack((trial['left'], trial['right'])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L674_C4", "label": "ret_dict =", "type": "assigned_variable", "loc": [674, 674], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L666_C0", "vector": [14, 1, 0.7855, 0.0012, 1, 0.68, 0.5, 240, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "ret_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L676_C4", "label": "for state", "type": "for", "loc": [676, 684], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L666_C0", "vector": [6, 1, 0.7925, 0.0105, 1, 0.68, 0.75, 688, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for state in contact_info.keys():\n shortest_length = np.min([trial.shape[1] for trial in contact_info[state]])\n trimmed_mats = [trial[:,:shortest_length] for trial in contact_info[state]]\n avg_reading = np.matrix(np.sum(np.concatenate([np.reshape(np.array(trial), (trial.shape[0], trial.shape[1], 1)) for trial in trimmed_mats], 2), 2) / len(trimmed_mats))\n div_point = avg_reading.shape[0]/2.\n assert(div_point == 22)\n ret_dict[state] = {topic: [{'t': data_dict[state][topic][0]['t'][:shortest_length] ,#contact_info[state][0][:shortest_length],\n 'left': avg_reading[:div_point,:],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L677_C8", "label": "shortest_length = min()", "type": "assigned_variable", "loc": [677, 677], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L676_C4", "vector": [14, 2, 0.789, 0.0012, 2, 0.63, 0.0, 622, 3, 1, 0, 0, 867, 10, 1], "semantic": {"name": "shortest_length", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " shortest_length = np.min([trial.shape[1] for trial in contact_info[state]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L678_C8", "label": "trimmed_mats =", "type": "assigned_variable", "loc": [678, 678], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L676_C4", "vector": [14, 2, 0.7902, 0.0012, 2, 0.63, 0.25, 240, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "trimmed_mats", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trimmed_mats = [trial[:,:shortest_length] for trial in contact_info[state]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L679_C8", "label": "avg_reading = matrix()", "type": "assigned_variable", "loc": [679, 679], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L676_C4", "vector": [14, 2, 0.7914, 0.0012, 2, 0.63, 0.5, 845, 3, 1, 0, 0, 162, 10, 6], "semantic": {"name": "avg_reading", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " avg_reading = np.matrix(np.sum(np.concatenate([np.reshape(np.array(trial), (trial.shape[0], trial.shape[1], 1)) for trial in trimmed_mats], 2), 2) / len(trimmed_mats))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L680_C8", "label": "div_point =", "type": "assigned_variable", "loc": [680, 680], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L676_C4", "vector": [14, 2, 0.7925, 0.0012, 2, 0.63, 0.75, 733, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "div_point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " div_point = avg_reading.shape[0]/2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L682_C8", "label": "assign", "type": "assigned_variable", "loc": [682, 684], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L676_C4", "vector": [14, 2, 0.796, 0.0035, 2, 0.63, 1.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret_dict[state] = {topic: [{'t': data_dict[state][topic][0]['t'][:shortest_length] ,#contact_info[state][0][:shortest_length],\n 'left': avg_reading[:div_point,:],\n 'right': avg_reading[div_point:,:]}] }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L685_C4", "label": "return", "type": "return", "loc": [685, 685], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L666_C0", "vector": [13, 1, 0.7984, 0.0012, 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 ret_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L688_C0", "label": "subtract_records", "type": "function", "loc": [688, 697], "level": 0, "parent": null, "vector": [2, 0, 0.8071, 0.0117, 0, 0.66, 0.9394, 677, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "subtract_records", "arg_names": ["recorda", "recordb", "topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def subtract_records(recorda, recordb, topic):\n ret_dict = {}\n for state in recorda.keys():\n shortest_length = min(recorda[state][topic][0]['left'].shape[1], recordb[state][topic][0]['left'].shape[1])\n ret_dict[state] = {topic: [{\n 't': recorda[state][topic][0]['t'][:shortest_length],\n 'left': np.abs(recorda[state][topic][0]['left'][:,:shortest_length] - recordb[state][topic][0]['left'][:,:shortest_length]),\n 'right': np.abs(recorda[state][topic][0]['right'][:,:shortest_length] - recordb[state][topic][0]['right'][:,:shortest_length])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L689_C4", "label": "ret_dict =", "type": "assigned_variable", "loc": [689, 689], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L688_C0", "vector": [14, 1, 0.803, 0.0012, 1, 0.02, 0.0, 240, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "ret_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L690_C4", "label": "for state", "type": "for", "loc": [690, 696], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L688_C0", "vector": [6, 1, 0.8077, 0.0082, 1, 0.02, 0.5, 688, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for state in recorda.keys():\n shortest_length = min(recorda[state][topic][0]['left'].shape[1], recordb[state][topic][0]['left'].shape[1])\n ret_dict[state] = {topic: [{\n 't': recorda[state][topic][0]['t'][:shortest_length],\n 'left': np.abs(recorda[state][topic][0]['left'][:,:shortest_length] - recordb[state][topic][0]['left'][:,:shortest_length]),\n 'right': np.abs(recorda[state][topic][0]['right'][:,:shortest_length] - recordb[state][topic][0]['right'][:,:shortest_length])\n }]}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L691_C8", "label": "shortest_length = min()", "type": "assigned_variable", "loc": [691, 691], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L690_C4", "vector": [14, 2, 0.8054, 0.0012, 2, 0.22, 0.0, 622, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "shortest_length", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " shortest_length = min(recorda[state][topic][0]['left'].shape[1], recordb[state][topic][0]['left'].shape[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L692_C8", "label": "assign", "type": "assigned_variable", "loc": [692, 696], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L690_C4", "vector": [14, 2, 0.8089, 0.0058, 2, 0.22, 1.0, 0, 0, 0, 0, 0, 0, 6, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret_dict[state] = {topic: [{\n 't': recorda[state][topic][0]['t'][:shortest_length],\n 'left': np.abs(recorda[state][topic][0]['left'][:,:shortest_length] - recordb[state][topic][0]['left'][:,:shortest_length]),\n 'right': np.abs(recorda[state][topic][0]['right'][:,:shortest_length] - recordb[state][topic][0]['right'][:,:shortest_length])\n }]}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L697_C4", "label": "return", "type": "return", "loc": [697, 697], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L688_C0", "vector": [13, 1, 0.8124, 0.0012, 1, 0.02, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L701_C0", "label": "DiffDisplay", "type": "class", "loc": [701, 747], "level": 0, "parent": null, "vector": [3, 0, 0.8438, 0.0548, 0, 0.66, 0.9697, 498, 0, 2, 0, 0, 0, 0, 29], "semantic": {"name": "DiffDisplay", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DiffDisplay:\n\n def __init__(self):\n rospy.init_node('diff_display')\n self.fail_marker = rospy.Publisher('diff_fail_avg', vm.Marker)\n self.fail_pc_pub = rospy.Publisher('diff_fail_pc', sm.PointCloud)\n\n self.succ_marker = rospy.Publisher('diff_succ_avg', vm.Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L703_C4", "label": "__init__", "type": "function", "loc": [703, 712], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L701_C0", "vector": [2, 1, 0.8246, 0.0117, 1, 0.75, 0.0, 555, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n rospy.init_node('diff_display')\n self.fail_marker = rospy.Publisher('diff_fail_avg', vm.Marker)\n self.fail_pc_pub = rospy.Publisher('diff_fail_pc', sm.PointCloud)\n\n self.succ_marker = rospy.Publisher('diff_succ_avg', vm.Marker)\n self.succ_pc_pub = rospy.Publisher('diff_succ_pc', sm.PointCloud)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L704_C8", "label": "init_node()", "type": "expression", "loc": [704, 704], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L703_C4", "vector": [8, 2, 0.8205, 0.0012, 2, 0.29, 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('diff_display')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L705_C8", "label": "self.fail_marker = Publisher()", "type": "assigned_variable", "loc": [705, 705], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L703_C4", "vector": [14, 2, 0.8217, 0.0012, 2, 0.29, 0.1667, 668, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.fail_marker", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.fail_marker = rospy.Publisher('diff_fail_avg', vm.Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L706_C8", "label": "self.fail_pc_pub = Publisher()", "type": "assigned_variable", "loc": [706, 706], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L703_C4", "vector": [14, 2, 0.8228, 0.0012, 2, 0.29, 0.3333, 924, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.fail_pc_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.fail_pc_pub = rospy.Publisher('diff_fail_pc', sm.PointCloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L708_C8", "label": "self.succ_marker = Publisher()", "type": "assigned_variable", "loc": [708, 708], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L703_C4", "vector": [14, 2, 0.8252, 0.0012, 2, 0.29, 0.5, 43, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.succ_marker", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.succ_marker = rospy.Publisher('diff_succ_avg', vm.Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L709_C8", "label": "self.succ_pc_pub = Publisher()", "type": "assigned_variable", "loc": [709, 709], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L703_C4", "vector": [14, 2, 0.8263, 0.0012, 2, 0.29, 0.6667, 536, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.succ_pc_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.succ_pc_pub = rospy.Publisher('diff_succ_pc', sm.PointCloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L711_C8", "label": "self.diff_marker = Publisher()", "type": "assigned_variable", "loc": [711, 711], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L703_C4", "vector": [14, 2, 0.8287, 0.0012, 2, 0.29, 0.8333, 252, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.diff_marker", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.diff_marker = rospy.Publisher('diff_avg', vm.Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L712_C8", "label": "self.diff_pc_pub = Publisher()", "type": "assigned_variable", "loc": [712, 712], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L703_C4", "vector": [14, 2, 0.8298, 0.0012, 2, 0.29, 1.0, 691, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.diff_pc_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.diff_pc_pub = rospy.Publisher('diff_pc', sm.PointCloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "label": "display", "type": "function", "loc": [714, 747], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L701_C0", "vector": [2, 1, 0.8514, 0.0396, 1, 0.75, 1.0, 669, 0, 3, 0, 0, 0, 0, 22], "semantic": {"name": "display", "arg_names": ["self", "succ_pickle", "fail_pickle"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def display(self, succ_pickle, fail_pickle):\n # load in pickle\n print('loading...')\n successes = ut.load_pickle(succ_pickle)\n failures = ut.load_pickle(fail_pickle)\n\n topics = ['/pressure/l_gripper_motor', '/pressure/r_gripper_motor']\n topic = topics[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L716_C8", "label": "print()", "type": "expression", "loc": [716, 716], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "vector": [8, 2, 0.8345, 0.0012, 2, 0.49, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('loading...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L717_C8", "label": "successes = load_pickle()", "type": "assigned_variable", "loc": [717, 717], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "vector": [14, 2, 0.8357, 0.0012, 2, 0.49, 0.0625, 797, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "successes", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " successes = ut.load_pickle(succ_pickle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L718_C8", "label": "failures = load_pickle()", "type": "assigned_variable", "loc": [718, 718], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "vector": [14, 2, 0.8368, 0.0012, 2, 0.49, 0.125, 276, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "failures", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " failures = ut.load_pickle(fail_pickle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L720_C8", "label": "topics =", "type": "assigned_variable", "loc": [720, 720], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "vector": [14, 2, 0.8392, 0.0012, 2, 0.49, 0.1875, 813, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "topics", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " topics = ['/pressure/l_gripper_motor', '/pressure/r_gripper_motor']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L721_C8", "label": "topic =", "type": "assigned_variable", "loc": [721, 721], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "vector": [14, 2, 0.8403, 0.0012, 2, 0.49, 0.25, 225, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " topic = topics[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L723_C8", "label": "red =", "type": "assigned_variable", "loc": [723, 723], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "vector": [14, 2, 0.8427, 0.0012, 2, 0.49, 0.3125, 903, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "red", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " red = np.matrix([1., 0, 0, 1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L724_C8", "label": "green =", "type": "assigned_variable", "loc": [724, 724], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "vector": [14, 2, 0.8438, 0.0012, 2, 0.49, 0.375, 128, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "green", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " green = np.matrix([0., 1., 0, 1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L725_C8", "label": "blue =", "type": "assigned_variable", "loc": [725, 725], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "vector": [14, 2, 0.845, 0.0012, 2, 0.49, 0.4375, 257, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "blue", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " blue = np.matrix([0., 0, 1., 1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L728_C8", "label": "succ_avg = average_reading_over_trials()", "type": "assigned_variable", "loc": [728, 728], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "vector": [14, 2, 0.8485, 0.0012, 2, 0.49, 0.5, 325, 3, 2, 0, 0, 36, 10, 1], "semantic": {"name": "succ_avg", "arg_names": [], "import_names": [], "rhs_call_name": "average_reading_over_trials", "annotation": ""}, "snippet": " succ_avg = average_reading_over_trials(successes, topic)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L729_C8", "label": "fail_avg = average_reading_over_trials()", "type": "assigned_variable", "loc": [729, 729], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "vector": [14, 2, 0.8497, 0.0012, 2, 0.49, 0.5625, 114, 3, 2, 0, 0, 36, 10, 1], "semantic": {"name": "fail_avg", "arg_names": [], "import_names": [], "rhs_call_name": "average_reading_over_trials", "annotation": ""}, "snippet": " fail_avg = average_reading_over_trials(failures, topic)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L730_C8", "label": "diff_avg = subtract_records()", "type": "assigned_variable", "loc": [730, 730], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "vector": [14, 2, 0.8508, 0.0012, 2, 0.49, 0.625, 405, 3, 3, 0, 0, 677, 10, 1], "semantic": {"name": "diff_avg", "arg_names": [], "import_names": [], "rhs_call_name": "subtract_records", "annotation": ""}, "snippet": " diff_avg = subtract_records(succ_avg, fail_avg, topic)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L732_C8", "label": "succ_marker, succ_pc = construct_pressure_marker_message()", "type": "assigned_variable", "loc": [732, 732], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "vector": [14, 2, 0.8531, 0.0012, 2, 0.49, 0.6875, 156, 3, 3, 0, 0, 707, 10, 1], "semantic": {"name": "succ_marker, succ_pc", "arg_names": [], "import_names": [], "rhs_call_name": "construct_pressure_marker_message", "annotation": ""}, "snippet": " succ_marker, succ_pc = construct_pressure_marker_message(succ_avg, topic, green)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L733_C8", "label": "fail_marker, fail_pc = construct_pressure_marker_message()", "type": "assigned_variable", "loc": [733, 733], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "vector": [14, 2, 0.8543, 0.0012, 2, 0.49, 0.75, 293, 3, 3, 0, 0, 707, 10, 1], "semantic": {"name": "fail_marker, fail_pc", "arg_names": [], "import_names": [], "rhs_call_name": "construct_pressure_marker_message", "annotation": ""}, "snippet": " fail_marker, fail_pc = construct_pressure_marker_message(fail_avg, topic, red)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L734_C8", "label": "diff_marker, diff_pc = construct_pressure_marker_message()", "type": "assigned_variable", "loc": [734, 734], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "vector": [14, 2, 0.8555, 0.0012, 2, 0.49, 0.8125, 302, 3, 3, 0, 0, 707, 10, 1], "semantic": {"name": "diff_marker, diff_pc", "arg_names": [], "import_names": [], "rhs_call_name": "construct_pressure_marker_message", "annotation": ""}, "snippet": " diff_marker, diff_pc = construct_pressure_marker_message(diff_avg, topic, blue)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L736_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [736, 736], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "vector": [14, 2, 0.8578, 0.0012, 2, 0.49, 0.875, 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_99663:Expr_L737_C8", "label": "print()", "type": "expression", "loc": [737, 737], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "vector": [8, 2, 0.859, 0.0012, 2, 0.49, 0.9375, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('publishing...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L738_C8", "label": "while", "type": "while", "loc": [738, 747], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "vector": [5, 2, 0.8654, 0.0117, 2, 0.49, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n self.succ_marker.publish(succ_marker)\n self.fail_marker.publish(fail_marker)\n\n self.succ_pc_pub.publish(succ_pc)\n self.fail_pc_pub.publish(fail_pc)\n\n self.diff_marker.publish(diff_marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L739_C12", "label": "publish()", "type": "expression", "loc": [739, 739], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L738_C8", "vector": [8, 3, 0.8613, 0.0012, 3, 0.95, 0.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.succ_marker.publish(succ_marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L740_C12", "label": "publish()", "type": "expression", "loc": [740, 740], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L738_C8", "vector": [8, 3, 0.8625, 0.0012, 3, 0.95, 0.1667, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.fail_marker.publish(fail_marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L742_C12", "label": "publish()", "type": "expression", "loc": [742, 742], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L738_C8", "vector": [8, 3, 0.8648, 0.0012, 3, 0.95, 0.3333, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.succ_pc_pub.publish(succ_pc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L743_C12", "label": "publish()", "type": "expression", "loc": [743, 743], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L738_C8", "vector": [8, 3, 0.866, 0.0012, 3, 0.95, 0.5, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.fail_pc_pub.publish(fail_pc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L745_C12", "label": "publish()", "type": "expression", "loc": [745, 745], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L738_C8", "vector": [8, 3, 0.8683, 0.0012, 3, 0.95, 0.6667, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.diff_marker.publish(diff_marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L746_C12", "label": "publish()", "type": "expression", "loc": [746, 746], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L738_C8", "vector": [8, 3, 0.8695, 0.0012, 3, 0.95, 0.8333, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.diff_pc_pub.publish(diff_pc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L747_C12", "label": "sleep()", "type": "expression", "loc": [747, 747], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L738_C8", "vector": [8, 3, 0.8706, 0.0012, 3, 0.95, 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_99663:If_L750_C0", "label": "if", "type": "if", "loc": [750, 794], "level": 0, "parent": null, "vector": [4, 0, 0.8998, 0.0524, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 22], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import sys\n\n if 'preprocess' == sys.argv[1]:\n print('Loading success bags..')\n succ_dict = success_failure_classification_preprocess(sys.argv[2])\n print('Saving success dict.')\n ut.save_pickle(succ_dict, '%s/success_data.pkl' % sys.argv[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Import_L751_C4", "label": "sys import sys", "type": "import", "loc": [751, 751], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L750_C0", "vector": [1, 1, 0.8753, 0.0012, 1, 0.07, 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_99663:If_L753_C4", "label": "if", "type": "if", "loc": [753, 764], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L750_C0", "vector": [4, 1, 0.884, 0.014, 1, 0.07, 0.1667, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'preprocess' == sys.argv[1]:\n print('Loading success bags..')\n succ_dict = success_failure_classification_preprocess(sys.argv[2])\n print('Saving success dict.')\n ut.save_pickle(succ_dict, '%s/success_data.pkl' % sys.argv[2])\n\n print('Loading failure bags..')\n fail_dict = success_failure_classification_preprocess(sys.argv[3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L754_C8", "label": "print()", "type": "expression", "loc": [754, 754], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L753_C4", "vector": [8, 2, 0.8788, 0.0012, 2, 0.95, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Loading success bags..')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L755_C8", "label": "succ_dict = success_failure_classification_preprocess()", "type": "assigned_variable", "loc": [755, 755], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L753_C4", "vector": [14, 2, 0.88, 0.0012, 2, 0.95, 0.125, 935, 3, 1, 0, 0, 425, 10, 1], "semantic": {"name": "succ_dict", "arg_names": [], "import_names": [], "rhs_call_name": "success_failure_classification_preprocess", "annotation": ""}, "snippet": " succ_dict = success_failure_classification_preprocess(sys.argv[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L756_C8", "label": "print()", "type": "expression", "loc": [756, 756], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L753_C4", "vector": [8, 2, 0.8811, 0.0012, 2, 0.95, 0.25, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Saving success dict.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L757_C8", "label": "save_pickle()", "type": "expression", "loc": [757, 757], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L753_C4", "vector": [8, 2, 0.8823, 0.0012, 2, 0.95, 0.375, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(succ_dict, '%s/success_data.pkl' % sys.argv[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L759_C8", "label": "print()", "type": "expression", "loc": [759, 759], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L753_C4", "vector": [8, 2, 0.8846, 0.0012, 2, 0.95, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Loading failure bags..')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L760_C8", "label": "fail_dict = success_failure_classification_preprocess()", "type": "assigned_variable", "loc": [760, 760], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L753_C4", "vector": [14, 2, 0.8858, 0.0012, 2, 0.95, 0.625, 291, 3, 1, 0, 0, 425, 10, 1], "semantic": {"name": "fail_dict", "arg_names": [], "import_names": [], "rhs_call_name": "success_failure_classification_preprocess", "annotation": ""}, "snippet": " fail_dict = success_failure_classification_preprocess(sys.argv[3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L761_C8", "label": "print()", "type": "expression", "loc": [761, 761], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L753_C4", "vector": [8, 2, 0.8869, 0.0012, 2, 0.95, 0.75, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Saving failure dict.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L762_C8", "label": "save_pickle()", "type": "expression", "loc": [762, 762], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L753_C4", "vector": [8, 2, 0.8881, 0.0012, 2, 0.95, 0.875, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(fail_dict, '%s/failure_data.pkl' % sys.argv[3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L764_C8", "label": "print()", "type": "expression", "loc": [764, 764], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L753_C4", "vector": [8, 2, 0.8904, 0.0012, 2, 0.95, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Done!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L766_C4", "label": "if", "type": "if", "loc": [766, 769], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L750_C0", "vector": [4, 1, 0.8945, 0.0047, 1, 0.07, 0.3333, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'learn' == sys.argv[1]:\n classifier = TimeSeriesClassifier()\n classifier.create_model(sys.argv[2], sys.argv[3])\n classifier.save_models()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L767_C8", "label": "classifier = TimeSeriesClassifier()", "type": "assigned_variable", "loc": [767, 767], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L766_C4", "vector": [14, 2, 0.8939, 0.0012, 2, 0.99, 0.0, 71, 3, 0, 0, 0, 701, 10, 1], "semantic": {"name": "classifier", "arg_names": [], "import_names": [], "rhs_call_name": "TimeSeriesClassifier", "annotation": ""}, "snippet": " classifier = TimeSeriesClassifier()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L768_C8", "label": "create_model()", "type": "expression", "loc": [768, 768], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L766_C4", "vector": [8, 2, 0.8951, 0.0012, 2, 0.99, 0.5, 682, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "create_model", "arg_names": [], "import_names": [], "rhs_call_name": "create_model", "annotation": ""}, "snippet": " classifier.create_model(sys.argv[2], sys.argv[3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L769_C8", "label": "save_models()", "type": "expression", "loc": [769, 769], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L766_C4", "vector": [8, 2, 0.8963, 0.0012, 2, 0.99, 1.0, 427, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "save_models", "arg_names": [], "import_names": [], "rhs_call_name": "save_models", "annotation": ""}, "snippet": " classifier.save_models()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L771_C4", "label": "if", "type": "if", "loc": [771, 774], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L750_C0", "vector": [4, 1, 0.9003, 0.0047, 1, 0.07, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'test' == sys.argv[1]:\n classifier = TimeSeriesClassifier()\n classifier.load_models()\n classifier.classify_pickle(sys.argv[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L772_C8", "label": "classifier = TimeSeriesClassifier()", "type": "assigned_variable", "loc": [772, 772], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L771_C4", "vector": [14, 2, 0.8998, 0.0012, 2, 0.6, 0.0, 71, 3, 0, 0, 0, 701, 10, 1], "semantic": {"name": "classifier", "arg_names": [], "import_names": [], "rhs_call_name": "TimeSeriesClassifier", "annotation": ""}, "snippet": " classifier = TimeSeriesClassifier()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L773_C8", "label": "load_models()", "type": "expression", "loc": [773, 773], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L771_C4", "vector": [8, 2, 0.9009, 0.0012, 2, 0.6, 0.5, 685, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load_models", "arg_names": [], "import_names": [], "rhs_call_name": "load_models", "annotation": ""}, "snippet": " classifier.load_models()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L774_C8", "label": "classify_pickle()", "type": "expression", "loc": [774, 774], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L771_C4", "vector": [8, 2, 0.9021, 0.0012, 2, 0.6, 1.0, 222, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "classify_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "classify_pickle", "annotation": ""}, "snippet": " classifier.classify_pickle(sys.argv[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L777_C4", "label": "if", "type": "if", "loc": [777, 780], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L750_C0", "vector": [4, 1, 0.9073, 0.0047, 1, 0.07, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'display' == sys.argv[1]:\n d = DisplayDataWithRviz()\n #data_dict [state number] [topic] [trial number] ['t' 'left' 'right']\n d.display(sys.argv[2], sys.argv[3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L778_C8", "label": "d = DisplayDataWithRviz()", "type": "assigned_variable", "loc": [778, 778], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L777_C4", "vector": [14, 2, 0.9068, 0.0012, 2, 0.18, 0.0, 355, 3, 0, 0, 0, 765, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "DisplayDataWithRviz", "annotation": ""}, "snippet": " d = DisplayDataWithRviz()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L780_C8", "label": "display()", "type": "expression", "loc": [780, 780], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L777_C4", "vector": [8, 2, 0.9091, 0.0012, 2, 0.18, 1.0, 669, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "display", "arg_names": [], "import_names": [], "rhs_call_name": "display", "annotation": ""}, "snippet": " d.display(sys.argv[2], sys.argv[3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L783_C4", "label": "if", "type": "if", "loc": [783, 786], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L750_C0", "vector": [4, 1, 0.9143, 0.0047, 1, 0.07, 0.8333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'diff' == sys.argv[1]:\n d = DiffDisplay()\n #data_dict [state number] [topic] [trial number] ['t' 'left' 'right']\n d.display(sys.argv[2], sys.argv[3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L784_C8", "label": "d = DiffDisplay()", "type": "assigned_variable", "loc": [784, 784], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L783_C4", "vector": [14, 2, 0.9138, 0.0012, 2, 0.5, 0.0, 355, 3, 0, 0, 0, 498, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "DiffDisplay", "annotation": ""}, "snippet": " d = DiffDisplay()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L786_C8", "label": "display()", "type": "expression", "loc": [786, 786], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L783_C4", "vector": [8, 2, 0.9161, 0.0012, 2, 0.5, 1.0, 669, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "display", "arg_names": [], "import_names": [], "rhs_call_name": "display", "annotation": ""}, "snippet": " d.display(sys.argv[2], sys.argv[3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L789_C4", "label": "if", "type": "if", "loc": [789, 794], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L750_C0", "vector": [4, 1, 0.9225, 0.007, 1, 0.07, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'run' == sys.argv[1]:\n #t = TestOnlineClassification()\n #t.start_classifying()\n t = TimeSeriesClassifier()\n t.load_models()\n t.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L792_C8", "label": "t = TimeSeriesClassifier()", "type": "assigned_variable", "loc": [792, 792], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L789_C4", "vector": [14, 2, 0.9231, 0.0012, 2, 0.64, 0.0, 15, 3, 0, 0, 0, 701, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "TimeSeriesClassifier", "annotation": ""}, "snippet": " t = TimeSeriesClassifier()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L793_C8", "label": "load_models()", "type": "expression", "loc": [793, 793], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L789_C4", "vector": [8, 2, 0.9242, 0.0012, 2, 0.64, 0.5, 685, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load_models", "arg_names": [], "import_names": [], "rhs_call_name": "load_models", "annotation": ""}, "snippet": " t.load_models()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L794_C8", "label": "run()", "type": "expression", "loc": [794, 794], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L789_C4", "vector": [8, 2, 0.9254, 0.0012, 2, 0.64, 1.0, 679, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " t.run()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L45_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L46_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L52_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L53_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L63_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L65_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L63_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L66_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L66_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L67_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L63_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L68_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L72_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L73_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L94_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L95_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L95_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L96_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L95_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L97_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L95_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L98_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L94_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L101_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L94_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L103_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L120_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L120_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L121_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L120_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L123_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L120_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L124_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L120_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L125_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L120_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L127_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L120_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L131_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L138_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L139_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L139_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L140_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L146_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L150_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L157_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L169_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L170_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L173_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L174_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L177_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L181_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L184_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L185_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L188_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L188_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L189_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L189_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L190_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L189_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L192_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L189_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L193_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L188_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L195_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L197_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L204_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L206_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L209_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L210_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L204_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L213_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L218_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L219_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L218_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L221_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L218_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L223_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L218_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L224_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L230_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L230_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L230_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L230_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L233_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L234_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L230_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L239_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L239_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L241_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L242_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L242_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L243_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L242_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L244_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L246_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L246_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L246_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L246_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L246_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L254_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L267_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L267_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L268_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L267_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L270_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L253_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L277_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L277_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L277_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L281_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L285_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L286_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L287_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L287_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L289_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L287_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L292_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L287_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L293_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L287_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L295_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L300_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L301_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L302_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L303_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L308_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L312_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L317_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L318_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L318_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L320_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L318_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L321_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L321_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L322_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L322_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L323_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L321_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L324_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L324_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L325_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L325_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L326_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L324_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L327_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L324_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L328_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L331_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L332_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L332_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L333_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L332_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L334_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L334_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L335_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L334_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L337_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L334_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L339_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L334_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L340_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L334_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L341_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L334_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L343_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L334_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L344_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L334_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L345_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L334_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L346_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L299_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L355_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L359_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L359_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L360_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L359_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L361_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L361_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L362_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L361_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L363_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L363_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L364_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L363_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L365_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L365_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L366_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L365_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L367_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L363_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L369_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L363_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L370_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L363_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L371_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L359_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L377_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L378_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L381_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L382_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L387_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L389_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L392_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L394_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L398_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L399_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L399_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L400_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L399_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L401_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L401_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L403_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L401_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L405_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L401_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L408_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L401_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L409_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L414_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L414_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L415_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L415_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L416_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L416_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L417_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L417_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L418_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L417_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L419_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L425_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L374_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L429_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L431_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L431_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L432_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L431_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L434_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L431_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L435_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L431_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L438_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L431_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L441_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L431_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L445_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L445_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L446_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L446_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L447_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L447_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L448_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L447_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L449_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L431_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L452_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L228_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L456_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L458_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L460_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L461_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L462_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L463_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L464_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L466_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L467_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L468_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L468_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L469_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L469_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L470_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L470_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L471_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L469_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L473_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L473_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L474_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L476_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L477_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L478_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L484_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L485_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L486_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L487_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L489_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L490_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L490_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L491_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L493_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L472_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L494_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L468_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L495_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L454_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L497_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L497_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L498_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L498_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L499_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L498_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L500_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L498_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L501_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L498_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L502_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L505_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L508_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L505_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L509_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L509_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L510_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L509_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L511_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L511_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L512_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L511_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L514_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L505_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L515_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L518_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L519_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L519_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L520_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L519_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L521_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L521_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L522_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L521_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L523_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L521_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L524_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L525_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L529_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L530_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L531_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L532_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L535_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L537_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L538_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L539_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L539_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L540_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L539_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L541_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L539_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L542_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L539_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L544_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L547_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L548_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L548_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L551_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L548_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L552_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L552_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L554_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L552_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L555_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L552_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L556_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L548_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L559_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L548_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L560_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L564_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L565_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L566_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L566_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L567_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L566_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L568_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L566_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L570_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L572_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L573_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L575_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L577_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L578_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L580_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L582_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L582_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L583_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L582_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L584_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L582_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L585_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L582_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L587_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L582_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L588_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L580_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L592_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L593_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L594_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L596_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L597_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L597_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L598_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L599_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L601_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L602_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L603_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L605_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L606_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L608_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L609_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L610_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L590_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L611_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L611_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L612_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L611_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L613_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L611_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L614_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L623_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L624_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L623_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L625_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L625_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L626_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L625_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L627_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L625_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L628_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L628_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L629_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L628_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L631_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L625_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L632_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L623_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L635_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L638_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L639_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L638_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L640_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L638_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L641_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L638_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L642_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L638_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L645_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L646_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L647_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L649_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L650_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L652_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L655_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L656_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L657_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L644_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L658_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L638_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L660_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L638_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L661_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L638_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L662_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L638_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L663_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L666_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L668_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L666_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L669_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L669_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L670_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L669_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L671_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L671_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L672_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L666_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L674_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L666_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L676_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L676_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L677_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L676_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L678_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L676_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L679_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L676_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L680_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L676_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L682_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L666_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L685_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L688_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L689_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L688_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L690_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L690_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L691_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:For_L690_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L692_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L688_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Return_L697_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L701_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L703_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L703_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L704_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L703_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L705_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L703_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L706_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L703_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L708_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L703_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L709_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L703_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L711_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L703_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L712_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:ClassDef_L701_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L716_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L717_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L718_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L720_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L721_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L723_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L724_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L725_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L728_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L729_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L730_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L732_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L733_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L734_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L736_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L737_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:FunctionDef_L714_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L738_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L738_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L739_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L738_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L740_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L738_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L742_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L738_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L743_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L738_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L745_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L738_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L746_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:While_L738_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L747_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L750_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Import_L751_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L750_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L753_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L753_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L754_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L753_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L755_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L753_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L756_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L753_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L757_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L753_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L759_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L753_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L760_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L753_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L761_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L753_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L762_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L753_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L764_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L750_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L766_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L766_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L767_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L766_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L768_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L766_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L769_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L750_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L771_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L771_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L772_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L771_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L773_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L771_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L774_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L750_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L777_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L777_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L778_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L777_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L780_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L750_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L783_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L783_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L784_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L783_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L786_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L750_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L789_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L789_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Assign_L792_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L789_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L793_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99663:If_L789_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99663:Expr_L794_C8"}]
import roslib; roslib.load_manifest('hai_sandbox') import rospy import rosrecord import sys f = open(sys.argv[1]) i = 0 for topic, message, time in rosrecord.logplayer(f): i = i + 1 print topic, time if i > 10: break f.close() ## # In this bag, give me messages from these topics # @param file_name # @param topics def bag_reader(file_name, topics): f = open(file_name) tdict = {} for t in topics: tdict[t] = True for r in rosrecord.logplayer(f): if tdict.has_key(r[0]): yield r f.close()
ajibawa-2023/Python-Code-Large/train/row_99666
21
28
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99666:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.0357, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99666:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0357, 0.0357, 0, 0.66, 0.1111, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99666:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0357, 0, 0.66, 0.2222, 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_99666:Import_L3_C0", "label": "rosrecord import rosrecord", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1071, 0.0357, 0, 0.66, 0.3333, 617, 0, 1, 0, 0, 617, 0, 0], "semantic": {"name": "rosrecord", "arg_names": [], "import_names": ["rosrecord"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rosrecord"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99666:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0357, 0, 0.66, 0.4444, 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_99666:Assign_L6_C0", "label": "f = open()", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.2143, 0.0357, 0, 0.66, 0.5556, 899, 3, 1, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "f = open(sys.argv[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99666:Assign_L7_C0", "label": "i =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.0357, 0, 0.66, 0.6667, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99666:For_L8_C0", "label": "for topic, message, time", "type": "for", "loc": [8, 12], "level": 0, "parent": null, "vector": [6, 0, 0.3571, 0.1786, 0, 0.66, 0.7778, 741, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "topic, message, time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for topic, message, time in rosrecord.logplayer(f):\n i = i + 1\n print(topic, time)\n if i > 10:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99666:Assign_L9_C4", "label": "i =", "type": "assigned_variable", "loc": [9, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99666:For_L8_C0", "vector": [14, 1, 0.3214, 0.0357, 1, 0.22, 0.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99666:Expr_L10_C4", "label": "print()", "type": "expression", "loc": [10, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99666:For_L8_C0", "vector": [8, 1, 0.3571, 0.0357, 1, 0.22, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(topic, time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99666:If_L11_C4", "label": "if", "type": "if", "loc": [11, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99666:For_L8_C0", "vector": [4, 1, 0.4107, 0.0714, 1, 0.22, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i > 10:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99666:Expr_L13_C0", "label": "close()", "type": "expression", "loc": [13, 13], "level": 0, "parent": null, "vector": [8, 0, 0.4643, 0.0357, 0, 0.66, 0.8889, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "f.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99666:FunctionDef_L19_C0", "label": "bag_reader", "type": "function", "loc": [19, 27], "level": 0, "parent": null, "vector": [2, 0, 0.8214, 0.3214, 0, 0.66, 1.0, 92, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "bag_reader", "arg_names": ["file_name", "topics"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def bag_reader(file_name, topics):\n f = open(file_name)\n tdict = {}\n for t in topics:\n tdict[t] = True\n for r in rosrecord.logplayer(f):\n if tdict.has_key(r[0]):\n yield r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99666:Assign_L20_C4", "label": "f = open()", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99666:FunctionDef_L19_C0", "vector": [14, 1, 0.7143, 0.0357, 1, 0.81, 0.0, 899, 3, 1, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " f = open(file_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99666:Assign_L21_C4", "label": "tdict =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99666:FunctionDef_L19_C0", "vector": [14, 1, 0.75, 0.0357, 1, 0.81, 0.25, 460, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "tdict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tdict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99666:For_L22_C4", "label": "for t", "type": "for", "loc": [22, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99666:FunctionDef_L19_C0", "vector": [6, 1, 0.8036, 0.0714, 1, 0.81, 0.5, 15, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for t in topics:\n tdict[t] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99666:Assign_L23_C8", "label": "assign", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99666:For_L22_C4", "vector": [14, 2, 0.8214, 0.0357, 2, 0.68, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tdict[t] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99666:For_L24_C4", "label": "for r", "type": "for", "loc": [24, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99666:FunctionDef_L19_C0", "vector": [6, 1, 0.8929, 0.1071, 1, 0.81, 0.75, 436, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for r in rosrecord.logplayer(f):\n if tdict.has_key(r[0]):\n yield r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99666:If_L25_C8", "label": "if", "type": "if", "loc": [25, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99666:For_L24_C4", "vector": [4, 2, 0.9107, 0.0714, 2, 0.34, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tdict.has_key(r[0]):\n yield r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99666:Expr_L26_C12", "label": "expression", "type": "expression", "loc": [26, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99666:If_L25_C8", "vector": [8, 3, 0.9286, 0.0357, 3, 0.01, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99666:Expr_L27_C4", "label": "close()", "type": "expression", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99666:FunctionDef_L19_C0", "vector": [8, 1, 0.9643, 0.0357, 1, 0.81, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " f.close()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99666:For_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99666:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99666:For_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99666:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99666:For_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99666:If_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99666:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99666:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99666:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99666:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99666:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99666:For_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99666:For_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99666:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99666:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99666:For_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99666:For_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99666:If_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99666:If_L25_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99666:Expr_L26_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99666:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99666:Expr_L27_C4"}]
import roslib; roslib.load_manifest('hai_sandbox') import rospy import feature_extractor_fpfh.msg as fmsg import hrl_lib.rutils as ru from cv_bridge import CvBridge, CvBridgeError import numpy as np class KinectListener: def __init__(self, topic=None): if topic == None: topic = 'fpfh_hist' rate = .2 self.listener = ru.GenericListener('kinect_client', fmsg.FPFHHist, topic, rate) self.bridge = CvBridge() def read(self): cur_time = rospy.Time.now().to_sec() not_fresh = True while not_fresh: fpfh_hist = self.listener.read(allow_duplication=False, willing_to_wait=True, warn=False, quiet=True) if not (fpfh_hist.header.stamp.to_sec() < cur_time): not_fresh = False else: rospy.loginfo("fpfh message time is in the past by %.2f secs"% (cur_time - fpfh_hist.header.stamp.to_sec())) histogram = np.matrix(fpfh_hist.histograms).reshape((fpfh_hist.hist_npoints, 33)).T hist_points = np.matrix(fpfh_hist.hpoints3d).reshape((fpfh_hist.hist_npoints, 3)).T points3d = np.matrix(fpfh_hist.origpoints).reshape((fpfh_hist.original_npoints, 3)).T points3d = points3d[:, np.where(1-np.isnan(points3d))[1].A1] cvimage_mat = self.bridge.imgmsg_to_cv(fpfh_hist.image, 'bgr8') return {'histogram': histogram, 'hpoints3d': hist_points, 'points3d': points3d, 'image': cvimage_mat}
ajibawa-2023/Python-Code-Large/train/row_99667
28
35
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99667:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0286, 0.0286, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0286, 0.0286, 0, 0.66, 0.1429, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:Import_L3_C0", "label": "rospy import rospy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0857, 0.0286, 0, 0.66, 0.2857, 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_99667:Import_L4_C0", "label": "feature_extractor_fpfh.msg import fmsg", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1143, 0.0286, 0, 0.66, 0.4286, 660, 0, 1, 0, 0, 660, 0, 0], "semantic": {"name": "feature_extractor_fpfh.msg", "arg_names": [], "import_names": ["fmsg"], "rhs_call_name": "", "annotation": ""}, "snippet": "import feature_extractor_fpfh.msg as fmsg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:Import_L5_C0", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0286, 0, 0.66, 0.5714, 847, 0, 1, 0, 0, 847, 0, 0], "semantic": {"name": "hrl_lib.rutils", "arg_names": [], "import_names": ["ru"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.rutils as ru"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:ImportFrom_L6_C0", "label": "from cv_bridge import CvBridge, CvBridgeError", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1714, 0.0286, 0, 0.66, 0.7143, 851, 0, 2, 0, 0, 851, 0, 0], "semantic": {"name": "cv_bridge", "arg_names": [], "import_names": ["CvBridge", "CvBridgeError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from cv_bridge import CvBridge, CvBridgeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:Import_L7_C0", "label": "numpy import np", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.0286, 0, 0.66, 0.8571, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:ClassDef_L10_C0", "label": "KinectListener", "type": "class", "loc": [10, 33], "level": 0, "parent": null, "vector": [3, 0, 0.6143, 0.6857, 0, 0.66, 1.0, 640, 0, 2, 0, 0, 0, 0, 17], "semantic": {"name": "KinectListener", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class KinectListener:\n def __init__(self, topic=None):\n if topic == None:\n topic = 'fpfh_hist'\n rate = .2\n self.listener = ru.GenericListener('kinect_client', fmsg.FPFHHist, topic, rate)\n self.bridge = CvBridge()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L11_C4", "label": "__init__", "type": "function", "loc": [11, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99667:ClassDef_L10_C0", "vector": [2, 1, 0.3857, 0.1714, 1, 0.61, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, topic=None):\n if topic == None:\n topic = 'fpfh_hist'\n rate = .2\n self.listener = ru.GenericListener('kinect_client', fmsg.FPFHHist, topic, rate)\n self.bridge = CvBridge()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:If_L12_C8", "label": "if", "type": "if", "loc": [12, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L11_C4", "vector": [4, 2, 0.3571, 0.0571, 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 topic == None:\n topic = 'fpfh_hist'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L13_C12", "label": "topic =", "type": "assigned_variable", "loc": [13, 13], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99667:If_L12_C8", "vector": [14, 3, 0.3714, 0.0286, 3, 0.82, 0.0, 225, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " topic = 'fpfh_hist'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L14_C8", "label": "rate =", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L11_C4", "vector": [14, 2, 0.4, 0.0286, 2, 0.85, 0.3333, 477, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "rate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rate = .2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L15_C8", "label": "self.listener = GenericListener()", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L11_C4", "vector": [14, 2, 0.4286, 0.0286, 2, 0.85, 0.6667, 686, 3, 4, 0, 0, 36, 10, 1], "semantic": {"name": "self.listener", "arg_names": [], "import_names": [], "rhs_call_name": "GenericListener", "annotation": ""}, "snippet": " self.listener = ru.GenericListener('kinect_client', fmsg.FPFHHist, topic, rate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L16_C8", "label": "self.bridge = CvBridge()", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L11_C4", "vector": [14, 2, 0.4571, 0.0286, 2, 0.85, 1.0, 949, 3, 0, 0, 0, 439, 10, 1], "semantic": {"name": "self.bridge", "arg_names": [], "import_names": [], "rhs_call_name": "CvBridge", "annotation": ""}, "snippet": " self.bridge = CvBridge()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L18_C4", "label": "read", "type": "function", "loc": [18, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99667:ClassDef_L10_C0", "vector": [2, 1, 0.7286, 0.4571, 1, 0.61, 1.0, 453, 0, 1, 1, 0, 0, 0, 15], "semantic": {"name": "read", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def read(self):\n cur_time = rospy.Time.now().to_sec()\n not_fresh = True\n while not_fresh:\n fpfh_hist = self.listener.read(allow_duplication=False, willing_to_wait=True, warn=False, quiet=True)\n if not (fpfh_hist.header.stamp.to_sec() < cur_time):\n not_fresh = False\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L19_C8", "label": "cur_time = to_sec()", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L18_C4", "vector": [14, 2, 0.5429, 0.0286, 2, 0.4, 0.0, 618, 3, 0, 0, 0, 750, 10, 2], "semantic": {"name": "cur_time", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " cur_time = rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L20_C8", "label": "not_fresh =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L18_C4", "vector": [14, 2, 0.5714, 0.0286, 2, 0.4, 0.125, 649, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "not_fresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " not_fresh = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:While_L21_C8", "label": "while", "type": "while", "loc": [21, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L18_C4", "vector": [5, 2, 0.6714, 0.1714, 2, 0.4, 0.25, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not_fresh:\n fpfh_hist = self.listener.read(allow_duplication=False, willing_to_wait=True, warn=False, quiet=True)\n if not (fpfh_hist.header.stamp.to_sec() < cur_time):\n not_fresh = False\n else:\n rospy.loginfo(\"fpfh message time is in the past by %.2f secs\"% (cur_time - fpfh_hist.header.stamp.to_sec()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L22_C12", "label": "fpfh_hist = read()", "type": "assigned_variable", "loc": [22, 22], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99667:While_L21_C8", "vector": [14, 3, 0.6286, 0.0286, 3, 0.37, 0.0, 960, 3, 4, 0, 0, 453, 10, 1], "semantic": {"name": "fpfh_hist", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " fpfh_hist = self.listener.read(allow_duplication=False, willing_to_wait=True, warn=False, quiet=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:If_L23_C12", "label": "if", "type": "if", "loc": [23, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99667:While_L21_C8", "vector": [4, 3, 0.7, 0.1143, 3, 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 (fpfh_hist.header.stamp.to_sec() < cur_time):\n not_fresh = False\n else:\n rospy.loginfo(\"fpfh message time is in the past by %.2f secs\"% (cur_time - fpfh_hist.header.stamp.to_sec()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L24_C16", "label": "not_fresh =", "type": "assigned_variable", "loc": [24, 24], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99667:If_L23_C12", "vector": [14, 4, 0.6857, 0.0286, 4, 0.99, 0.0, 649, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "not_fresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " not_fresh = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:Expr_L26_C16", "label": "loginfo()", "type": "expression", "loc": [26, 26], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99667:If_L23_C12", "vector": [8, 4, 0.7429, 0.0286, 4, 0.99, 1.0, 607, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"fpfh message time is in the past by %.2f secs\"% (cur_time - fpfh_hist.header.stamp.to_sec()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L28_C8", "label": "histogram =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L18_C4", "vector": [14, 2, 0.8, 0.0286, 2, 0.4, 0.375, 428, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "histogram", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " histogram = np.matrix(fpfh_hist.histograms).reshape((fpfh_hist.hist_npoints, 33)).T "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L29_C8", "label": "hist_points =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L18_C4", "vector": [14, 2, 0.8286, 0.0286, 2, 0.4, 0.5, 834, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "hist_points", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hist_points = np.matrix(fpfh_hist.hpoints3d).reshape((fpfh_hist.hist_npoints, 3)).T "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L30_C8", "label": "points3d =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L18_C4", "vector": [14, 2, 0.8571, 0.0286, 2, 0.4, 0.625, 243, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "points3d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " points3d = np.matrix(fpfh_hist.origpoints).reshape((fpfh_hist.original_npoints, 3)).T "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L31_C8", "label": "points3d =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L18_C4", "vector": [14, 2, 0.8857, 0.0286, 2, 0.4, 0.75, 243, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "points3d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " points3d = points3d[:, np.where(1-np.isnan(points3d))[1].A1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L32_C8", "label": "cvimage_mat = imgmsg_to_cv()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L18_C4", "vector": [14, 2, 0.9143, 0.0286, 2, 0.4, 0.875, 28, 3, 2, 0, 0, 181, 10, 1], "semantic": {"name": "cvimage_mat", "arg_names": [], "import_names": [], "rhs_call_name": "imgmsg_to_cv", "annotation": ""}, "snippet": " cvimage_mat = self.bridge.imgmsg_to_cv(fpfh_hist.image, 'bgr8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99667:Return_L33_C8", "label": "return", "type": "return", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L18_C4", "vector": [13, 2, 0.9429, 0.0286, 2, 0.4, 1.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return {'histogram': histogram, 'hpoints3d': hist_points, 'points3d': points3d, 'image': cvimage_mat}"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99667:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99667:If_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99667:If_L12_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L13_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99667:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99667:While_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99667:While_L21_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L22_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99667:While_L21_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99667:If_L23_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99667:If_L23_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L24_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99667:If_L23_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99667:Expr_L26_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99667:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99667:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99667:Return_L33_C8"}]
import roslib; roslib.load_manifest('hai_sandbox') from cv_bridge.cv_bridge import CvBridge, CvBridgeError import cv import sys import hrl_lib.rutils as ru import hai_sandbox.features as fea forearm_cam_l = '/l_forearm_cam/image_rect_color' ws_l = '/wide_stereo/left/image_rect_color' ws_r = '/wide_stereo/right/image_rect_color' fname = sys.argv[1] bridge = CvBridge() cv.NamedWindow('surf', 1) cv.NamedWindow('harris', 1) cv.NamedWindow('star', 1) for topic, msg, t in ru.bag_iter(fname, [ws_l]): image = bridge.imgmsg_to_cv(msg, 'bgr8') image_gray = fea.grayscale(image) surf_keypoints, surf_descriptors = fea.surf(image_gray) cv.ShowImage('surf', fea.draw_surf(image, surf_keypoints, (255, 0, 0))) harris_keypoints = fea.harris(image_gray) cv.ShowImage('harris', fea.draw_harris(image, harris_keypoints, (0, 255, 0))) cv.WaitKey(10)
ajibawa-2023/Python-Code-Large/train/row_99668
23
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_99668:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0333, 0.0333, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99668:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0333, 0.0333, 0, 0.66, 0.0667, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99668:ImportFrom_L2_C0", "label": "from cv_bridge.cv_bridge import CvBridge, CvBridgeError", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0333, 0, 0.66, 0.1333, 356, 0, 2, 0, 0, 356, 0, 0], "semantic": {"name": "cv_bridge.cv_bridge", "arg_names": [], "import_names": ["CvBridge", "CvBridgeError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from cv_bridge.cv_bridge import CvBridge, CvBridgeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99668:Import_L3_C0", "label": "cv import cv", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.0333, 0, 0.66, 0.2, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99668:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1333, 0.0333, 0, 0.66, 0.2667, 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_99668:Import_L5_C0", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.0333, 0, 0.66, 0.3333, 847, 0, 1, 0, 0, 847, 0, 0], "semantic": {"name": "hrl_lib.rutils", "arg_names": [], "import_names": ["ru"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.rutils as ru"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99668:Import_L6_C0", "label": "hai_sandbox.features import fea", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.0333, 0, 0.66, 0.4, 673, 0, 1, 0, 0, 673, 0, 0], "semantic": {"name": "hai_sandbox.features", "arg_names": [], "import_names": ["fea"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hai_sandbox.features as fea"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99668:Assign_L8_C0", "label": "forearm_cam_l =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.2667, 0.0333, 0, 0.66, 0.4667, 246, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "forearm_cam_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "forearm_cam_l = '/l_forearm_cam/image_rect_color'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99668:Assign_L9_C0", "label": "ws_l =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.3, 0.0333, 0, 0.66, 0.5333, 657, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ws_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ws_l = '/wide_stereo/left/image_rect_color'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99668:Assign_L10_C0", "label": "ws_r =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0333, 0, 0.66, 0.6, 524, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ws_r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ws_r = '/wide_stereo/right/image_rect_color'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99668:Assign_L12_C0", "label": "fname =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.4, 0.0333, 0, 0.66, 0.6667, 190, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "fname = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99668:Assign_L13_C0", "label": "bridge = CvBridge()", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.4333, 0.0333, 0, 0.66, 0.7333, 658, 3, 0, 0, 0, 439, 10, 1], "semantic": {"name": "bridge", "arg_names": [], "import_names": [], "rhs_call_name": "CvBridge", "annotation": ""}, "snippet": "bridge = CvBridge()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99668:Expr_L15_C0", "label": "NamedWindow()", "type": "expression", "loc": [15, 15], "level": 0, "parent": null, "vector": [8, 0, 0.5, 0.0333, 0, 0.66, 0.8, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": "cv.NamedWindow('surf', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99668:Expr_L16_C0", "label": "NamedWindow()", "type": "expression", "loc": [16, 16], "level": 0, "parent": null, "vector": [8, 0, 0.5333, 0.0333, 0, 0.66, 0.8667, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": "cv.NamedWindow('harris', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99668:Expr_L17_C0", "label": "NamedWindow()", "type": "expression", "loc": [17, 17], "level": 0, "parent": null, "vector": [8, 0, 0.5667, 0.0333, 0, 0.66, 0.9333, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": "cv.NamedWindow('star', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99668:For_L19_C0", "label": "for topic, msg, t", "type": "for", "loc": [19, 29], "level": 0, "parent": null, "vector": [6, 0, 0.8, 0.3667, 0, 0.66, 1.0, 35, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "topic, msg, t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for topic, msg, t in ru.bag_iter(fname, [ws_l]):\n image = bridge.imgmsg_to_cv(msg, 'bgr8')\n image_gray = fea.grayscale(image)\n\n surf_keypoints, surf_descriptors = fea.surf(image_gray)\n cv.ShowImage('surf', fea.draw_surf(image, surf_keypoints, (255, 0, 0)))\n\n harris_keypoints = fea.harris(image_gray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99668:Assign_L20_C4", "label": "image = imgmsg_to_cv()", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99668:For_L19_C0", "vector": [14, 1, 0.6667, 0.0333, 1, 0.79, 0.0, 505, 3, 2, 0, 0, 181, 10, 1], "semantic": {"name": "image", "arg_names": [], "import_names": [], "rhs_call_name": "imgmsg_to_cv", "annotation": ""}, "snippet": " image = bridge.imgmsg_to_cv(msg, 'bgr8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99668:Assign_L21_C4", "label": "image_gray = grayscale()", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99668:For_L19_C0", "vector": [14, 1, 0.7, 0.0333, 1, 0.79, 0.1667, 411, 3, 1, 0, 0, 530, 10, 1], "semantic": {"name": "image_gray", "arg_names": [], "import_names": [], "rhs_call_name": "grayscale", "annotation": ""}, "snippet": " image_gray = fea.grayscale(image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99668:Assign_L23_C4", "label": "surf_keypoints, surf_descriptors = surf()", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99668:For_L19_C0", "vector": [14, 1, 0.7667, 0.0333, 1, 0.79, 0.3333, 490, 3, 1, 0, 0, 181, 10, 1], "semantic": {"name": "surf_keypoints, surf_descriptors", "arg_names": [], "import_names": [], "rhs_call_name": "surf", "annotation": ""}, "snippet": " surf_keypoints, surf_descriptors = fea.surf(image_gray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99668:Expr_L24_C4", "label": "ShowImage()", "type": "expression", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99668:For_L19_C0", "vector": [8, 1, 0.8, 0.0333, 1, 0.79, 0.5, 896, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage('surf', fea.draw_surf(image, surf_keypoints, (255, 0, 0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99668:Assign_L26_C4", "label": "harris_keypoints = harris()", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99668:For_L19_C0", "vector": [14, 1, 0.8667, 0.0333, 1, 0.79, 0.6667, 115, 3, 1, 0, 0, 916, 10, 1], "semantic": {"name": "harris_keypoints", "arg_names": [], "import_names": [], "rhs_call_name": "harris", "annotation": ""}, "snippet": " harris_keypoints = fea.harris(image_gray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99668:Expr_L27_C4", "label": "ShowImage()", "type": "expression", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99668:For_L19_C0", "vector": [8, 1, 0.9, 0.0333, 1, 0.79, 0.8333, 896, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage('harris', fea.draw_harris(image, harris_keypoints, (0, 255, 0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99668:Expr_L29_C4", "label": "WaitKey()", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99668:For_L19_C0", "vector": [8, 1, 0.9667, 0.0333, 1, 0.79, 1.0, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "WaitKey", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " cv.WaitKey(10)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99668:For_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99668:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99668:For_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99668:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99668:For_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99668:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99668:For_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99668:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99668:For_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99668:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99668:For_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99668:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99668:For_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99668:Expr_L29_C4"}]
import roslib; roslib.load_manifest('hai_sandbox') import cv import sys import hai_sandbox.features as fea if __name__ == '__main__': fname = sys.argv[1] image = cv.LoadImage(fname) image_gray = cv.CreateImage((640,480), cv.IPL_DEPTH_8U,1) cv.CvtColor(image, image_gray, cv.CV_BGR2GRAY) star_keypoints = fea.star(image) surf_keypoints, surf_descriptors = fea.surf(image_gray) harris_keypoints = fea.harris(image_gray) cv.NamedWindow('surf', 1) cv.NamedWindow('harris', 1) cv.NamedWindow('star', 1) while True: cv.ShowImage('surf', fea.draw_surf(image, surf_keypoints, (255, 0, 0))) cv.ShowImage('harris', fea.draw_harris(image, harris_keypoints, (0, 255, 0))) cv.ShowImage('star', fea.draw_star(image, star_keypoints, (0, 0, 255))) k = cv.WaitKey(33) if k == 27: break #Canny(image, edges, threshold1, threshold2, aperture_size=3) => None
ajibawa-2023/Python-Code-Large/train/row_99669
22
27
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99669:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.037, 0.037, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99669:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.037, 0.037, 0, 0.66, 0.2, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99669:Import_L2_C0", "label": "cv import cv", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0741, 0.037, 0, 0.66, 0.4, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99669:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.037, 0, 0.66, 0.6, 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_99669:Import_L4_C0", "label": "hai_sandbox.features import fea", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1481, 0.037, 0, 0.66, 0.8, 673, 0, 1, 0, 0, 673, 0, 0], "semantic": {"name": "hai_sandbox.features", "arg_names": [], "import_names": ["fea"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hai_sandbox.features as fea"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "label": "if", "type": "if", "loc": [6, 25], "level": 0, "parent": null, "vector": [4, 0, 0.5741, 0.7407, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n fname = sys.argv[1]\n image = cv.LoadImage(fname)\n image_gray = cv.CreateImage((640,480), cv.IPL_DEPTH_8U,1)\n cv.CvtColor(image, image_gray, cv.CV_BGR2GRAY)\n\n star_keypoints = fea.star(image) \n surf_keypoints, surf_descriptors = fea.surf(image_gray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99669:Assign_L7_C4", "label": "fname =", "type": "assigned_variable", "loc": [7, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "vector": [14, 1, 0.2593, 0.037, 1, 0.97, 0.0, 190, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fname = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99669:Assign_L8_C4", "label": "image = LoadImage()", "type": "assigned_variable", "loc": [8, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "vector": [14, 1, 0.2963, 0.037, 1, 0.97, 0.1, 505, 3, 1, 0, 0, 512, 10, 1], "semantic": {"name": "image", "arg_names": [], "import_names": [], "rhs_call_name": "LoadImage", "annotation": ""}, "snippet": " image = cv.LoadImage(fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99669:Assign_L9_C4", "label": "image_gray = CreateImage()", "type": "assigned_variable", "loc": [9, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "vector": [14, 1, 0.3333, 0.037, 1, 0.97, 0.2, 411, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "image_gray", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " image_gray = cv.CreateImage((640,480), cv.IPL_DEPTH_8U,1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99669:Expr_L10_C4", "label": "CvtColor()", "type": "expression", "loc": [10, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "vector": [8, 1, 0.3704, 0.037, 1, 0.97, 0.3, 974, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "CvtColor", "arg_names": [], "import_names": [], "rhs_call_name": "CvtColor", "annotation": ""}, "snippet": " cv.CvtColor(image, image_gray, cv.CV_BGR2GRAY)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99669:Assign_L12_C4", "label": "star_keypoints = star()", "type": "assigned_variable", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "vector": [14, 1, 0.4444, 0.037, 1, 0.97, 0.4, 736, 3, 1, 0, 0, 904, 10, 1], "semantic": {"name": "star_keypoints", "arg_names": [], "import_names": [], "rhs_call_name": "star", "annotation": ""}, "snippet": " star_keypoints = fea.star(image) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99669:Assign_L13_C4", "label": "surf_keypoints, surf_descriptors = surf()", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "vector": [14, 1, 0.4815, 0.037, 1, 0.97, 0.5, 490, 3, 1, 0, 0, 181, 10, 1], "semantic": {"name": "surf_keypoints, surf_descriptors", "arg_names": [], "import_names": [], "rhs_call_name": "surf", "annotation": ""}, "snippet": " surf_keypoints, surf_descriptors = fea.surf(image_gray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99669:Assign_L14_C4", "label": "harris_keypoints = harris()", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "vector": [14, 1, 0.5185, 0.037, 1, 0.97, 0.6, 115, 3, 1, 0, 0, 916, 10, 1], "semantic": {"name": "harris_keypoints", "arg_names": [], "import_names": [], "rhs_call_name": "harris", "annotation": ""}, "snippet": " harris_keypoints = fea.harris(image_gray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99669:Expr_L16_C4", "label": "NamedWindow()", "type": "expression", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "vector": [8, 1, 0.5926, 0.037, 1, 0.97, 0.7, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow('surf', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99669:Expr_L17_C4", "label": "NamedWindow()", "type": "expression", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "vector": [8, 1, 0.6296, 0.037, 1, 0.97, 0.8, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow('harris', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99669:Expr_L18_C4", "label": "NamedWindow()", "type": "expression", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "vector": [8, 1, 0.6667, 0.037, 1, 0.97, 0.9, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow('star', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99669:While_L19_C4", "label": "while", "type": "while", "loc": [19, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "vector": [5, 1, 0.8148, 0.2593, 1, 0.97, 1.0, 0, 1, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True:\n cv.ShowImage('surf', fea.draw_surf(image, surf_keypoints, (255, 0, 0)))\n cv.ShowImage('harris', fea.draw_harris(image, harris_keypoints, (0, 255, 0)))\n cv.ShowImage('star', fea.draw_star(image, star_keypoints, (0, 0, 255)))\n k = cv.WaitKey(33)\n if k == 27:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99669:Expr_L20_C8", "label": "ShowImage()", "type": "expression", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99669:While_L19_C4", "vector": [8, 2, 0.7407, 0.037, 2, 0.78, 0.0, 896, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage('surf', fea.draw_surf(image, surf_keypoints, (255, 0, 0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99669:Expr_L21_C8", "label": "ShowImage()", "type": "expression", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99669:While_L19_C4", "vector": [8, 2, 0.7778, 0.037, 2, 0.78, 0.25, 896, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage('harris', fea.draw_harris(image, harris_keypoints, (0, 255, 0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99669:Expr_L22_C8", "label": "ShowImage()", "type": "expression", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99669:While_L19_C4", "vector": [8, 2, 0.8148, 0.037, 2, 0.78, 0.5, 896, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage('star', fea.draw_star(image, star_keypoints, (0, 0, 255)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99669:Assign_L23_C8", "label": "k = WaitKey()", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99669:While_L19_C4", "vector": [14, 2, 0.8519, 0.037, 2, 0.78, 0.75, 954, 3, 1, 0, 0, 885, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " k = cv.WaitKey(33)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L24_C8", "label": "if", "type": "if", "loc": [24, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99669:While_L19_C4", "vector": [4, 2, 0.9074, 0.0741, 2, 0.78, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if k == 27:\n break"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99669:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99669:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99669:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99669:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99669:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99669:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99669:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99669:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99669:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99669:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99669:While_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99669:While_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99669:Expr_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99669:While_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99669:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99669:While_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99669:Expr_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99669:While_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99669:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99669:While_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99669:If_L24_C8"}]
import roslib; roslib.load_manifest('hai_sandbox') import rospy import hrl_lib.util as ut import csv import scipy.spatial as sp import hrl_camera.ros_camera as cam import hai_sandbox.features as fea import numpy as np import cv import hrl_lib.rutils as ru from cv_bridge.cv_bridge import CvBridge, CvBridgeError import scipy.cluster.vq as vq def csv_bag_names(fname): csv_file = open(fname) for bag_name in csv.reader(csv_file): yield bag_name csv_file.close() def features_mat_compress(fmat, k): #k = max(int(round(fmat.shape[1] * percent)), 1) rospy.loginfo('compressing to %d centers' % k) center_indices = np.random.permutation(fmat.shape[1])[0:k] initial_centers = fmat[:, center_indices] kresults = vq.kmeans(np.array(fmat.T), np.array(initial_centers.T)) return np.matrix(kresults[0]).T if __name__ == '__main__': import sys import pdb features_file = sys.argv[1] images_file = sys.argv[2] features_db = np.column_stack([ut.load_pickle(p[0]) for p in csv_bag_names(features_file)]) features_db_reduced = features_mat_compress(features_db, 500) #Generate a random color for each feature colors = np.matrix(np.random.randint(0, 255, (3, features_db_reduced.shape[1]))) features_tree = sp.KDTree(np.array(features_db_reduced.T)) bridge = CvBridge() forearm_cam_l = '/l_forearm_cam/image_rect_color' cv.NamedWindow('surf', 1) #import pdb #while not rospy.is_shutdown(): i = 0 for topic, msg, t in ru.bag_iter(images_file, [forearm_cam_l]): image = bridge.imgmsg_to_cv(msg, 'bgr8') #image = camera.get_frame() image_gray = fea.grayscale(image) surf_keypoints, surf_descriptors = fea.surf(image_gray) #print len(surf_keypoints) #pdb.set_trace() #match each keypoint with one in our db & look up color matching_idx = [features_tree.query(d)[1] for d in surf_descriptors] coordinated_colors = colors[:, matching_idx] #nimage = fea.draw_surf(image, surf_keypoints, (0,255,0)) nimage = fea.draw_surf2(image, surf_keypoints, coordinated_colors) cv.ShowImage('surf', nimage) cv.SaveImage('forearm_cam%d.png' % i, nimage) i = i + 1 cv.WaitKey(10) #rospy.init_node('test11') #camera = cam.ROSImageClient(forearm_cam_l)
ajibawa-2023/Python-Code-Large/train/row_99670
48
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_99670:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0139, 0.0139, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0139, 0.0139, 0, 0.66, 0.0667, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0278, 0.0139, 0, 0.66, 0.1333, 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_99670:Import_L3_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.0139, 0, 0.66, 0.2, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Import_L4_C0", "label": "csv import csv", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0556, 0.0139, 0, 0.66, 0.2667, 312, 0, 1, 0, 0, 312, 0, 0], "semantic": {"name": "csv", "arg_names": [], "import_names": ["csv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import csv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Import_L5_C0", "label": "scipy.spatial import sp", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0694, 0.0139, 0, 0.66, 0.3333, 384, 0, 1, 0, 0, 384, 0, 0], "semantic": {"name": "scipy.spatial", "arg_names": [], "import_names": ["sp"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.spatial as sp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Import_L6_C0", "label": "hrl_camera.ros_camera import cam", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0139, 0, 0.66, 0.4, 798, 0, 1, 0, 0, 798, 0, 0], "semantic": {"name": "hrl_camera.ros_camera", "arg_names": [], "import_names": ["cam"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_camera.ros_camera as cam"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Import_L7_C0", "label": "hai_sandbox.features import fea", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0972, 0.0139, 0, 0.66, 0.4667, 673, 0, 1, 0, 0, 673, 0, 0], "semantic": {"name": "hai_sandbox.features", "arg_names": [], "import_names": ["fea"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hai_sandbox.features as fea"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Import_L8_C0", "label": "numpy import np", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.0139, 0, 0.66, 0.5333, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Import_L9_C0", "label": "cv import cv", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.0139, 0, 0.66, 0.6, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Import_L10_C0", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1389, 0.0139, 0, 0.66, 0.6667, 847, 0, 1, 0, 0, 847, 0, 0], "semantic": {"name": "hrl_lib.rutils", "arg_names": [], "import_names": ["ru"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.rutils as ru"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:ImportFrom_L11_C0", "label": "from cv_bridge.cv_bridge import CvBridge, CvBridgeError", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1528, 0.0139, 0, 0.66, 0.7333, 356, 0, 2, 0, 0, 356, 0, 0], "semantic": {"name": "cv_bridge.cv_bridge", "arg_names": [], "import_names": ["CvBridge", "CvBridgeError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from cv_bridge.cv_bridge import CvBridge, CvBridgeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Import_L12_C0", "label": "scipy.cluster.vq import vq", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.0139, 0, 0.66, 0.8, 67, 0, 1, 0, 0, 67, 0, 0], "semantic": {"name": "scipy.cluster.vq", "arg_names": [], "import_names": ["vq"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.cluster.vq as vq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:FunctionDef_L14_C0", "label": "csv_bag_names", "type": "function", "loc": [14, 18], "level": 0, "parent": null, "vector": [2, 0, 0.2222, 0.0694, 0, 0.66, 0.8667, 898, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "csv_bag_names", "arg_names": ["fname"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def csv_bag_names(fname):\n csv_file = open(fname)\n for bag_name in csv.reader(csv_file):\n yield bag_name\n csv_file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L15_C4", "label": "csv_file = open()", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:FunctionDef_L14_C0", "vector": [14, 1, 0.2083, 0.0139, 1, 0.68, 0.0, 661, 3, 1, 0, 0, 693, 10, 1], "semantic": {"name": "csv_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " csv_file = open(fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L16_C4", "label": "for bag_name", "type": "for", "loc": [16, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:FunctionDef_L14_C0", "vector": [6, 1, 0.2292, 0.0278, 1, 0.68, 0.5, 985, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bag_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for bag_name in csv.reader(csv_file):\n yield bag_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Expr_L17_C8", "label": "expression", "type": "expression", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L16_C4", "vector": [8, 2, 0.2361, 0.0139, 2, 0.29, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield bag_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Expr_L18_C4", "label": "close()", "type": "expression", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:FunctionDef_L14_C0", "vector": [8, 1, 0.25, 0.0139, 1, 0.68, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " csv_file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:FunctionDef_L20_C0", "label": "features_mat_compress", "type": "function", "loc": [20, 26], "level": 0, "parent": null, "vector": [2, 0, 0.3194, 0.0972, 0, 0.66, 0.9333, 921, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "features_mat_compress", "arg_names": ["fmat", "k"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def features_mat_compress(fmat, k):\n #k = max(int(round(fmat.shape[1] * percent)), 1)\n rospy.loginfo('compressing to %d centers' % k)\n center_indices = np.random.permutation(fmat.shape[1])[0:k]\n initial_centers = fmat[:, center_indices]\n kresults = vq.kmeans(np.array(fmat.T), np.array(initial_centers.T))\n return np.matrix(kresults[0]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Expr_L22_C4", "label": "loginfo()", "type": "expression", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:FunctionDef_L20_C0", "vector": [8, 1, 0.3056, 0.0139, 1, 0.64, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('compressing to %d centers' % k)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L23_C4", "label": "center_indices =", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:FunctionDef_L20_C0", "vector": [14, 1, 0.3194, 0.0139, 1, 0.64, 0.25, 489, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "center_indices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " center_indices = np.random.permutation(fmat.shape[1])[0:k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L24_C4", "label": "initial_centers =", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:FunctionDef_L20_C0", "vector": [14, 1, 0.3333, 0.0139, 1, 0.64, 0.5, 421, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "initial_centers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " initial_centers = fmat[:, center_indices]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L25_C4", "label": "kresults = kmeans()", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:FunctionDef_L20_C0", "vector": [14, 1, 0.3472, 0.0139, 1, 0.64, 0.75, 177, 3, 2, 0, 0, 622, 10, 3], "semantic": {"name": "kresults", "arg_names": [], "import_names": [], "rhs_call_name": "kmeans", "annotation": ""}, "snippet": " kresults = vq.kmeans(np.array(fmat.T), np.array(initial_centers.T))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Return_L26_C4", "label": "return", "type": "return", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:FunctionDef_L20_C0", "vector": [13, 1, 0.3611, 0.0139, 1, 0.64, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix(kresults[0]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "label": "if", "type": "if", "loc": [28, 64], "level": 0, "parent": null, "vector": [4, 0, 0.6389, 0.5139, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 19], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import sys\n import pdb\n features_file = sys.argv[1]\n images_file = sys.argv[2]\n features_db = np.column_stack([ut.load_pickle(p[0]) for p in csv_bag_names(features_file)])\n features_db_reduced = features_mat_compress(features_db, 500)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Import_L29_C4", "label": "sys import sys", "type": "import", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "vector": [1, 1, 0.4028, 0.0139, 1, 0.49, 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_99670:Import_L30_C4", "label": "pdb import pdb", "type": "import", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "vector": [1, 1, 0.4167, 0.0139, 1, 0.49, 0.0833, 91, 0, 1, 0, 0, 91, 0, 0], "semantic": {"name": "pdb", "arg_names": [], "import_names": ["pdb"], "rhs_call_name": "", "annotation": ""}, "snippet": " import pdb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L31_C4", "label": "features_file =", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "vector": [14, 1, 0.4306, 0.0139, 1, 0.49, 0.1667, 838, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "features_file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " features_file = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L32_C4", "label": "images_file =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "vector": [14, 1, 0.4444, 0.0139, 1, 0.49, 0.25, 359, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "images_file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " images_file = sys.argv[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L33_C4", "label": "features_db = column_stack()", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "vector": [14, 1, 0.4583, 0.0139, 1, 0.49, 0.3333, 214, 3, 1, 0, 0, 724, 10, 3], "semantic": {"name": "features_db", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " features_db = np.column_stack([ut.load_pickle(p[0]) for p in csv_bag_names(features_file)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L34_C4", "label": "features_db_reduced = features_mat_compress()", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "vector": [14, 1, 0.4722, 0.0139, 1, 0.49, 0.4167, 82, 3, 2, 0, 0, 921, 10, 1], "semantic": {"name": "features_db_reduced", "arg_names": [], "import_names": [], "rhs_call_name": "features_mat_compress", "annotation": ""}, "snippet": " features_db_reduced = features_mat_compress(features_db, 500)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L37_C4", "label": "colors = matrix()", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "vector": [14, 1, 0.5139, 0.0139, 1, 0.49, 0.5, 656, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "colors", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " colors = np.matrix(np.random.randint(0, 255, (3, features_db_reduced.shape[1])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L38_C4", "label": "features_tree = KDTree()", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "vector": [14, 1, 0.5278, 0.0139, 1, 0.49, 0.5833, 728, 3, 1, 0, 0, 940, 10, 2], "semantic": {"name": "features_tree", "arg_names": [], "import_names": [], "rhs_call_name": "KDTree", "annotation": ""}, "snippet": " features_tree = sp.KDTree(np.array(features_db_reduced.T))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L39_C4", "label": "bridge = CvBridge()", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "vector": [14, 1, 0.5417, 0.0139, 1, 0.49, 0.6667, 658, 3, 0, 0, 0, 439, 10, 1], "semantic": {"name": "bridge", "arg_names": [], "import_names": [], "rhs_call_name": "CvBridge", "annotation": ""}, "snippet": " bridge = CvBridge()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L41_C4", "label": "forearm_cam_l =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "vector": [14, 1, 0.5694, 0.0139, 1, 0.49, 0.75, 246, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "forearm_cam_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forearm_cam_l = '/l_forearm_cam/image_rect_color'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Expr_L42_C4", "label": "NamedWindow()", "type": "expression", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "vector": [8, 1, 0.5833, 0.0139, 1, 0.49, 0.8333, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow('surf', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L46_C4", "label": "i =", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "vector": [14, 1, 0.6389, 0.0139, 1, 0.49, 0.9167, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4", "label": "for topic, msg, t", "type": "for", "loc": [47, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "vector": [6, 1, 0.7708, 0.25, 1, 0.49, 1.0, 35, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "topic, msg, t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for topic, msg, t in ru.bag_iter(images_file, [forearm_cam_l]):\n image = bridge.imgmsg_to_cv(msg, 'bgr8')\n #image = camera.get_frame()\n image_gray = fea.grayscale(image)\n surf_keypoints, surf_descriptors = fea.surf(image_gray)\n #print len(surf_keypoints)\n #pdb.set_trace()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L48_C8", "label": "image = imgmsg_to_cv()", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4", "vector": [14, 2, 0.6667, 0.0139, 2, 0.31, 0.0, 505, 3, 2, 0, 0, 181, 10, 1], "semantic": {"name": "image", "arg_names": [], "import_names": [], "rhs_call_name": "imgmsg_to_cv", "annotation": ""}, "snippet": " image = bridge.imgmsg_to_cv(msg, 'bgr8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L50_C8", "label": "image_gray = grayscale()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4", "vector": [14, 2, 0.6944, 0.0139, 2, 0.31, 0.1111, 411, 3, 1, 0, 0, 530, 10, 1], "semantic": {"name": "image_gray", "arg_names": [], "import_names": [], "rhs_call_name": "grayscale", "annotation": ""}, "snippet": " image_gray = fea.grayscale(image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L51_C8", "label": "surf_keypoints, surf_descriptors = surf()", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4", "vector": [14, 2, 0.7083, 0.0139, 2, 0.31, 0.2222, 490, 3, 1, 0, 0, 181, 10, 1], "semantic": {"name": "surf_keypoints, surf_descriptors", "arg_names": [], "import_names": [], "rhs_call_name": "surf", "annotation": ""}, "snippet": " surf_keypoints, surf_descriptors = fea.surf(image_gray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L56_C8", "label": "matching_idx =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4", "vector": [14, 2, 0.7778, 0.0139, 2, 0.31, 0.3333, 325, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "matching_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " matching_idx = [features_tree.query(d)[1] for d in surf_descriptors]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L57_C8", "label": "coordinated_colors =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4", "vector": [14, 2, 0.7917, 0.0139, 2, 0.31, 0.4444, 226, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "coordinated_colors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " coordinated_colors = colors[:, matching_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L60_C8", "label": "nimage = draw_surf2()", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4", "vector": [14, 2, 0.8333, 0.0139, 2, 0.31, 0.5556, 208, 3, 3, 0, 0, 525, 10, 1], "semantic": {"name": "nimage", "arg_names": [], "import_names": [], "rhs_call_name": "draw_surf2", "annotation": ""}, "snippet": " nimage = fea.draw_surf2(image, surf_keypoints, coordinated_colors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Expr_L61_C8", "label": "ShowImage()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4", "vector": [8, 2, 0.8472, 0.0139, 2, 0.31, 0.6667, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage('surf', nimage)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Expr_L62_C8", "label": "SaveImage()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4", "vector": [8, 2, 0.8611, 0.0139, 2, 0.31, 0.7778, 91, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "SaveImage", "arg_names": [], "import_names": [], "rhs_call_name": "SaveImage", "annotation": ""}, "snippet": " cv.SaveImage('forearm_cam%d.png' % i, nimage)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L63_C8", "label": "i =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4", "vector": [14, 2, 0.875, 0.0139, 2, 0.31, 0.8889, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99670:Expr_L64_C8", "label": "WaitKey()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4", "vector": [8, 2, 0.8889, 0.0139, 2, 0.31, 1.0, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "WaitKey", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " cv.WaitKey(10)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99670:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Expr_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Return_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Import_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Import_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Expr_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99670:For_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99670:Expr_L64_C8"}]
import roslib; roslib.load_manifest('hai_sandbox') import rospy import hrl_lib.util as ut import sys if __name__ == '__main__': p = ut.load_pickle(sys.argv[1])
ajibawa-2023/Python-Code-Large/train/row_99671
7
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_99671:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.125, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99671:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.125, 0.125, 0, 0.66, 0.2, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99671:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.125, 0, 0.66, 0.4, 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_99671:Import_L3_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.375, 0.125, 0, 0.66, 0.6, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99671:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.125, 0, 0.66, 0.8, 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_99671:If_L6_C0", "label": "if", "type": "if", "loc": [6, 7], "level": 0, "parent": null, "vector": [4, 0, 0.8125, 0.25, 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 p = ut.load_pickle(sys.argv[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99671:Assign_L7_C4", "label": "p = load_pickle()", "type": "assigned_variable", "loc": [7, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99671:If_L6_C0", "vector": [14, 1, 0.875, 0.125, 1, 0.9, 0.0, 491, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " p = ut.load_pickle(sys.argv[1])"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99671:If_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99671:Assign_L7_C4"}]
import roslib; roslib.load_manifest('hai_sandbox') import cv import numpy as np import scipy.spatial as sp import math class SURFMatcher: def __init__(self): self.model_images = {} self.model_fea = {} def add_file(self, model_name, label): model_img = cv.LoadImage(model_name) self.add_model(model_img, label) def add_model(self, model_img, label): mgray = grayscale(model_img) m_loc, m_desc = surf(mgray) self.model_images[label] = model_img self.model_fea[label] = {'loc': m_loc, 'desc': m_desc} def build_db(self): fea_l = [] labels_l = [] locs_l = [] for k in self.model_fea: fea_l.append(np.array(self.model_fea[k]['desc'])) locs_l.append(np.array(self.model_fea[k]['loc'])) labels_l.append(np.array([k for i in range(len(self.model_fea[k]['desc']))])) self.labels = np.row_stack(labels_l) self.locs = np.row_stack(locs_l) self.tree = sp.KDTree(np.row_stack(fea_l)) def match(self, desc, thres=.6): dists, idxs = self.tree.query(np.array(desc), 2) ratio = dists[0] / dists[1] if ratio < threshold: desc = self.tree.data[idxs[0]] loc = self.locs[idxs[0]] return desc, loc else: return None def concat_images(a, b): img_height = max(a.height, b.height) c = cv.CreateImage((a.width+b.width, img_height), a.depth, a.channels) a_area = cv.GetSubRect(c, (0,0, a.width, a.height)) b_area = cv.GetSubRect(c, (a.width, 0, b.width, b.height)) cv.Add(a, a_area, a_area) cv.Add(b, b_area, b_area) return c def clone(something): if something.__class__ == cv.cvmat: return cv.CloneMat(something) else: return cv.CloneImage(something) def draw_surf(image, keypoints, color): rimage = clone(image) for loc, lap, size, d, hess in keypoints: loc = tuple(np.array(np.round(loc), dtype='int').tolist()) circ_rad = int(round(size/4.)) cv.Circle(rimage, loc, circ_rad, color, 1, cv.CV_AA) cv.Circle(rimage, loc, 2, color, -1, cv.CV_AA) drad = math.radians(d) line_len = circ_rad loc_end = (np.matrix(np.round( circ_rad * np.matrix([np.cos(drad), np.sin(drad)]).T + np.matrix(loc).T), dtype='int')).A1.tolist() cv.Line(rimage, loc, tuple(loc_end), color, thickness=1, lineType=cv.CV_AA) return rimage def draw_surf2(image, keypoints, colors): rimage = clone(image) for i, k in enumerate(keypoints): loc, lap, size, d, hess = k loc = tuple(np.array(np.round(loc), dtype='int').tolist()) c = tuple(np.matrix(colors[:,i],dtype='int').T.A1) color = (int(c[0]), int(c[1]), int(c[2])) #cv.Circle(rimage, loc, int(round(size/2.)), color, 1, cv.CV_AA) cv.Circle(rimage, loc, 5, color, 1, cv.CV_AA) return rimage def draw_harris(image, keypoints, color): rimage = clone(image) for loc in keypoints: loc = tuple(np.array(np.round(loc), dtype='int').tolist()) cv.Circle(rimage, loc, 5, color, 1, cv.CV_AA) return rimage def draw_star(image, keypoints, color): rimage = clone(image) color_arr = np.array(color) max_resp = - 999999 min_resp = 999999 for _, _, response in keypoints: max_resp = max(response, max_resp) min_resp = min(response, min_resp) range_resp = max_resp - min_resp for loc, size, response in keypoints: loc = tuple(np.array(np.round(loc), dtype='int').tolist()) color_weight = ((response - min_resp) / range_resp) c = tuple((color_weight * color_arr).tolist()) cv.Circle(rimage, loc, int(round(size/2.0)), c, 1, cv.CV_AA) return rimage #list of ((x,y), size, response) def star(image): star_stor = cv.CreateMemStorage() star_keypoints = cv.GetStarKeypoints(image, star_stor) #list of ((x,y), size, response) del star_stor return star_keypoints ## # surf_keypoints => keypoints (x,y), laplacian, size, direction , hessian # surf_descriptors => list of len 128 lists def surf(image_gray, params=(1, 3000,3,4)): surf_stor = cv.CreateMemStorage() surf_r = cv.ExtractSURF(image_gray, None, surf_stor, params) del surf_stor return surf_r ## # @param image image # @param params surf params def surf_color(image, params=(1,3000,3,4)): gray = grayscale(image) return surf(gray, params) ## # list of (x, y) def harris(image_gray): eig_image = cv.CreateImage(cv.GetSize(image_gray), cv.IPL_DEPTH_32F, 1) temp_image = cv.CreateImage(cv.GetSize(image_gray), cv.IPL_DEPTH_32F, 1) return cv.GoodFeaturesToTrack(image_gray, eig_image, temp_image, 300, .1, 1.0, useHarris = True) #list of (x,y) def grayscale(image): image_gray = cv.CreateImage(cv.GetSize(image), cv.IPL_DEPTH_8U,1) cv.CvtColor(image, image_gray, cv.CV_BGR2GRAY) return image_gray
ajibawa-2023/Python-Code-Large/train/row_99672
110
143
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.007, 0.007, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.007, 0.007, 0, 0.66, 0.0588, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Import_L2_C0", "label": "cv import cv", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.014, 0.007, 0, 0.66, 0.1176, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.021, 0.007, 0, 0.66, 0.1765, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Import_L4_C0", "label": "scipy.spatial import sp", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.028, 0.007, 0, 0.66, 0.2353, 384, 0, 1, 0, 0, 384, 0, 0], "semantic": {"name": "scipy.spatial", "arg_names": [], "import_names": ["sp"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.spatial as sp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Import_L5_C0", "label": "math import math", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.035, 0.007, 0, 0.66, 0.2941, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:ClassDef_L7_C0", "label": "SURFMatcher", "type": "class", "loc": [7, 43], "level": 0, "parent": null, "vector": [3, 0, 0.1748, 0.2587, 0, 0.66, 0.3529, 230, 0, 5, 0, 0, 0, 0, 18], "semantic": {"name": "SURFMatcher", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SURFMatcher:\n def __init__(self):\n self.model_images = {}\n self.model_fea = {}\n\n def add_file(self, model_name, label): \n model_img = cv.LoadImage(model_name)\n self.add_model(model_img, label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L8_C4", "label": "__init__", "type": "function", "loc": [8, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:ClassDef_L7_C0", "vector": [2, 1, 0.0629, 0.021, 1, 0.14, 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.model_images = {}\n self.model_fea = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L9_C8", "label": "self.model_images =", "type": "assigned_variable", "loc": [9, 9], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L8_C4", "vector": [14, 2, 0.0629, 0.007, 2, 0.54, 0.0, 202, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.model_images", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.model_images = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L10_C8", "label": "self.model_fea =", "type": "assigned_variable", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L8_C4", "vector": [14, 2, 0.0699, 0.007, 2, 0.54, 1.0, 55, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.model_fea", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.model_fea = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L12_C4", "label": "add_file", "type": "function", "loc": [12, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:ClassDef_L7_C0", "vector": [2, 1, 0.0909, 0.021, 1, 0.14, 0.25, 369, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add_file", "arg_names": ["self", "model_name", "label"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_file(self, model_name, label): \n model_img = cv.LoadImage(model_name)\n self.add_model(model_img, label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L13_C8", "label": "model_img = LoadImage()", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L12_C4", "vector": [14, 2, 0.0909, 0.007, 2, 0.77, 0.0, 618, 3, 1, 0, 0, 512, 10, 1], "semantic": {"name": "model_img", "arg_names": [], "import_names": [], "rhs_call_name": "LoadImage", "annotation": ""}, "snippet": " model_img = cv.LoadImage(model_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L14_C8", "label": "add_model()", "type": "expression", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L12_C4", "vector": [8, 2, 0.0979, 0.007, 2, 0.77, 1.0, 591, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_model", "arg_names": [], "import_names": [], "rhs_call_name": "add_model", "annotation": ""}, "snippet": " self.add_model(model_img, label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L16_C4", "label": "add_model", "type": "function", "loc": [16, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:ClassDef_L7_C0", "vector": [2, 1, 0.1259, 0.035, 1, 0.14, 0.5, 591, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add_model", "arg_names": ["self", "model_img", "label"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_model(self, model_img, label):\n mgray = grayscale(model_img)\n m_loc, m_desc = surf(mgray)\n self.model_images[label] = model_img\n self.model_fea[label] = {'loc': m_loc, 'desc': m_desc}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L17_C8", "label": "mgray = grayscale()", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L16_C4", "vector": [14, 2, 0.1189, 0.007, 2, 0.55, 0.0, 405, 3, 1, 0, 0, 530, 10, 1], "semantic": {"name": "mgray", "arg_names": [], "import_names": [], "rhs_call_name": "grayscale", "annotation": ""}, "snippet": " mgray = grayscale(model_img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L18_C8", "label": "m_loc, m_desc = surf()", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L16_C4", "vector": [14, 2, 0.1259, 0.007, 2, 0.55, 0.3333, 265, 3, 1, 0, 0, 181, 10, 1], "semantic": {"name": "m_loc, m_desc", "arg_names": [], "import_names": [], "rhs_call_name": "surf", "annotation": ""}, "snippet": " m_loc, m_desc = surf(mgray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L19_C8", "label": "assign", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L16_C4", "vector": [14, 2, 0.1329, 0.007, 2, 0.55, 0.6667, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.model_images[label] = model_img"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L20_C8", "label": "assign", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L16_C4", "vector": [14, 2, 0.1399, 0.007, 2, 0.55, 1.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.model_fea[label] = {'loc': m_loc, 'desc': m_desc}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L22_C4", "label": "build_db", "type": "function", "loc": [22, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:ClassDef_L7_C0", "vector": [2, 1, 0.1923, 0.0839, 1, 0.14, 0.75, 494, 0, 1, 0, 0, 0, 0, 12], "semantic": {"name": "build_db", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def build_db(self):\n fea_l = []\n labels_l = []\n locs_l = []\n for k in self.model_fea:\n fea_l.append(np.array(self.model_fea[k]['desc']))\n locs_l.append(np.array(self.model_fea[k]['loc']))\n labels_l.append(np.array([k for i in range(len(self.model_fea[k]['desc']))]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L23_C8", "label": "fea_l =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L22_C4", "vector": [14, 2, 0.1608, 0.007, 2, 0.28, 0.0, 96, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "fea_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fea_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L24_C8", "label": "labels_l =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L22_C4", "vector": [14, 2, 0.1678, 0.007, 2, 0.28, 0.1667, 28, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "labels_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labels_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L25_C8", "label": "locs_l =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L22_C4", "vector": [14, 2, 0.1748, 0.007, 2, 0.28, 0.3333, 989, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "locs_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " locs_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L26_C8", "label": "for k", "type": "for", "loc": [26, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L22_C4", "vector": [6, 2, 0.1923, 0.028, 2, 0.28, 0.5, 954, 7, 0, 0, 0, 0, 0, 8], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in self.model_fea:\n fea_l.append(np.array(self.model_fea[k]['desc']))\n locs_l.append(np.array(self.model_fea[k]['loc']))\n labels_l.append(np.array([k for i in range(len(self.model_fea[k]['desc']))]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L27_C12", "label": "append()", "type": "expression", "loc": [27, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L26_C8", "vector": [8, 3, 0.1888, 0.007, 3, 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": " fea_l.append(np.array(self.model_fea[k]['desc']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L28_C12", "label": "append()", "type": "expression", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L26_C8", "vector": [8, 3, 0.1958, 0.007, 3, 0.9, 0.5, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " locs_l.append(np.array(self.model_fea[k]['loc']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L29_C12", "label": "append()", "type": "expression", "loc": [29, 29], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L26_C8", "vector": [8, 3, 0.2028, 0.007, 3, 0.9, 1.0, 243, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " labels_l.append(np.array([k for i in range(len(self.model_fea[k]['desc']))]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L31_C8", "label": "self.labels = row_stack()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L22_C4", "vector": [14, 2, 0.2168, 0.007, 2, 0.28, 0.6667, 922, 3, 1, 0, 0, 612, 10, 1], "semantic": {"name": "self.labels", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " self.labels = np.row_stack(labels_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L32_C8", "label": "self.locs = row_stack()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L22_C4", "vector": [14, 2, 0.2238, 0.007, 2, 0.28, 0.8333, 935, 3, 1, 0, 0, 612, 10, 1], "semantic": {"name": "self.locs", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " self.locs = np.row_stack(locs_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L33_C8", "label": "self.tree = KDTree()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L22_C4", "vector": [14, 2, 0.2308, 0.007, 2, 0.28, 1.0, 180, 3, 1, 0, 0, 940, 10, 2], "semantic": {"name": "self.tree", "arg_names": [], "import_names": [], "rhs_call_name": "KDTree", "annotation": ""}, "snippet": " self.tree = sp.KDTree(np.row_stack(fea_l))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L35_C4", "label": "match", "type": "function", "loc": [35, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:ClassDef_L7_C0", "vector": [2, 1, 0.2727, 0.0629, 1, 0.14, 1.0, 36, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "match", "arg_names": ["self", "desc", "thres"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def match(self, desc, thres=.6):\n dists, idxs = self.tree.query(np.array(desc), 2)\n ratio = dists[0] / dists[1]\n if ratio < threshold:\n desc = self.tree.data[idxs[0]]\n loc = self.locs[idxs[0]]\n return desc, loc\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L36_C8", "label": "dists, idxs = query()", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L35_C4", "vector": [14, 2, 0.2517, 0.007, 2, 0.63, 0.0, 956, 3, 2, 0, 0, 546, 10, 2], "semantic": {"name": "dists, idxs", "arg_names": [], "import_names": [], "rhs_call_name": "query", "annotation": ""}, "snippet": " dists, idxs = self.tree.query(np.array(desc), 2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L37_C8", "label": "ratio =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L35_C4", "vector": [14, 2, 0.2587, 0.007, 2, 0.63, 0.5, 188, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ratio", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ratio = dists[0] / dists[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:If_L38_C8", "label": "if", "type": "if", "loc": [38, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L35_C4", "vector": [4, 2, 0.2832, 0.042, 2, 0.63, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ratio < threshold:\n desc = self.tree.data[idxs[0]]\n loc = self.locs[idxs[0]]\n return desc, loc\n else:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L39_C12", "label": "desc =", "type": "assigned_variable", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:If_L38_C8", "vector": [14, 3, 0.2727, 0.007, 3, 0.5, 0.0, 796, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "desc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " desc = self.tree.data[idxs[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L40_C12", "label": "loc =", "type": "assigned_variable", "loc": [40, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:If_L38_C8", "vector": [14, 3, 0.2797, 0.007, 3, 0.5, 0.3333, 822, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "loc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " loc = self.locs[idxs[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L41_C12", "label": "return", "type": "return", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:If_L38_C8", "vector": [13, 3, 0.2867, 0.007, 3, 0.5, 0.6667, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return desc, loc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L43_C12", "label": "return", "type": "return", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:If_L38_C8", "vector": [13, 3, 0.3007, 0.007, 3, 0.5, 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_99672:FunctionDef_L45_C0", "label": "concat_images", "type": "function", "loc": [45, 52], "level": 0, "parent": null, "vector": [2, 0, 0.3392, 0.0559, 0, 0.66, 0.4118, 854, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "concat_images", "arg_names": ["a", "b"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def concat_images(a, b):\n img_height = max(a.height, b.height)\n c = cv.CreateImage((a.width+b.width, img_height), a.depth, a.channels)\n a_area = cv.GetSubRect(c, (0,0, a.width, a.height))\n b_area = cv.GetSubRect(c, (a.width, 0, b.width, b.height))\n cv.Add(a, a_area, a_area)\n cv.Add(b, b_area, b_area)\n return c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L46_C4", "label": "img_height = max()", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L45_C0", "vector": [14, 1, 0.3217, 0.007, 1, 0.34, 0.0, 53, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "img_height", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " img_height = max(a.height, b.height)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L47_C4", "label": "c = CreateImage()", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L45_C0", "vector": [14, 1, 0.3287, 0.007, 1, 0.34, 0.1667, 411, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " c = cv.CreateImage((a.width+b.width, img_height), a.depth, a.channels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L48_C4", "label": "a_area = GetSubRect()", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L45_C0", "vector": [14, 1, 0.3357, 0.007, 1, 0.34, 0.3333, 720, 3, 2, 0, 0, 469, 10, 1], "semantic": {"name": "a_area", "arg_names": [], "import_names": [], "rhs_call_name": "GetSubRect", "annotation": ""}, "snippet": " a_area = cv.GetSubRect(c, (0,0, a.width, a.height))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L49_C4", "label": "b_area = GetSubRect()", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L45_C0", "vector": [14, 1, 0.3427, 0.007, 1, 0.34, 0.5, 142, 3, 2, 0, 0, 469, 10, 1], "semantic": {"name": "b_area", "arg_names": [], "import_names": [], "rhs_call_name": "GetSubRect", "annotation": ""}, "snippet": " b_area = cv.GetSubRect(c, (a.width, 0, b.width, b.height))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L50_C4", "label": "Add()", "type": "expression", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L45_C0", "vector": [8, 1, 0.3497, 0.007, 1, 0.34, 0.6667, 241, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Add", "arg_names": [], "import_names": [], "rhs_call_name": "Add", "annotation": ""}, "snippet": " cv.Add(a, a_area, a_area)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L51_C4", "label": "Add()", "type": "expression", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L45_C0", "vector": [8, 1, 0.3566, 0.007, 1, 0.34, 0.8333, 241, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Add", "arg_names": [], "import_names": [], "rhs_call_name": "Add", "annotation": ""}, "snippet": " cv.Add(b, b_area, b_area)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L52_C4", "label": "return", "type": "return", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L45_C0", "vector": [13, 1, 0.3636, 0.007, 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 c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L54_C0", "label": "clone", "type": "function", "loc": [54, 58], "level": 0, "parent": null, "vector": [2, 0, 0.3916, 0.035, 0, 0.66, 0.4706, 911, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "clone", "arg_names": ["something"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def clone(something):\n if something.__class__ == cv.cvmat:\n return cv.CloneMat(something)\n else:\n return cv.CloneImage(something)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:If_L55_C4", "label": "if", "type": "if", "loc": [55, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L54_C0", "vector": [4, 1, 0.3951, 0.028, 1, 0.43, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if something.__class__ == cv.cvmat:\n return cv.CloneMat(something)\n else:\n return cv.CloneImage(something)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L56_C8", "label": "return", "type": "return", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:If_L55_C4", "vector": [13, 2, 0.3916, 0.007, 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 cv.CloneMat(something)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L58_C8", "label": "return", "type": "return", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:If_L55_C4", "vector": [13, 2, 0.4056, 0.007, 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 cv.CloneImage(something)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L60_C0", "label": "draw_surf", "type": "function", "loc": [60, 74], "level": 0, "parent": null, "vector": [2, 0, 0.4685, 0.1049, 0, 0.66, 0.5294, 124, 0, 3, 1, 0, 0, 0, 19], "semantic": {"name": "draw_surf", "arg_names": ["image", "keypoints", "color"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def draw_surf(image, keypoints, color):\n rimage = clone(image)\n\n for loc, lap, size, d, hess in keypoints:\n loc = tuple(np.array(np.round(loc), dtype='int').tolist())\n circ_rad = int(round(size/4.))\n cv.Circle(rimage, loc, circ_rad, color, 1, cv.CV_AA)\n cv.Circle(rimage, loc, 2, color, -1, cv.CV_AA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L61_C4", "label": "rimage = clone()", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L60_C0", "vector": [14, 1, 0.4266, 0.007, 1, 0.64, 0.0, 953, 3, 1, 0, 0, 911, 10, 1], "semantic": {"name": "rimage", "arg_names": [], "import_names": [], "rhs_call_name": "clone", "annotation": ""}, "snippet": " rimage = clone(image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L63_C4", "label": "for loc, lap, size, d, hess", "type": "for", "loc": [63, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L60_C0", "vector": [6, 1, 0.472, 0.0699, 1, 0.64, 0.5, 813, 2, 0, 0, 0, 0, 0, 18], "semantic": {"name": "loc, lap, size, d, hess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for loc, lap, size, d, hess in keypoints:\n loc = tuple(np.array(np.round(loc), dtype='int').tolist())\n circ_rad = int(round(size/4.))\n cv.Circle(rimage, loc, circ_rad, color, 1, cv.CV_AA)\n cv.Circle(rimage, loc, 2, color, -1, cv.CV_AA)\n\n drad = math.radians(d)\n line_len = circ_rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L64_C8", "label": "loc = tuple()", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L63_C4", "vector": [14, 2, 0.4476, 0.007, 2, 0.27, 0.0, 822, 3, 1, 0, 0, 259, 10, 4], "semantic": {"name": "loc", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": " loc = tuple(np.array(np.round(loc), dtype='int').tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L65_C8", "label": "circ_rad = int()", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L63_C4", "vector": [14, 2, 0.4545, 0.007, 2, 0.27, 0.1429, 146, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "circ_rad", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " circ_rad = int(round(size/4.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L66_C8", "label": "Circle()", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L63_C4", "vector": [8, 2, 0.4615, 0.007, 2, 0.27, 0.2857, 780, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "Circle", "arg_names": [], "import_names": [], "rhs_call_name": "Circle", "annotation": ""}, "snippet": " cv.Circle(rimage, loc, circ_rad, color, 1, cv.CV_AA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L67_C8", "label": "Circle()", "type": "expression", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L63_C4", "vector": [8, 2, 0.4685, 0.007, 2, 0.27, 0.4286, 780, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "Circle", "arg_names": [], "import_names": [], "rhs_call_name": "Circle", "annotation": ""}, "snippet": " cv.Circle(rimage, loc, 2, color, -1, cv.CV_AA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L69_C8", "label": "drad = radians()", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L63_C4", "vector": [14, 2, 0.4825, 0.007, 2, 0.27, 0.5714, 451, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "drad", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " drad = math.radians(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L70_C8", "label": "line_len =", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L63_C4", "vector": [14, 2, 0.4895, 0.007, 2, 0.27, 0.7143, 734, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "line_len", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " line_len = circ_rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L71_C8", "label": "loc_end = tolist()", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L63_C4", "vector": [14, 2, 0.4965, 0.007, 2, 0.27, 0.8571, 71, 3, 0, 0, 0, 185, 10, 7], "semantic": {"name": "loc_end", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " loc_end = (np.matrix(np.round( circ_rad * np.matrix([np.cos(drad), np.sin(drad)]).T + np.matrix(loc).T), dtype='int')).A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L72_C8", "label": "Line()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L63_C4", "vector": [8, 2, 0.5035, 0.007, 2, 0.27, 1.0, 650, 3, 6, 0, 0, 0, 0, 2], "semantic": {"name": "Line", "arg_names": [], "import_names": [], "rhs_call_name": "Line", "annotation": ""}, "snippet": " cv.Line(rimage, loc, tuple(loc_end), color, thickness=1, lineType=cv.CV_AA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L74_C4", "label": "return", "type": "return", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L60_C0", "vector": [13, 1, 0.5175, 0.007, 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 rimage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L76_C0", "label": "draw_surf2", "type": "function", "loc": [76, 85], "level": 0, "parent": null, "vector": [2, 0, 0.5629, 0.0699, 0, 0.66, 0.5882, 525, 0, 3, 1, 0, 0, 0, 12], "semantic": {"name": "draw_surf2", "arg_names": ["image", "keypoints", "colors"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def draw_surf2(image, keypoints, colors):\n rimage = clone(image)\n for i, k in enumerate(keypoints):\n loc, lap, size, d, hess = k \n loc = tuple(np.array(np.round(loc), dtype='int').tolist())\n c = tuple(np.matrix(colors[:,i],dtype='int').T.A1)\n color = (int(c[0]), int(c[1]), int(c[2]))\n #cv.Circle(rimage, loc, int(round(size/2.)), color, 1, cv.CV_AA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L77_C4", "label": "rimage = clone()", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L76_C0", "vector": [14, 1, 0.5385, 0.007, 1, 0.18, 0.0, 953, 3, 1, 0, 0, 911, 10, 1], "semantic": {"name": "rimage", "arg_names": [], "import_names": [], "rhs_call_name": "clone", "annotation": ""}, "snippet": " rimage = clone(image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L78_C4", "label": "for i, k", "type": "for", "loc": [78, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L76_C0", "vector": [6, 1, 0.5664, 0.049, 1, 0.18, 0.5, 992, 3, 0, 0, 0, 0, 0, 11], "semantic": {"name": "i, k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, k in enumerate(keypoints):\n loc, lap, size, d, hess = k \n loc = tuple(np.array(np.round(loc), dtype='int').tolist())\n c = tuple(np.matrix(colors[:,i],dtype='int').T.A1)\n color = (int(c[0]), int(c[1]), int(c[2]))\n #cv.Circle(rimage, loc, int(round(size/2.)), color, 1, cv.CV_AA)\n cv.Circle(rimage, loc, 5, color, 1, cv.CV_AA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L79_C8", "label": "loc, lap, size, d, hess =", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L78_C4", "vector": [14, 2, 0.5524, 0.007, 2, 0.91, 0.0, 813, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "loc, lap, size, d, hess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " loc, lap, size, d, hess = k "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L80_C8", "label": "loc = tuple()", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L78_C4", "vector": [14, 2, 0.5594, 0.007, 2, 0.91, 0.25, 822, 3, 1, 0, 0, 259, 10, 4], "semantic": {"name": "loc", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": " loc = tuple(np.array(np.round(loc), dtype='int').tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L81_C8", "label": "c = tuple()", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L78_C4", "vector": [14, 2, 0.5664, 0.007, 2, 0.91, 0.5, 411, 3, 1, 0, 0, 259, 10, 2], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": " c = tuple(np.matrix(colors[:,i],dtype='int').T.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L82_C8", "label": "color =", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L78_C4", "vector": [14, 2, 0.5734, 0.007, 2, 0.91, 0.75, 776, 0, 0, 0, 0, 0, 8, 3], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " color = (int(c[0]), int(c[1]), int(c[2]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L84_C8", "label": "Circle()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L78_C4", "vector": [8, 2, 0.5874, 0.007, 2, 0.91, 1.0, 780, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "Circle", "arg_names": [], "import_names": [], "rhs_call_name": "Circle", "annotation": ""}, "snippet": " cv.Circle(rimage, loc, 5, color, 1, cv.CV_AA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L85_C4", "label": "return", "type": "return", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L76_C0", "vector": [13, 1, 0.5944, 0.007, 1, 0.18, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rimage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L87_C0", "label": "draw_harris", "type": "function", "loc": [87, 92], "level": 0, "parent": null, "vector": [2, 0, 0.6259, 0.042, 0, 0.66, 0.6471, 655, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "draw_harris", "arg_names": ["image", "keypoints", "color"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def draw_harris(image, keypoints, color):\n rimage = clone(image)\n for loc in keypoints:\n loc = tuple(np.array(np.round(loc), dtype='int').tolist())\n cv.Circle(rimage, loc, 5, color, 1, cv.CV_AA)\n return rimage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L88_C4", "label": "rimage = clone()", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L87_C0", "vector": [14, 1, 0.6154, 0.007, 1, 0.29, 0.0, 953, 3, 1, 0, 0, 911, 10, 1], "semantic": {"name": "rimage", "arg_names": [], "import_names": [], "rhs_call_name": "clone", "annotation": ""}, "snippet": " rimage = clone(image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L89_C4", "label": "for loc", "type": "for", "loc": [89, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L87_C0", "vector": [6, 1, 0.6294, 0.021, 1, 0.29, 0.5, 822, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "loc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for loc in keypoints:\n loc = tuple(np.array(np.round(loc), dtype='int').tolist())\n cv.Circle(rimage, loc, 5, color, 1, cv.CV_AA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L90_C8", "label": "loc = tuple()", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L89_C4", "vector": [14, 2, 0.6294, 0.007, 2, 0.35, 0.0, 822, 3, 1, 0, 0, 259, 10, 4], "semantic": {"name": "loc", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": " loc = tuple(np.array(np.round(loc), dtype='int').tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L91_C8", "label": "Circle()", "type": "expression", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L89_C4", "vector": [8, 2, 0.6364, 0.007, 2, 0.35, 1.0, 780, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "Circle", "arg_names": [], "import_names": [], "rhs_call_name": "Circle", "annotation": ""}, "snippet": " cv.Circle(rimage, loc, 5, color, 1, cv.CV_AA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L92_C4", "label": "return", "type": "return", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L87_C0", "vector": [13, 1, 0.6434, 0.007, 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 rimage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L94_C0", "label": "draw_star", "type": "function", "loc": [94, 109], "level": 0, "parent": null, "vector": [2, 0, 0.7098, 0.1119, 0, 0.66, 0.7059, 577, 0, 3, 1, 0, 0, 0, 13], "semantic": {"name": "draw_star", "arg_names": ["image", "keypoints", "color"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def draw_star(image, keypoints, color):\n rimage = clone(image)\n color_arr = np.array(color)\n max_resp = - 999999\n min_resp = 999999\n for _, _, response in keypoints:\n max_resp = max(response, max_resp)\n min_resp = min(response, min_resp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L95_C4", "label": "rimage = clone()", "type": "assigned_variable", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L94_C0", "vector": [14, 1, 0.6643, 0.007, 1, 0.27, 0.0, 953, 3, 1, 0, 0, 911, 10, 1], "semantic": {"name": "rimage", "arg_names": [], "import_names": [], "rhs_call_name": "clone", "annotation": ""}, "snippet": " rimage = clone(image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L96_C4", "label": "color_arr = array()", "type": "assigned_variable", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L94_C0", "vector": [14, 1, 0.6713, 0.007, 1, 0.27, 0.1429, 862, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "color_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " color_arr = np.array(color)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L97_C4", "label": "max_resp =", "type": "assigned_variable", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L94_C0", "vector": [14, 1, 0.6783, 0.007, 1, 0.27, 0.2857, 192, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_resp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_resp = - 999999"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L98_C4", "label": "min_resp =", "type": "assigned_variable", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L94_C0", "vector": [14, 1, 0.6853, 0.007, 1, 0.27, 0.4286, 59, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "min_resp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_resp = 999999"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L99_C4", "label": "for _, _, response", "type": "for", "loc": [99, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L94_C0", "vector": [6, 1, 0.6993, 0.021, 1, 0.27, 0.5714, 422, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "_, _, response", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for _, _, response in keypoints:\n max_resp = max(response, max_resp)\n min_resp = min(response, min_resp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L100_C8", "label": "max_resp = max()", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L99_C4", "vector": [14, 2, 0.6993, 0.007, 2, 0.87, 0.0, 192, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "max_resp", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_resp = max(response, max_resp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L101_C8", "label": "min_resp = min()", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L99_C4", "vector": [14, 2, 0.7063, 0.007, 2, 0.87, 1.0, 59, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "min_resp", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " min_resp = min(response, min_resp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L102_C4", "label": "range_resp =", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L94_C0", "vector": [14, 1, 0.7133, 0.007, 1, 0.27, 0.7143, 910, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "range_resp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " range_resp = max_resp - min_resp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L104_C4", "label": "for loc, size, response", "type": "for", "loc": [104, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L94_C0", "vector": [6, 1, 0.7413, 0.035, 1, 0.27, 0.8571, 507, 2, 0, 0, 0, 0, 0, 9], "semantic": {"name": "loc, size, response", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for loc, size, response in keypoints:\n loc = tuple(np.array(np.round(loc), dtype='int').tolist())\n color_weight = ((response - min_resp) / range_resp)\n c = tuple((color_weight * color_arr).tolist())\n cv.Circle(rimage, loc, int(round(size/2.0)), c, 1, cv.CV_AA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L105_C8", "label": "loc = tuple()", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L104_C4", "vector": [14, 2, 0.7343, 0.007, 2, 0.58, 0.0, 822, 3, 1, 0, 0, 259, 10, 4], "semantic": {"name": "loc", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": " loc = tuple(np.array(np.round(loc), dtype='int').tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L106_C8", "label": "color_weight =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L104_C4", "vector": [14, 2, 0.7413, 0.007, 2, 0.58, 0.3333, 467, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "color_weight", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " color_weight = ((response - min_resp) / range_resp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L107_C8", "label": "c = tuple()", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L104_C4", "vector": [14, 2, 0.7483, 0.007, 2, 0.58, 0.6667, 411, 3, 1, 0, 0, 259, 10, 2], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": " c = tuple((color_weight * color_arr).tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L108_C8", "label": "Circle()", "type": "expression", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L104_C4", "vector": [8, 2, 0.7552, 0.007, 2, 0.58, 1.0, 780, 3, 6, 0, 0, 0, 0, 3], "semantic": {"name": "Circle", "arg_names": [], "import_names": [], "rhs_call_name": "Circle", "annotation": ""}, "snippet": " cv.Circle(rimage, loc, int(round(size/2.0)), c, 1, cv.CV_AA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L109_C4", "label": "return", "type": "return", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L94_C0", "vector": [13, 1, 0.7622, 0.007, 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 rimage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L112_C0", "label": "star", "type": "function", "loc": [112, 116], "level": 0, "parent": null, "vector": [2, 0, 0.7972, 0.035, 0, 0.66, 0.7647, 904, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "star", "arg_names": ["image"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def star(image):\n star_stor = cv.CreateMemStorage()\n star_keypoints = cv.GetStarKeypoints(image, star_stor) #list of ((x,y), size, response)\n del star_stor\n return star_keypoints"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L113_C4", "label": "star_stor = CreateMemStorage()", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L112_C0", "vector": [14, 1, 0.7902, 0.007, 1, 0.68, 0.0, 499, 3, 0, 0, 0, 895, 10, 1], "semantic": {"name": "star_stor", "arg_names": [], "import_names": [], "rhs_call_name": "CreateMemStorage", "annotation": ""}, "snippet": " star_stor = cv.CreateMemStorage()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L114_C4", "label": "star_keypoints = GetStarKeypoints()", "type": "assigned_variable", "loc": [114, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L112_C0", "vector": [14, 1, 0.7972, 0.007, 1, 0.68, 0.5, 736, 3, 2, 0, 0, 679, 10, 1], "semantic": {"name": "star_keypoints", "arg_names": [], "import_names": [], "rhs_call_name": "GetStarKeypoints", "annotation": ""}, "snippet": " star_keypoints = cv.GetStarKeypoints(image, star_stor) #list of ((x,y), size, response)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L116_C4", "label": "return", "type": "return", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L112_C0", "vector": [13, 1, 0.8112, 0.007, 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 star_keypoints"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L121_C0", "label": "surf", "type": "function", "loc": [121, 125], "level": 0, "parent": null, "vector": [2, 0, 0.8601, 0.035, 0, 0.66, 0.8235, 181, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "surf", "arg_names": ["image_gray", "params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def surf(image_gray, params=(1, 3000,3,4)):\n surf_stor = cv.CreateMemStorage()\n surf_r = cv.ExtractSURF(image_gray, None, surf_stor, params)\n del surf_stor\n return surf_r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L122_C4", "label": "surf_stor = CreateMemStorage()", "type": "assigned_variable", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L121_C0", "vector": [14, 1, 0.8531, 0.007, 1, 0.77, 0.0, 127, 3, 0, 0, 0, 895, 10, 1], "semantic": {"name": "surf_stor", "arg_names": [], "import_names": [], "rhs_call_name": "CreateMemStorage", "annotation": ""}, "snippet": " surf_stor = cv.CreateMemStorage()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L123_C4", "label": "surf_r = ExtractSURF()", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L121_C0", "vector": [14, 1, 0.8601, 0.007, 1, 0.77, 0.5, 835, 3, 4, 0, 0, 332, 10, 1], "semantic": {"name": "surf_r", "arg_names": [], "import_names": [], "rhs_call_name": "ExtractSURF", "annotation": ""}, "snippet": " surf_r = cv.ExtractSURF(image_gray, None, surf_stor, params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L125_C4", "label": "return", "type": "return", "loc": [125, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L121_C0", "vector": [13, 1, 0.8741, 0.007, 1, 0.77, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return surf_r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L129_C0", "label": "surf_color", "type": "function", "loc": [129, 131], "level": 0, "parent": null, "vector": [2, 0, 0.9091, 0.021, 0, 0.66, 0.8824, 716, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "surf_color", "arg_names": ["image", "params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def surf_color(image, params=(1,3000,3,4)):\n gray = grayscale(image)\n return surf(gray, params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L130_C4", "label": "gray = grayscale()", "type": "assigned_variable", "loc": [130, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L129_C0", "vector": [14, 1, 0.9091, 0.007, 1, 0.26, 0.0, 978, 3, 1, 0, 0, 530, 10, 1], "semantic": {"name": "gray", "arg_names": [], "import_names": [], "rhs_call_name": "grayscale", "annotation": ""}, "snippet": " gray = grayscale(image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L131_C4", "label": "return", "type": "return", "loc": [131, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L129_C0", "vector": [13, 1, 0.9161, 0.007, 1, 0.26, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return surf(gray, params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L135_C0", "label": "harris", "type": "function", "loc": [135, 138], "level": 0, "parent": null, "vector": [2, 0, 0.9545, 0.028, 0, 0.66, 0.9412, 916, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "harris", "arg_names": ["image_gray"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def harris(image_gray):\n eig_image = cv.CreateImage(cv.GetSize(image_gray), cv.IPL_DEPTH_32F, 1)\n temp_image = cv.CreateImage(cv.GetSize(image_gray), cv.IPL_DEPTH_32F, 1)\n return cv.GoodFeaturesToTrack(image_gray, eig_image, temp_image, 300, .1, 1.0, useHarris = True) #list of (x,y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L136_C4", "label": "eig_image = CreateImage()", "type": "assigned_variable", "loc": [136, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L135_C0", "vector": [14, 1, 0.951, 0.007, 1, 0.67, 0.0, 133, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "eig_image", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " eig_image = cv.CreateImage(cv.GetSize(image_gray), cv.IPL_DEPTH_32F, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L137_C4", "label": "temp_image = CreateImage()", "type": "assigned_variable", "loc": [137, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L135_C0", "vector": [14, 1, 0.958, 0.007, 1, 0.67, 0.5, 709, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "temp_image", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " temp_image = cv.CreateImage(cv.GetSize(image_gray), cv.IPL_DEPTH_32F, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L138_C4", "label": "return", "type": "return", "loc": [138, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L135_C0", "vector": [13, 1, 0.965, 0.007, 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 cv.GoodFeaturesToTrack(image_gray, eig_image, temp_image, 300, .1, 1.0, useHarris = True) #list of (x,y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L140_C0", "label": "grayscale", "type": "function", "loc": [140, 143], "level": 0, "parent": null, "vector": [2, 0, 0.9895, 0.028, 0, 0.66, 1.0, 530, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "grayscale", "arg_names": ["image"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def grayscale(image):\n image_gray = cv.CreateImage(cv.GetSize(image), cv.IPL_DEPTH_8U,1)\n cv.CvtColor(image, image_gray, cv.CV_BGR2GRAY)\n return image_gray"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L141_C4", "label": "image_gray = CreateImage()", "type": "assigned_variable", "loc": [141, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L140_C0", "vector": [14, 1, 0.986, 0.007, 1, 0.0, 0.0, 411, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "image_gray", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " image_gray = cv.CreateImage(cv.GetSize(image), cv.IPL_DEPTH_8U,1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L142_C4", "label": "CvtColor()", "type": "expression", "loc": [142, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L140_C0", "vector": [8, 1, 0.993, 0.007, 1, 0.0, 0.5, 974, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "CvtColor", "arg_names": [], "import_names": [], "rhs_call_name": "CvtColor", "annotation": ""}, "snippet": " cv.CvtColor(image, image_gray, cv.CV_BGR2GRAY)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L143_C4", "label": "return", "type": "return", "loc": [143, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L140_C0", "vector": [13, 1, 1.0, 0.007, 1, 0.0, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return image_gray"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99672:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L26_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L27_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L26_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L28_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L26_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L29_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:If_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:If_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:If_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L40_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:If_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:If_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:If_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:For_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L121_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L121_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L121_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L140_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Assign_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L140_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Expr_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99672:FunctionDef_L140_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99672:Return_L143_C4"}]
import roslib; roslib.load_manifest('hai_sandbox') import cv import sys import os.path as pt img_path = sys.argv[1] print 'loading', img_path img = cv.LoadImageM(img_path) dst = cv.CloneMat(img) dif = cv.CloneMat(img) cv.Smooth(img, dst, cv.CV_GAUSSIAN, 91) cv.Sub(img, dst, dif) cv.SaveImage(img_path, dif) #orig_path, fname = pt.split(img_path) #name = pt.splitext(fname)[0] #pt.join(orig_path, name)
ajibawa-2023/Python-Code-Large/train/row_99673
13
20
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99673:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.05, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99673:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.05, 0.05, 0, 0.66, 0.0833, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99673:Import_L2_C0", "label": "cv import cv", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.05, 0, 0.66, 0.1667, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99673:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.15, 0.05, 0, 0.66, 0.25, 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_99673:Import_L4_C0", "label": "os.path import pt", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.05, 0, 0.66, 0.3333, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["pt"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os.path as pt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99673:Assign_L6_C0", "label": "img_path =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3, 0.05, 0, 0.66, 0.4167, 833, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "img_path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "img_path = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99673:Expr_L7_C0", "label": "print()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.35, 0.05, 0, 0.66, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('loading', img_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99673:Assign_L8_C0", "label": "img = LoadImageM()", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.4, 0.05, 0, 0.66, 0.5833, 200, 3, 1, 0, 0, 859, 10, 1], "semantic": {"name": "img", "arg_names": [], "import_names": [], "rhs_call_name": "LoadImageM", "annotation": ""}, "snippet": "img = cv.LoadImageM(img_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99673:Assign_L9_C0", "label": "dst = CloneMat()", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.45, 0.05, 0, 0.66, 0.6667, 856, 3, 1, 0, 0, 201, 10, 1], "semantic": {"name": "dst", "arg_names": [], "import_names": [], "rhs_call_name": "CloneMat", "annotation": ""}, "snippet": "dst = cv.CloneMat(img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99673:Assign_L10_C0", "label": "dif = CloneMat()", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.05, 0, 0.66, 0.75, 980, 3, 1, 0, 0, 201, 10, 1], "semantic": {"name": "dif", "arg_names": [], "import_names": [], "rhs_call_name": "CloneMat", "annotation": ""}, "snippet": "dif = cv.CloneMat(img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99673:Expr_L11_C0", "label": "Smooth()", "type": "expression", "loc": [11, 11], "level": 0, "parent": null, "vector": [8, 0, 0.55, 0.05, 0, 0.66, 0.8333, 922, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "Smooth", "arg_names": [], "import_names": [], "rhs_call_name": "Smooth", "annotation": ""}, "snippet": "cv.Smooth(img, dst, cv.CV_GAUSSIAN, 91)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99673:Expr_L12_C0", "label": "Sub()", "type": "expression", "loc": [12, 12], "level": 0, "parent": null, "vector": [8, 0, 0.6, 0.05, 0, 0.66, 0.9167, 570, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Sub", "arg_names": [], "import_names": [], "rhs_call_name": "Sub", "annotation": ""}, "snippet": "cv.Sub(img, dst, dif)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99673:Expr_L13_C0", "label": "SaveImage()", "type": "expression", "loc": [13, 13], "level": 0, "parent": null, "vector": [8, 0, 0.65, 0.05, 0, 0.66, 1.0, 91, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "SaveImage", "arg_names": [], "import_names": [], "rhs_call_name": "SaveImage", "annotation": ""}, "snippet": "cv.SaveImage(img_path, dif)"}]
[]
import roslib; roslib.load_manifest('hai_sandbox') import hrl_lib.util as ut import pylab as pb import numpy as np import pdb def conf_to_percent(rec): conf = rec['mat'] conf[0,:] = conf[0,:] / rec['neg'] conf[1,:] = conf[1,:] / rec['pos'] return conf[0,0], conf[1,1] def plot_classifier_performance(fname, pname, plot_all): results = ut.load_pickle(fname) #pdb.set_trace() #results['train_set_statistics'] # [ {'conf', 'size'}, {}...] #results['current_scan_statistics'] # [ {'conf'} {}...] #results['perf_on_other_scans'] # [[{'name', 'conf'}, {}...] [{} {}...]...] #where conf is {'mat', 'neg', 'pos'} scores = {} for rlist in results['perf_on_other_scans']: for d in rlist: if scores.has_key(d['name']): scores[d['name']].append(conf_to_percent(d['conf'])) else: scores[d['name']] = [conf_to_percent(d['conf'])] for k in scores.keys(): scores[k] = zip(*scores[k]) if results.has_key('train_set_statistics'): train_neg, train_pos = zip(*[conf_to_percent(d['conf']) for d in results['train_set_statistics']]) else: train_neg = train_pos = None if results.has_key('current_scan_statistics'): pdb.set_trace() test_neg, test_pos = zip(*[conf_to_percent(d['conf']) for d in results['current_scan_statistics']]) else: test_neg = test_pos = None n_iterations = np.array(range(len(results['train_set_statistics']))) #====================================================================== pb.figure(1) if results.has_key('train_set_statistics'): pb.plot(n_iterations, train_neg, label='train ' + pname) if test_neg != None: pb.plot(n_iterations, test_neg, label='test ' + pname) if plot_all: for i, k in enumerate(scores.keys()): pb.plot(n_iterations, scores[k][0], '--', label=str(i)) #if results.has_key('current_scan_statistics'): if results.has_key('converged_at_iter'): pb.plot([results['converged_at_iter'], results['converged_at_iter']], [0., 1.], 'r') pb.title('True negatives') pb.legend() #====================================================================== pb.figure(2) if train_pos != None: pb.plot(n_iterations, train_pos, label='train ' + pname) if test_pos != None: pb.plot(n_iterations, test_pos, label='test ' + pname) #if results.has_key('current_scan_statistics'): print 'mapping from dataset to id' if plot_all: for i, k in enumerate(scores.keys()): pb.plot(n_iterations, scores[k][1], '--', label=str(i)) print 'ID', i, 'dataset', k if results.has_key('converged_at_iter'): pb.plot([results['converged_at_iter'], results['converged_at_iter']], [0., 1.], 'r') pb.title('True positives') pb.legend() def plot_features_perf(fnames, pnames): all_scores = {} dset_names = None for fname, pname in zip(fnames, pnames): results = ut.load_pickle(fname) train_neg, train_pos = zip(*[conf_to_percent(d['conf']) for d in results['train_set_statistics']]) scores = {} for rlist in results['perf_on_other_scans']: for d in rlist: if scores.has_key(d['name']): scores[d['name']].append(conf_to_percent(d['conf'])) else: scores[d['name']] = [conf_to_percent(d['conf'])] for k in scores.keys(): scores[k] = zip(*scores[k]) scores['train'] = [(train_neg), (train_pos)] all_scores[pname] = scores if dset_names == None: dset_names = scores.keys() neg_by_dset = {} for n in dset_names: posn = [] for pname in pnames: posn.append(all_scores[pname][n][0][0]) neg_by_dset[n] = posn pos_by_dset = {} for n in dset_names: posn = [] for pname in pnames: posn.append(all_scores[pname][n][1][0]) pos_by_dset[n] = posn ind = np.arange(len(pnames)) width = 0.05 fig = pb.figure(1) ax = fig.add_subplot(111) rects=[] for i, name in enumerate(dset_names): rect = ax.bar(ind+(width*i), pos_by_dset[name], width, color=tuple(np.random.rand(3).tolist())) rects.append(rect) ax.set_ylabel('accuracy') ax.set_title('True positives by dataset and features used') ax.set_xticks(ind+width) ax.set_xticklabels(tuple(pnames)) fig = pb.figure(2) ax = fig.add_subplot(111) rects=[] for i, name in enumerate(dset_names): rect = ax.bar(ind+(width*i), neg_by_dset[name], width, color=tuple(np.random.rand(3).tolist())) rects.append(rect) ax.set_ylabel('accuracy') ax.set_title('True negatives by dataset and features used') ax.set_xticks(ind+width) ax.set_xticklabels(tuple(pnames)) if __name__ == '__main__': import sys import optparse p = optparse.OptionParser() p.add_option("-m", "--mode", action="store", type="string") p.add_option("-f", "--file", action="append", type="string") p.add_option('-n', '--name', action="append", type="string") opt, args = p.parse_args() if opt.mode == 'active': if len(opt.file) <= 1: plot_all = True else: plot_all = False for i in range(len(opt.file)): plot_classifier_performance(opt.file[i], opt.name[i], plot_all) pb.show() if opt.mode == 'features': plot_features_perf(opt.file, opt.name) pb.show() #For comparing between different algorithms, don't need to plot performance on all scans just
ajibawa-2023/Python-Code-Large/train/row_99675
125
174
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0057, 0.0057, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0057, 0.0057, 0, 0.66, 0.1111, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Import_L2_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0115, 0.0057, 0, 0.66, 0.2222, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Import_L3_C0", "label": "pylab import pb", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0172, 0.0057, 0, 0.66, 0.3333, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "pylab", "arg_names": [], "import_names": ["pb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pylab as pb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Import_L4_C0", "label": "numpy import np", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.023, 0.0057, 0, 0.66, 0.4444, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Import_L5_C0", "label": "pdb import pdb", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0287, 0.0057, 0, 0.66, 0.5556, 91, 0, 1, 0, 0, 91, 0, 0], "semantic": {"name": "pdb", "arg_names": [], "import_names": ["pdb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pdb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L7_C0", "label": "conf_to_percent", "type": "function", "loc": [7, 11], "level": 0, "parent": null, "vector": [2, 0, 0.0517, 0.0287, 0, 0.66, 0.6667, 689, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "conf_to_percent", "arg_names": ["rec"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def conf_to_percent(rec):\n conf = rec['mat']\n conf[0,:] = conf[0,:] / rec['neg']\n conf[1,:] = conf[1,:] / rec['pos']\n return conf[0,0], conf[1,1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L8_C4", "label": "conf =", "type": "assigned_variable", "loc": [8, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L7_C0", "vector": [14, 1, 0.046, 0.0057, 1, 0.62, 0.0, 433, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "conf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " conf = rec['mat']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L9_C4", "label": "assign", "type": "assigned_variable", "loc": [9, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L7_C0", "vector": [14, 1, 0.0517, 0.0057, 1, 0.62, 0.3333, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " conf[0,:] = conf[0,:] / rec['neg']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L10_C4", "label": "assign", "type": "assigned_variable", "loc": [10, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L7_C0", "vector": [14, 1, 0.0575, 0.0057, 1, 0.62, 0.6667, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " conf[1,:] = conf[1,:] / rec['pos']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Return_L11_C4", "label": "return", "type": "return", "loc": [11, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L7_C0", "vector": [13, 1, 0.0632, 0.0057, 1, 0.62, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return conf[0,0], conf[1,1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "label": "plot_classifier_performance", "type": "function", "loc": [13, 78], "level": 0, "parent": null, "vector": [2, 0, 0.2615, 0.3793, 0, 0.66, 0.7778, 44, 0, 3, 0, 0, 0, 0, 42], "semantic": {"name": "plot_classifier_performance", "arg_names": ["fname", "pname", "plot_all"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_classifier_performance(fname, pname, plot_all):\n results = ut.load_pickle(fname)\n #pdb.set_trace()\n #results['train_set_statistics'] # [ {'conf', 'size'}, {}...]\n #results['current_scan_statistics'] # [ {'conf'} {}...]\n #results['perf_on_other_scans'] # [[{'name', 'conf'}, {}...] [{} {}...]...]\n #where conf is {'mat', 'neg', 'pos'}\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L14_C4", "label": "results = load_pickle()", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [14, 1, 0.0805, 0.0057, 1, 0.35, 0.0, 143, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "results", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " results = ut.load_pickle(fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L21_C4", "label": "scores =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [14, 1, 0.1207, 0.0057, 1, 0.35, 0.0476, 50, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "scores", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scores = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L22_C4", "label": "for rlist", "type": "for", "loc": [22, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [6, 1, 0.1408, 0.0345, 1, 0.35, 0.0952, 501, 6, 0, 0, 0, 0, 0, 4], "semantic": {"name": "rlist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for rlist in results['perf_on_other_scans']:\n for d in rlist:\n if scores.has_key(d['name']):\n scores[d['name']].append(conf_to_percent(d['conf']))\n else:\n scores[d['name']] = [conf_to_percent(d['conf'])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L23_C8", "label": "for d", "type": "for", "loc": [23, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L22_C4", "vector": [6, 2, 0.1437, 0.0287, 2, 0.96, 0.0, 355, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for d in rlist:\n if scores.has_key(d['name']):\n scores[d['name']].append(conf_to_percent(d['conf']))\n else:\n scores[d['name']] = [conf_to_percent(d['conf'])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L24_C12", "label": "if", "type": "if", "loc": [24, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L23_C8", "vector": [4, 3, 0.1466, 0.023, 3, 0.37, 0.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if scores.has_key(d['name']):\n scores[d['name']].append(conf_to_percent(d['conf']))\n else:\n scores[d['name']] = [conf_to_percent(d['conf'])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L25_C16", "label": "append()", "type": "expression", "loc": [25, 25], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L24_C12", "vector": [8, 4, 0.1437, 0.0057, 4, 0.86, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " scores[d['name']].append(conf_to_percent(d['conf']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L27_C16", "label": "assign", "type": "assigned_variable", "loc": [27, 27], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L24_C12", "vector": [14, 4, 0.1552, 0.0057, 4, 0.86, 1.0, 0, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scores[d['name']] = [conf_to_percent(d['conf'])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L28_C4", "label": "for k", "type": "for", "loc": [28, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [6, 1, 0.1638, 0.0115, 1, 0.35, 0.1429, 954, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in scores.keys():\n scores[k] = zip(*scores[k])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L29_C8", "label": " = zip()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L28_C4", "vector": [14, 2, 0.1667, 0.0057, 2, 0.16, 0.0, 0, 3, 1, 0, 0, 814, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " scores[k] = zip(*scores[k])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L31_C4", "label": "if", "type": "if", "loc": [31, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [4, 1, 0.1868, 0.023, 1, 0.35, 0.1905, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if results.has_key('train_set_statistics'):\n train_neg, train_pos = zip(*[conf_to_percent(d['conf']) for d in results['train_set_statistics']])\n else:\n train_neg = train_pos = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L32_C8", "label": "train_neg, train_pos = zip()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L31_C4", "vector": [14, 2, 0.1839, 0.0057, 2, 0.07, 0.0, 709, 3, 1, 0, 0, 814, 10, 2], "semantic": {"name": "train_neg, train_pos", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " train_neg, train_pos = zip(*[conf_to_percent(d['conf']) for d in results['train_set_statistics']])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L34_C8", "label": "train_neg =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L31_C4", "vector": [14, 2, 0.1954, 0.0057, 2, 0.07, 1.0, 342, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "train_neg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " train_neg = train_pos = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L36_C4", "label": "if", "type": "if", "loc": [36, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [4, 1, 0.2184, 0.0287, 1, 0.35, 0.2381, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if results.has_key('current_scan_statistics'):\n pdb.set_trace()\n test_neg, test_pos = zip(*[conf_to_percent(d['conf']) for d in results['current_scan_statistics']])\n else:\n test_neg = test_pos = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L37_C8", "label": "set_trace()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L36_C4", "vector": [8, 2, 0.2126, 0.0057, 2, 0.96, 0.0, 796, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_trace", "arg_names": [], "import_names": [], "rhs_call_name": "set_trace", "annotation": ""}, "snippet": " pdb.set_trace()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L38_C8", "label": "test_neg, test_pos = zip()", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L36_C4", "vector": [14, 2, 0.2184, 0.0057, 2, 0.96, 0.5, 592, 3, 1, 0, 0, 814, 10, 2], "semantic": {"name": "test_neg, test_pos", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " test_neg, test_pos = zip(*[conf_to_percent(d['conf']) for d in results['current_scan_statistics']])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L40_C8", "label": "test_neg =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L36_C4", "vector": [14, 2, 0.2299, 0.0057, 2, 0.96, 1.0, 762, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "test_neg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_neg = test_pos = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L42_C4", "label": "n_iterations = array()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [14, 1, 0.2414, 0.0057, 1, 0.35, 0.2857, 291, 3, 1, 0, 0, 80, 10, 3], "semantic": {"name": "n_iterations", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " n_iterations = np.array(range(len(results['train_set_statistics'])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L45_C4", "label": "figure()", "type": "expression", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [8, 1, 0.2586, 0.0057, 1, 0.35, 0.3333, 789, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pb.figure(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L46_C4", "label": "if", "type": "if", "loc": [46, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [4, 1, 0.2672, 0.0115, 1, 0.35, 0.381, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if results.has_key('train_set_statistics'):\n pb.plot(n_iterations, train_neg, label='train ' + pname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L47_C8", "label": "plot()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L46_C4", "vector": [8, 2, 0.2701, 0.0057, 2, 0.16, 0.0, 929, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pb.plot(n_iterations, train_neg, label='train ' + pname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L48_C4", "label": "if", "type": "if", "loc": [48, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [4, 1, 0.2787, 0.0115, 1, 0.35, 0.4286, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_neg != None:\n pb.plot(n_iterations, test_neg, label='test ' + pname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L49_C8", "label": "plot()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L48_C4", "vector": [8, 2, 0.2816, 0.0057, 2, 0.73, 0.0, 929, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pb.plot(n_iterations, test_neg, label='test ' + pname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L50_C4", "label": "if", "type": "if", "loc": [50, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [4, 1, 0.2931, 0.0172, 1, 0.35, 0.4762, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_all:\n for i, k in enumerate(scores.keys()):\n pb.plot(n_iterations, scores[k][0], '--', label=str(i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L51_C8", "label": "for i, k", "type": "for", "loc": [51, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L50_C4", "vector": [6, 2, 0.296, 0.0115, 2, 0.59, 0.0, 992, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i, k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, k in enumerate(scores.keys()):\n pb.plot(n_iterations, scores[k][0], '--', label=str(i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L52_C12", "label": "plot()", "type": "expression", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L51_C8", "vector": [8, 3, 0.2989, 0.0057, 3, 0.02, 0.0, 929, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pb.plot(n_iterations, scores[k][0], '--', label=str(i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L54_C4", "label": "if", "type": "if", "loc": [54, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [4, 1, 0.3132, 0.0115, 1, 0.35, 0.5238, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if results.has_key('converged_at_iter'):\n pb.plot([results['converged_at_iter'], results['converged_at_iter']], [0., 1.], 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L55_C8", "label": "plot()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L54_C4", "vector": [8, 2, 0.3161, 0.0057, 2, 0.18, 0.0, 929, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pb.plot([results['converged_at_iter'], results['converged_at_iter']], [0., 1.], 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L57_C4", "label": "title()", "type": "expression", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [8, 1, 0.3276, 0.0057, 1, 0.35, 0.5714, 48, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " pb.title('True negatives')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L58_C4", "label": "legend()", "type": "expression", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [8, 1, 0.3333, 0.0057, 1, 0.35, 0.619, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " pb.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L61_C4", "label": "figure()", "type": "expression", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [8, 1, 0.3506, 0.0057, 1, 0.35, 0.6667, 789, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pb.figure(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L62_C4", "label": "if", "type": "if", "loc": [62, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [4, 1, 0.3592, 0.0115, 1, 0.35, 0.7143, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if train_pos != None:\n pb.plot(n_iterations, train_pos, label='train ' + pname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L63_C8", "label": "plot()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L62_C4", "vector": [8, 2, 0.3621, 0.0057, 2, 0.48, 0.0, 929, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pb.plot(n_iterations, train_pos, label='train ' + pname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L64_C4", "label": "if", "type": "if", "loc": [64, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [4, 1, 0.3707, 0.0115, 1, 0.35, 0.7619, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_pos != None:\n pb.plot(n_iterations, test_pos, label='test ' + pname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L65_C8", "label": "plot()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L64_C4", "vector": [8, 2, 0.3736, 0.0057, 2, 0.71, 0.0, 929, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pb.plot(n_iterations, test_pos, label='test ' + pname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L68_C4", "label": "print()", "type": "expression", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [8, 1, 0.3908, 0.0057, 1, 0.35, 0.8095, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('mapping from dataset to id')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L69_C4", "label": "if", "type": "if", "loc": [69, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [4, 1, 0.4052, 0.023, 1, 0.35, 0.8571, 0, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_all:\n for i, k in enumerate(scores.keys()):\n pb.plot(n_iterations, scores[k][1], '--', label=str(i))\n print('ID', i, 'dataset', k)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L70_C8", "label": "for i, k", "type": "for", "loc": [70, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L69_C4", "vector": [6, 2, 0.408, 0.0172, 2, 0.27, 0.0, 992, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i, k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, k in enumerate(scores.keys()):\n pb.plot(n_iterations, scores[k][1], '--', label=str(i))\n print('ID', i, 'dataset', k)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L71_C12", "label": "plot()", "type": "expression", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L70_C8", "vector": [8, 3, 0.408, 0.0057, 3, 0.32, 0.0, 929, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pb.plot(n_iterations, scores[k][1], '--', label=str(i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L72_C12", "label": "print()", "type": "expression", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L70_C8", "vector": [8, 3, 0.4138, 0.0057, 3, 0.32, 1.0, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('ID', i, 'dataset', k)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L74_C4", "label": "if", "type": "if", "loc": [74, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [4, 1, 0.4282, 0.0115, 1, 0.35, 0.9048, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if results.has_key('converged_at_iter'):\n pb.plot([results['converged_at_iter'], results['converged_at_iter']], [0., 1.], 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L75_C8", "label": "plot()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L74_C4", "vector": [8, 2, 0.431, 0.0057, 2, 0.48, 0.0, 929, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pb.plot([results['converged_at_iter'], results['converged_at_iter']], [0., 1.], 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L77_C4", "label": "title()", "type": "expression", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [8, 1, 0.4425, 0.0057, 1, 0.35, 0.9524, 48, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " pb.title('True positives')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L78_C4", "label": "legend()", "type": "expression", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "vector": [8, 1, 0.4483, 0.0057, 1, 0.35, 1.0, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " pb.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "label": "plot_features_perf", "type": "function", "loc": [80, 140], "level": 0, "parent": null, "vector": [2, 0, 0.6322, 0.3506, 0, 0.66, 0.8889, 364, 0, 2, 0, 0, 0, 0, 41], "semantic": {"name": "plot_features_perf", "arg_names": ["fnames", "pnames"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_features_perf(fnames, pnames):\n\n all_scores = {}\n dset_names = None\n for fname, pname in zip(fnames, pnames):\n results = ut.load_pickle(fname)\n train_neg, train_pos = zip(*[conf_to_percent(d['conf']) for d in results['train_set_statistics']])\n scores = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L82_C4", "label": "all_scores =", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [14, 1, 0.4713, 0.0057, 1, 0.98, 0.0, 771, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "all_scores", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " all_scores = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L83_C4", "label": "dset_names =", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [14, 1, 0.477, 0.0057, 1, 0.98, 0.0417, 851, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "dset_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dset_names = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L84_C4", "label": "for fname, pname", "type": "for", "loc": [84, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [6, 1, 0.5259, 0.092, 1, 0.98, 0.0833, 383, 3, 0, 0, 0, 0, 0, 11], "semantic": {"name": "fname, pname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for fname, pname in zip(fnames, pnames):\n results = ut.load_pickle(fname)\n train_neg, train_pos = zip(*[conf_to_percent(d['conf']) for d in results['train_set_statistics']])\n scores = {}\n for rlist in results['perf_on_other_scans']:\n for d in rlist:\n if scores.has_key(d['name']):\n scores[d['name']].append(conf_to_percent(d['conf']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L85_C8", "label": "results = load_pickle()", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L84_C4", "vector": [14, 2, 0.4885, 0.0057, 2, 0.83, 0.0, 143, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "results", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " results = ut.load_pickle(fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L86_C8", "label": "train_neg, train_pos = zip()", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L84_C4", "vector": [14, 2, 0.4943, 0.0057, 2, 0.83, 0.1429, 709, 3, 1, 0, 0, 814, 10, 2], "semantic": {"name": "train_neg, train_pos", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " train_neg, train_pos = zip(*[conf_to_percent(d['conf']) for d in results['train_set_statistics']])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L87_C8", "label": "scores =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L84_C4", "vector": [14, 2, 0.5, 0.0057, 2, 0.83, 0.2857, 50, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "scores", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scores = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L88_C8", "label": "for rlist", "type": "for", "loc": [88, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L84_C4", "vector": [6, 2, 0.5201, 0.0345, 2, 0.83, 0.4286, 501, 6, 0, 0, 0, 0, 0, 4], "semantic": {"name": "rlist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for rlist in results['perf_on_other_scans']:\n for d in rlist:\n if scores.has_key(d['name']):\n scores[d['name']].append(conf_to_percent(d['conf']))\n else:\n scores[d['name']] = [conf_to_percent(d['conf'])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L89_C12", "label": "for d", "type": "for", "loc": [89, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L88_C8", "vector": [6, 3, 0.523, 0.0287, 3, 0.19, 0.0, 355, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for d in rlist:\n if scores.has_key(d['name']):\n scores[d['name']].append(conf_to_percent(d['conf']))\n else:\n scores[d['name']] = [conf_to_percent(d['conf'])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L90_C16", "label": "if", "type": "if", "loc": [90, 93], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L89_C12", "vector": [4, 4, 0.5259, 0.023, 4, 0.12, 0.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if scores.has_key(d['name']):\n scores[d['name']].append(conf_to_percent(d['conf']))\n else:\n scores[d['name']] = [conf_to_percent(d['conf'])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L91_C20", "label": "append()", "type": "expression", "loc": [91, 91], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L90_C16", "vector": [8, 5, 0.523, 0.0057, 5, 0.55, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " scores[d['name']].append(conf_to_percent(d['conf']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L93_C20", "label": "assign", "type": "assigned_variable", "loc": [93, 93], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L90_C16", "vector": [14, 5, 0.5345, 0.0057, 5, 0.55, 1.0, 0, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scores[d['name']] = [conf_to_percent(d['conf'])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L94_C8", "label": "for k", "type": "for", "loc": [94, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L84_C4", "vector": [6, 2, 0.5431, 0.0115, 2, 0.83, 0.5714, 954, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in scores.keys():\n scores[k] = zip(*scores[k])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L95_C12", "label": " = zip()", "type": "assigned_variable", "loc": [95, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L94_C8", "vector": [14, 3, 0.546, 0.0057, 3, 0.58, 0.0, 0, 3, 1, 0, 0, 814, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " scores[k] = zip(*scores[k])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L96_C8", "label": "assign", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L84_C4", "vector": [14, 2, 0.5517, 0.0057, 2, 0.83, 0.7143, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scores['train'] = [(train_neg), (train_pos)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L97_C8", "label": "assign", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L84_C4", "vector": [14, 2, 0.5575, 0.0057, 2, 0.83, 0.8571, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " all_scores[pname] = scores"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L98_C8", "label": "if", "type": "if", "loc": [98, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L84_C4", "vector": [4, 2, 0.5661, 0.0115, 2, 0.83, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dset_names == None:\n dset_names = scores.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L99_C12", "label": "dset_names = keys()", "type": "assigned_variable", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L98_C8", "vector": [14, 3, 0.569, 0.0057, 3, 0.76, 0.0, 851, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "dset_names", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " dset_names = scores.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L102_C4", "label": "neg_by_dset =", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [14, 1, 0.5862, 0.0057, 1, 0.98, 0.125, 409, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "neg_by_dset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " neg_by_dset = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L103_C4", "label": "for n", "type": "for", "loc": [103, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [6, 1, 0.6034, 0.0287, 1, 0.98, 0.1667, 773, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for n in dset_names:\n posn = []\n for pname in pnames:\n posn.append(all_scores[pname][n][0][0])\n neg_by_dset[n] = posn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L104_C8", "label": "posn =", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L103_C4", "vector": [14, 2, 0.5977, 0.0057, 2, 0.78, 0.0, 52, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "posn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " posn = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L105_C8", "label": "for pname", "type": "for", "loc": [105, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L103_C4", "vector": [6, 2, 0.6063, 0.0115, 2, 0.78, 0.5, 10, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for pname in pnames:\n posn.append(all_scores[pname][n][0][0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L106_C12", "label": "append()", "type": "expression", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L105_C8", "vector": [8, 3, 0.6092, 0.0057, 3, 0.11, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " posn.append(all_scores[pname][n][0][0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L107_C8", "label": "assign", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L103_C4", "vector": [14, 2, 0.6149, 0.0057, 2, 0.78, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " neg_by_dset[n] = posn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L109_C4", "label": "pos_by_dset =", "type": "assigned_variable", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [14, 1, 0.6264, 0.0057, 1, 0.98, 0.2083, 974, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "pos_by_dset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos_by_dset = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L110_C4", "label": "for n", "type": "for", "loc": [110, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [6, 1, 0.6437, 0.0287, 1, 0.98, 0.25, 773, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for n in dset_names:\n posn = []\n for pname in pnames:\n posn.append(all_scores[pname][n][1][0])\n pos_by_dset[n] = posn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L111_C8", "label": "posn =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L110_C4", "vector": [14, 2, 0.6379, 0.0057, 2, 0.86, 0.0, 52, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "posn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " posn = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L112_C8", "label": "for pname", "type": "for", "loc": [112, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L110_C4", "vector": [6, 2, 0.6466, 0.0115, 2, 0.86, 0.5, 10, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for pname in pnames:\n posn.append(all_scores[pname][n][1][0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L113_C12", "label": "append()", "type": "expression", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L112_C8", "vector": [8, 3, 0.6494, 0.0057, 3, 0.98, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " posn.append(all_scores[pname][n][1][0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L114_C8", "label": "assign", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L110_C4", "vector": [14, 2, 0.6552, 0.0057, 2, 0.86, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos_by_dset[n] = posn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L116_C4", "label": "ind = arange()", "type": "assigned_variable", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [14, 1, 0.6667, 0.0057, 1, 0.98, 0.2917, 680, 3, 1, 0, 0, 489, 10, 2], "semantic": {"name": "ind", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " ind = np.arange(len(pnames))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L117_C4", "label": "width =", "type": "assigned_variable", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [14, 1, 0.6724, 0.0057, 1, 0.98, 0.3333, 989, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " width = 0.05"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L120_C4", "label": "fig = figure()", "type": "assigned_variable", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [14, 1, 0.6897, 0.0057, 1, 0.98, 0.375, 806, 3, 1, 0, 0, 789, 10, 1], "semantic": {"name": "fig", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " fig = pb.figure(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L121_C4", "label": "ax = add_subplot()", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [14, 1, 0.6954, 0.0057, 1, 0.98, 0.4167, 823, 3, 1, 0, 0, 449, 10, 1], "semantic": {"name": "ax", "arg_names": [], "import_names": [], "rhs_call_name": "add_subplot", "annotation": ""}, "snippet": " ax = fig.add_subplot(111)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L122_C4", "label": "rects =", "type": "assigned_variable", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [14, 1, 0.7011, 0.0057, 1, 0.98, 0.4583, 799, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "rects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rects=[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L123_C4", "label": "for i, name", "type": "for", "loc": [123, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [6, 1, 0.7126, 0.0172, 1, 0.98, 0.5, 14, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "i, name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, name in enumerate(dset_names):\n rect = ax.bar(ind+(width*i), pos_by_dset[name], width, color=tuple(np.random.rand(3).tolist()))\n rects.append(rect)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L124_C8", "label": "rect = bar()", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L123_C4", "vector": [14, 2, 0.7126, 0.0057, 2, 0.84, 0.0, 902, 3, 4, 0, 0, 300, 10, 4], "semantic": {"name": "rect", "arg_names": [], "import_names": [], "rhs_call_name": "bar", "annotation": ""}, "snippet": " rect = ax.bar(ind+(width*i), pos_by_dset[name], width, color=tuple(np.random.rand(3).tolist()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L125_C8", "label": "append()", "type": "expression", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L123_C4", "vector": [8, 2, 0.7184, 0.0057, 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": " rects.append(rect)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L126_C4", "label": "set_ylabel()", "type": "expression", "loc": [126, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [8, 1, 0.7241, 0.0057, 1, 0.98, 0.5417, 408, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "set_ylabel", "annotation": ""}, "snippet": " ax.set_ylabel('accuracy')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L127_C4", "label": "set_title()", "type": "expression", "loc": [127, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [8, 1, 0.7299, 0.0057, 1, 0.98, 0.5833, 145, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_title", "arg_names": [], "import_names": [], "rhs_call_name": "set_title", "annotation": ""}, "snippet": " ax.set_title('True positives by dataset and features used')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L128_C4", "label": "set_xticks()", "type": "expression", "loc": [128, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [8, 1, 0.7356, 0.0057, 1, 0.98, 0.625, 701, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_xticks", "arg_names": [], "import_names": [], "rhs_call_name": "set_xticks", "annotation": ""}, "snippet": " ax.set_xticks(ind+width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L129_C4", "label": "set_xticklabels()", "type": "expression", "loc": [129, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [8, 1, 0.7414, 0.0057, 1, 0.98, 0.6667, 391, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_xticklabels", "arg_names": [], "import_names": [], "rhs_call_name": "set_xticklabels", "annotation": ""}, "snippet": " ax.set_xticklabels(tuple(pnames))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L131_C4", "label": "fig = figure()", "type": "assigned_variable", "loc": [131, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [14, 1, 0.7529, 0.0057, 1, 0.98, 0.7083, 806, 3, 1, 0, 0, 789, 10, 1], "semantic": {"name": "fig", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " fig = pb.figure(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L132_C4", "label": "ax = add_subplot()", "type": "assigned_variable", "loc": [132, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [14, 1, 0.7586, 0.0057, 1, 0.98, 0.75, 823, 3, 1, 0, 0, 449, 10, 1], "semantic": {"name": "ax", "arg_names": [], "import_names": [], "rhs_call_name": "add_subplot", "annotation": ""}, "snippet": " ax = fig.add_subplot(111)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L133_C4", "label": "rects =", "type": "assigned_variable", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [14, 1, 0.7644, 0.0057, 1, 0.98, 0.7917, 799, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "rects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rects=[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L134_C4", "label": "for i, name", "type": "for", "loc": [134, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [6, 1, 0.7759, 0.0172, 1, 0.98, 0.8333, 14, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "i, name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, name in enumerate(dset_names):\n rect = ax.bar(ind+(width*i), neg_by_dset[name], width, color=tuple(np.random.rand(3).tolist()))\n rects.append(rect)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L135_C8", "label": "rect = bar()", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L134_C4", "vector": [14, 2, 0.7759, 0.0057, 2, 0.47, 0.0, 902, 3, 4, 0, 0, 300, 10, 4], "semantic": {"name": "rect", "arg_names": [], "import_names": [], "rhs_call_name": "bar", "annotation": ""}, "snippet": " rect = ax.bar(ind+(width*i), neg_by_dset[name], width, color=tuple(np.random.rand(3).tolist()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L136_C8", "label": "append()", "type": "expression", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L134_C4", "vector": [8, 2, 0.7816, 0.0057, 2, 0.47, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " rects.append(rect)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L137_C4", "label": "set_ylabel()", "type": "expression", "loc": [137, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [8, 1, 0.7874, 0.0057, 1, 0.98, 0.875, 408, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "set_ylabel", "annotation": ""}, "snippet": " ax.set_ylabel('accuracy')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L138_C4", "label": "set_title()", "type": "expression", "loc": [138, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [8, 1, 0.7931, 0.0057, 1, 0.98, 0.9167, 145, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_title", "arg_names": [], "import_names": [], "rhs_call_name": "set_title", "annotation": ""}, "snippet": " ax.set_title('True negatives by dataset and features used')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L139_C4", "label": "set_xticks()", "type": "expression", "loc": [139, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [8, 1, 0.7989, 0.0057, 1, 0.98, 0.9583, 701, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_xticks", "arg_names": [], "import_names": [], "rhs_call_name": "set_xticks", "annotation": ""}, "snippet": " ax.set_xticks(ind+width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L140_C4", "label": "set_xticklabels()", "type": "expression", "loc": [140, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "vector": [8, 1, 0.8046, 0.0057, 1, 0.98, 1.0, 391, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_xticklabels", "arg_names": [], "import_names": [], "rhs_call_name": "set_xticklabels", "annotation": ""}, "snippet": " ax.set_xticklabels(tuple(pnames))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L142_C0", "label": "if", "type": "if", "loc": [142, 163], "level": 0, "parent": null, "vector": [4, 0, 0.8764, 0.1264, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import sys\n import optparse\n p = optparse.OptionParser()\n p.add_option(\"-m\", \"--mode\", action=\"store\", type=\"string\")\n p.add_option(\"-f\", \"--file\", action=\"append\", type=\"string\")\n p.add_option('-n', '--name', action=\"append\", type=\"string\")\n opt, args = p.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Import_L143_C4", "label": "sys import sys", "type": "import", "loc": [143, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L142_C0", "vector": [1, 1, 0.8218, 0.0057, 1, 0.43, 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_99675:Import_L144_C4", "label": "optparse import optparse", "type": "import", "loc": [144, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L142_C0", "vector": [1, 1, 0.8276, 0.0057, 1, 0.43, 0.125, 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_99675:Assign_L145_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [145, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L142_C0", "vector": [14, 1, 0.8333, 0.0057, 1, 0.43, 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_99675:Expr_L146_C4", "label": "add_option()", "type": "expression", "loc": [146, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L142_C0", "vector": [8, 1, 0.8391, 0.0057, 1, 0.43, 0.375, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option(\"-m\", \"--mode\", action=\"store\", type=\"string\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L147_C4", "label": "add_option()", "type": "expression", "loc": [147, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L142_C0", "vector": [8, 1, 0.8448, 0.0057, 1, 0.43, 0.5, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option(\"-f\", \"--file\", action=\"append\", type=\"string\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L148_C4", "label": "add_option()", "type": "expression", "loc": [148, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L142_C0", "vector": [8, 1, 0.8506, 0.0057, 1, 0.43, 0.625, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-n', '--name', action=\"append\", type=\"string\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L149_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [149, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L142_C0", "vector": [14, 1, 0.8563, 0.0057, 1, 0.43, 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_99675:If_L151_C4", "label": "if", "type": "if", "loc": [151, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L142_C0", "vector": [4, 1, 0.8908, 0.0517, 1, 0.43, 0.875, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.mode == 'active':\n if len(opt.file) <= 1:\n plot_all = True\n else:\n plot_all = False\n\n for i in range(len(opt.file)):\n plot_classifier_performance(opt.file[i], opt.name[i], plot_all)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L152_C8", "label": "if", "type": "if", "loc": [152, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L151_C4", "vector": [4, 2, 0.8822, 0.023, 2, 0.42, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(opt.file) <= 1:\n plot_all = True\n else:\n plot_all = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L153_C12", "label": "plot_all =", "type": "assigned_variable", "loc": [153, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L152_C8", "vector": [14, 3, 0.8793, 0.0057, 3, 0.66, 0.0, 334, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "plot_all", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_all = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L155_C12", "label": "plot_all =", "type": "assigned_variable", "loc": [155, 155], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L152_C8", "vector": [14, 3, 0.8908, 0.0057, 3, 0.66, 1.0, 334, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "plot_all", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_all = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L157_C8", "label": "for i", "type": "for", "loc": [157, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L151_C4", "vector": [6, 2, 0.9052, 0.0115, 2, 0.42, 0.5, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(opt.file)):\n plot_classifier_performance(opt.file[i], opt.name[i], plot_all)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L158_C12", "label": "plot_classifier_performance()", "type": "expression", "loc": [158, 158], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L157_C8", "vector": [8, 3, 0.908, 0.0057, 3, 0.9, 0.0, 44, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_classifier_performance", "arg_names": [], "import_names": [], "rhs_call_name": "plot_classifier_performance", "annotation": ""}, "snippet": " plot_classifier_performance(opt.file[i], opt.name[i], plot_all)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L159_C8", "label": "show()", "type": "expression", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L151_C4", "vector": [8, 2, 0.9138, 0.0057, 2, 0.42, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " pb.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L161_C4", "label": "if", "type": "if", "loc": [161, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L142_C0", "vector": [4, 1, 0.931, 0.0172, 1, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.mode == 'features':\n plot_features_perf(opt.file, opt.name)\n pb.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L162_C8", "label": "plot_features_perf()", "type": "expression", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L161_C4", "vector": [8, 2, 0.931, 0.0057, 2, 0.66, 0.0, 364, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot_features_perf", "arg_names": [], "import_names": [], "rhs_call_name": "plot_features_perf", "annotation": ""}, "snippet": " plot_features_perf(opt.file, opt.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L163_C8", "label": "show()", "type": "expression", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L161_C4", "vector": [8, 2, 0.9368, 0.0057, 2, 0.66, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " pb.show()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Return_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L23_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L24_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L24_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L25_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L24_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L27_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L89_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L90_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L90_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L91_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L90_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L93_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Import_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Import_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L152_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L153_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L152_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Assign_L155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:For_L157_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99675:If_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99675:Expr_L163_C8"}]
import roslib; roslib.load_manifest('hai_sandbox') import rospy import hrl_lib.util as hru import pylab as pb import numpy as np import itertools as it import hrl_lib.rutils as ru import sys from cv_bridge.cv_bridge import CvBridge, CvBridgeError import scipy.spatial as sp import cv ## # @return mat, mat, array def contact_mat(contact_msgs): #start_time = contact_msgs[0].header.stamp.to_time() times = np.array([c.header.stamp.to_time() for c in contact_msgs]) #- start_time left, right = zip(*[[list(c.l_finger_tip), list(c.r_finger_tip)] for c in contact_msgs]) left = np.matrix(left).T right = np.matrix(right).T return left, right, times ## # @return array, array def find_contact_times(left_mat, right_mat, times): left_mat = left_mat - left_mat[:, 0] right_mat = right_mat - right_mat[:,0] #When/where did contact happen? #TODO: we are assuming just one finger of one arm here! loc_r, time_c = np.where(np.abs(left_mat) > 250) times_contact = times[time_c.A1] return loc_r, times_contact def group_by_first_el(a_list): d = {} for el in a_list: if not d.has_key(el[0]): d[el[0]] = [] d[el[0]].append(el) return d def get_closest_msgs(fname, topics, times): times_set = set(times) for top, msg, t in ru.bag_iter(fname, topics): msg_time = msg.header.stamp.to_time() if len(times_set.intersection([msg_time])) > 0: yield msg def find_contact_images(bag_name, contact_times, all_times, topic_name): print 'finding closest images for ', topic_name times_tree = sp.KDTree(np.matrix(all_times).T) closest_times = [all_times[times_tree.query([a_time])[1]] for a_time in contact_times] pdb.set_trace() print 'getting & saving images, expecting', len(set(closest_times)), 'images' bridge = CvBridge() cleaned_topic_name = topic_name.replace('/', '') i = 0 for ros_msg in get_closest_msgs(bag_name, [topic_name], closest_times): i = i + 1 msg_time = ros_msg.header.stamp.to_time() - all_times[0] cv_image = bridge.imgmsg_to_cv(ros_msg, 'bgr8') img_name = "%s_%.3f_touched.png" % (cleaned_topic_name, msg_time) print 'writing', img_name cv.SaveImage(img_name, cv_image) print 'got', i, 'images' fname = sys.argv[1] fname_wide = sys.argv[2] #fname_cloud = sys.argv[3] press_lt = '/pressure/l_gripper_motor' press_rt = '/pressure/r_gripper_motor' forearm_cam_l = '/l_forearm_cam/image_rect_color' ws_l = '/wide_stereo/left/image_rect_color' ws_r = '/wide_stereo/right/image_rect_color' cloud_top = '/full_cloud' print 'reading pressure messages' #Get the pressure messages msgs_dict = ru.bag_sel(fname, [press_lt, press_rt]) #Get the image times print 'getting image times' all_cam_times = group_by_first_el([[top, msg.header.stamp.to_time()] for top, msg, t in ru.bag_iter(fname_wide, [ws_l, ws_r])]) all_cam_times[forearm_cam_l] = [[top, msg.header.stamp.to_time()] for top, msg, t in ru.bag_iter(fname, [forearm_cam_l])] [msg.header.stamp.to_time() for top, msg, t in ru.bag_iter(fname, ['/wide_stereo/left/image_raw'])][0:4] print 'processing pressure' press_lmsgs = [msg for top, msg, t in msgs_dict[press_lt]] press_rmsgs = [msg for top, msg, t in msgs_dict[press_rt]] #ll_mat contains (contact_loc, contact_times) ll_mat, lr_mat, times_l = contact_mat(press_lmsgs) rl_mat, rr_mat, times_r = contact_mat(press_rmsgs) contact_loc, times_contact_pressure = find_contact_times(ll_mat, lr_mat, times_l) print 'contact loc', contact_loc #figure out which images are closest in time #note: each row is an instance in KDTrees, query return ([distance], [indices]) import pdb pdb.set_trace() #Maybe just get the range of messages around contact time? +/- a couple of messages? make that a bag? find_contact_images(fname, times_contact_pressure.copy(), [t for top, t in all_cam_times[forearm_cam_l]], forearm_cam_l) find_contact_images(fname_wide, times_contact_pressure.copy(), [t for top, t in all_cam_times[ws_l]], ws_l) find_contact_images(fname_wide, times_contact_pressure.copy(), [t for top, t in all_cam_times[ws_r]], ws_r) print 'plotting' #Plot readings pb.figure() for i in range(ll_mat.shape[0]): pb.plot(times_l, ll_mat[i,:].T.A1, label=str(i)) pb.legend() pb.show()
ajibawa-2023/Python-Code-Large/train/row_99676
86
123
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0081, 0.0081, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0081, 0.0081, 0, 0.66, 0.0213, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0163, 0.0081, 0, 0.66, 0.0426, 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_99676:Import_L3_C0", "label": "hrl_lib.util import hru", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0244, 0.0081, 0, 0.66, 0.0638, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["hru"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as hru"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Import_L4_C0", "label": "pylab import pb", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0325, 0.0081, 0, 0.66, 0.0851, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "pylab", "arg_names": [], "import_names": ["pb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pylab as pb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Import_L5_C0", "label": "numpy import np", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0407, 0.0081, 0, 0.66, 0.1064, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Import_L6_C0", "label": "itertools import it", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0488, 0.0081, 0, 0.66, 0.1277, 808, 0, 1, 0, 0, 808, 0, 0], "semantic": {"name": "itertools", "arg_names": [], "import_names": ["it"], "rhs_call_name": "", "annotation": ""}, "snippet": "import itertools as it"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Import_L7_C0", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0569, 0.0081, 0, 0.66, 0.1489, 847, 0, 1, 0, 0, 847, 0, 0], "semantic": {"name": "hrl_lib.rutils", "arg_names": [], "import_names": ["ru"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.rutils as ru"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Import_L8_C0", "label": "sys import sys", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.065, 0.0081, 0, 0.66, 0.1702, 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_99676:ImportFrom_L9_C0", "label": "from cv_bridge.cv_bridge import CvBridge, CvBridgeError", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0732, 0.0081, 0, 0.66, 0.1915, 356, 0, 2, 0, 0, 356, 0, 0], "semantic": {"name": "cv_bridge.cv_bridge", "arg_names": [], "import_names": ["CvBridge", "CvBridgeError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from cv_bridge.cv_bridge import CvBridge, CvBridgeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Import_L10_C0", "label": "scipy.spatial import sp", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0813, 0.0081, 0, 0.66, 0.2128, 384, 0, 1, 0, 0, 384, 0, 0], "semantic": {"name": "scipy.spatial", "arg_names": [], "import_names": ["sp"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.spatial as sp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Import_L11_C0", "label": "cv import cv", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0894, 0.0081, 0, 0.66, 0.234, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L15_C0", "label": "contact_mat", "type": "function", "loc": [15, 22], "level": 0, "parent": null, "vector": [2, 0, 0.1504, 0.065, 0, 0.66, 0.2553, 709, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "contact_mat", "arg_names": ["contact_msgs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def contact_mat(contact_msgs):\n #start_time = contact_msgs[0].header.stamp.to_time()\n times = np.array([c.header.stamp.to_time() for c in contact_msgs]) #- start_time\n left, right = zip(*[[list(c.l_finger_tip), list(c.r_finger_tip)] for c in contact_msgs])\n \n left = np.matrix(left).T\n right = np.matrix(right).T\n return left, right, times"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L17_C4", "label": "times = array()", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L15_C0", "vector": [14, 1, 0.1382, 0.0081, 1, 0.83, 0.0, 342, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "times", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " times = np.array([c.header.stamp.to_time() for c in contact_msgs]) #- start_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L18_C4", "label": "left, right = zip()", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L15_C0", "vector": [14, 1, 0.1463, 0.0081, 1, 0.83, 0.25, 628, 3, 1, 0, 0, 814, 10, 3], "semantic": {"name": "left, right", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " left, right = zip(*[[list(c.l_finger_tip), list(c.r_finger_tip)] for c in contact_msgs])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L20_C4", "label": "left =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L15_C0", "vector": [14, 1, 0.1626, 0.0081, 1, 0.83, 0.5, 605, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "left", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left = np.matrix(left).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L21_C4", "label": "right =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L15_C0", "vector": [14, 1, 0.1707, 0.0081, 1, 0.83, 0.75, 724, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " right = np.matrix(right).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Return_L22_C4", "label": "return", "type": "return", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L15_C0", "vector": [13, 1, 0.1789, 0.0081, 1, 0.83, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return left, right, times"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L27_C0", "label": "find_contact_times", "type": "function", "loc": [27, 36], "level": 0, "parent": null, "vector": [2, 0, 0.2561, 0.0813, 0, 0.66, 0.2766, 852, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "find_contact_times", "arg_names": ["left_mat", "right_mat", "times"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def find_contact_times(left_mat, right_mat, times):\n left_mat = left_mat - left_mat[:, 0] \n right_mat = right_mat - right_mat[:,0]\n \n #When/where did contact happen? \n #TODO: we are assuming just one finger of one arm here!\n loc_r, time_c = np.where(np.abs(left_mat) > 250)\n times_contact = times[time_c.A1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L28_C4", "label": "left_mat =", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L27_C0", "vector": [14, 1, 0.2276, 0.0081, 1, 0.48, 0.0, 524, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "left_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left_mat = left_mat - left_mat[:, 0] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L29_C4", "label": "right_mat =", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L27_C0", "vector": [14, 1, 0.2358, 0.0081, 1, 0.48, 0.25, 957, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "right_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " right_mat = right_mat - right_mat[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L33_C4", "label": "loc_r, time_c = where()", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L27_C0", "vector": [14, 1, 0.2683, 0.0081, 1, 0.48, 0.5, 412, 3, 1, 0, 0, 169, 10, 2], "semantic": {"name": "loc_r, time_c", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " loc_r, time_c = np.where(np.abs(left_mat) > 250)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L34_C4", "label": "times_contact =", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L27_C0", "vector": [14, 1, 0.2764, 0.0081, 1, 0.48, 0.75, 266, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "times_contact", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " times_contact = times[time_c.A1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Return_L36_C4", "label": "return", "type": "return", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L27_C0", "vector": [13, 1, 0.2927, 0.0081, 1, 0.48, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return loc_r, times_contact"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L38_C0", "label": "group_by_first_el", "type": "function", "loc": [38, 44], "level": 0, "parent": null, "vector": [2, 0, 0.3333, 0.0569, 0, 0.66, 0.2979, 923, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "group_by_first_el", "arg_names": ["a_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def group_by_first_el(a_list):\n d = {}\n for el in a_list:\n if not d.has_key(el[0]):\n d[el[0]] = []\n d[el[0]].append(el)\n return d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L39_C4", "label": "d =", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L38_C0", "vector": [14, 1, 0.3171, 0.0081, 1, 0.28, 0.0, 355, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L40_C4", "label": "for el", "type": "for", "loc": [40, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L38_C0", "vector": [6, 1, 0.3374, 0.0325, 1, 0.28, 0.5, 144, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "el", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for el in a_list:\n if not d.has_key(el[0]):\n d[el[0]] = []\n d[el[0]].append(el)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:If_L41_C8", "label": "if", "type": "if", "loc": [41, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L40_C4", "vector": [4, 2, 0.3374, 0.0163, 2, 0.63, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not d.has_key(el[0]):\n d[el[0]] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L42_C12", "label": "assign", "type": "assigned_variable", "loc": [42, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:If_L41_C8", "vector": [14, 3, 0.3415, 0.0081, 3, 0.29, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d[el[0]] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L43_C8", "label": "append()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L40_C4", "vector": [8, 2, 0.3496, 0.0081, 2, 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": " d[el[0]].append(el)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Return_L44_C4", "label": "return", "type": "return", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L38_C0", "vector": [13, 1, 0.3577, 0.0081, 1, 0.28, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L46_C0", "label": "get_closest_msgs", "type": "function", "loc": [46, 51], "level": 0, "parent": null, "vector": [2, 0, 0.3943, 0.0488, 0, 0.66, 0.3191, 204, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "get_closest_msgs", "arg_names": ["fname", "topics", "times"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_closest_msgs(fname, topics, times):\n times_set = set(times)\n for top, msg, t in ru.bag_iter(fname, topics):\n msg_time = msg.header.stamp.to_time()\n if len(times_set.intersection([msg_time])) > 0:\n yield msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L47_C4", "label": "times_set = set()", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L46_C0", "vector": [14, 1, 0.3821, 0.0081, 1, 0.87, 0.0, 876, 3, 1, 0, 0, 21, 10, 1], "semantic": {"name": "times_set", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " times_set = set(times)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L48_C4", "label": "for top, msg, t", "type": "for", "loc": [48, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L46_C0", "vector": [6, 1, 0.4024, 0.0325, 1, 0.87, 1.0, 958, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "top, msg, t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for top, msg, t in ru.bag_iter(fname, topics):\n msg_time = msg.header.stamp.to_time()\n if len(times_set.intersection([msg_time])) > 0:\n yield msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L49_C8", "label": "msg_time = to_time()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L48_C4", "vector": [14, 2, 0.3984, 0.0081, 2, 0.92, 0.0, 757, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "msg_time", "arg_names": [], "import_names": [], "rhs_call_name": "to_time", "annotation": ""}, "snippet": " msg_time = msg.header.stamp.to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:If_L50_C8", "label": "if", "type": "if", "loc": [50, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L48_C4", "vector": [4, 2, 0.4106, 0.0163, 2, 0.92, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(times_set.intersection([msg_time])) > 0:\n yield msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L51_C12", "label": "expression", "type": "expression", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:If_L50_C8", "vector": [8, 3, 0.4146, 0.0081, 3, 0.34, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L53_C0", "label": "find_contact_images", "type": "function", "loc": [53, 70], "level": 0, "parent": null, "vector": [2, 0, 0.5, 0.1463, 0, 0.66, 0.3404, 705, 0, 4, 0, 0, 0, 0, 16], "semantic": {"name": "find_contact_images", "arg_names": ["bag_name", "contact_times", "all_times", "topic_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def find_contact_images(bag_name, contact_times, all_times, topic_name):\n print('finding closest images for ', topic_name)\n times_tree = sp.KDTree(np.matrix(all_times).T)\n closest_times = [all_times[times_tree.query([a_time])[1]] for a_time in contact_times]\n pdb.set_trace()\n \n print('getting & saving images, expecting', len(set(closest_times)), 'images')\n bridge = CvBridge()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L54_C4", "label": "print()", "type": "expression", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L53_C0", "vector": [8, 1, 0.439, 0.0081, 1, 0.0, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('finding closest images for ', topic_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L55_C4", "label": "times_tree = KDTree()", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L53_C0", "vector": [14, 1, 0.4472, 0.0081, 1, 0.0, 0.1111, 954, 3, 1, 0, 0, 940, 10, 2], "semantic": {"name": "times_tree", "arg_names": [], "import_names": [], "rhs_call_name": "KDTree", "annotation": ""}, "snippet": " times_tree = sp.KDTree(np.matrix(all_times).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L56_C4", "label": "closest_times =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L53_C0", "vector": [14, 1, 0.4553, 0.0081, 1, 0.0, 0.2222, 903, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "closest_times", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " closest_times = [all_times[times_tree.query([a_time])[1]] for a_time in contact_times]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L57_C4", "label": "set_trace()", "type": "expression", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L53_C0", "vector": [8, 1, 0.4634, 0.0081, 1, 0.0, 0.3333, 796, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_trace", "arg_names": [], "import_names": [], "rhs_call_name": "set_trace", "annotation": ""}, "snippet": " pdb.set_trace()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L59_C4", "label": "print()", "type": "expression", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L53_C0", "vector": [8, 1, 0.4797, 0.0081, 1, 0.0, 0.4444, 535, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('getting & saving images, expecting', len(set(closest_times)), 'images')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L60_C4", "label": "bridge = CvBridge()", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L53_C0", "vector": [14, 1, 0.4878, 0.0081, 1, 0.0, 0.5556, 658, 3, 0, 0, 0, 439, 10, 1], "semantic": {"name": "bridge", "arg_names": [], "import_names": [], "rhs_call_name": "CvBridge", "annotation": ""}, "snippet": " bridge = CvBridge()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L61_C4", "label": "cleaned_topic_name = replace()", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L53_C0", "vector": [14, 1, 0.4959, 0.0081, 1, 0.0, 0.6667, 461, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "cleaned_topic_name", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " cleaned_topic_name = topic_name.replace('/', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L62_C4", "label": "i =", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L53_C0", "vector": [14, 1, 0.5041, 0.0081, 1, 0.0, 0.7778, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L63_C4", "label": "for ros_msg", "type": "for", "loc": [63, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L53_C0", "vector": [6, 1, 0.5366, 0.0569, 1, 0.0, 0.8889, 397, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "ros_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for ros_msg in get_closest_msgs(bag_name, [topic_name], closest_times):\n i = i + 1\n msg_time = ros_msg.header.stamp.to_time() - all_times[0]\n cv_image = bridge.imgmsg_to_cv(ros_msg, 'bgr8')\n img_name = \"%s_%.3f_touched.png\" % (cleaned_topic_name, msg_time)\n print('writing', img_name)\n cv.SaveImage(img_name, cv_image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L64_C8", "label": "i =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L63_C4", "vector": [14, 2, 0.5203, 0.0081, 2, 0.18, 0.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L65_C8", "label": "msg_time =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L63_C4", "vector": [14, 2, 0.5285, 0.0081, 2, 0.18, 0.2, 757, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "msg_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg_time = ros_msg.header.stamp.to_time() - all_times[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L66_C8", "label": "cv_image = imgmsg_to_cv()", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L63_C4", "vector": [14, 2, 0.5366, 0.0081, 2, 0.18, 0.4, 550, 3, 2, 0, 0, 181, 10, 1], "semantic": {"name": "cv_image", "arg_names": [], "import_names": [], "rhs_call_name": "imgmsg_to_cv", "annotation": ""}, "snippet": " cv_image = bridge.imgmsg_to_cv(ros_msg, 'bgr8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L67_C8", "label": "img_name =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L63_C4", "vector": [14, 2, 0.5447, 0.0081, 2, 0.18, 0.6, 460, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "img_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " img_name = \"%s_%.3f_touched.png\" % (cleaned_topic_name, msg_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L68_C8", "label": "print()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L63_C4", "vector": [8, 2, 0.5528, 0.0081, 2, 0.18, 0.8, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('writing', img_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L69_C8", "label": "SaveImage()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L63_C4", "vector": [8, 2, 0.561, 0.0081, 2, 0.18, 1.0, 91, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "SaveImage", "arg_names": [], "import_names": [], "rhs_call_name": "SaveImage", "annotation": ""}, "snippet": " cv.SaveImage(img_name, cv_image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L70_C4", "label": "print()", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L53_C0", "vector": [8, 1, 0.5691, 0.0081, 1, 0.0, 1.0, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('got', i, 'images')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L73_C0", "label": "fname =", "type": "assigned_variable", "loc": [73, 73], "level": 0, "parent": null, "vector": [14, 0, 0.5935, 0.0081, 0, 0.66, 0.3617, 190, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "fname = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L74_C0", "label": "fname_wide =", "type": "assigned_variable", "loc": [74, 74], "level": 0, "parent": null, "vector": [14, 0, 0.6016, 0.0081, 0, 0.66, 0.383, 385, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fname_wide", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "fname_wide = sys.argv[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L77_C0", "label": "press_lt =", "type": "assigned_variable", "loc": [77, 77], "level": 0, "parent": null, "vector": [14, 0, 0.626, 0.0081, 0, 0.66, 0.4043, 436, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "press_lt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "press_lt = '/pressure/l_gripper_motor'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L78_C0", "label": "press_rt =", "type": "assigned_variable", "loc": [78, 78], "level": 0, "parent": null, "vector": [14, 0, 0.6341, 0.0081, 0, 0.66, 0.4255, 107, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "press_rt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "press_rt = '/pressure/r_gripper_motor'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L79_C0", "label": "forearm_cam_l =", "type": "assigned_variable", "loc": [79, 79], "level": 0, "parent": null, "vector": [14, 0, 0.6423, 0.0081, 0, 0.66, 0.4468, 246, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "forearm_cam_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "forearm_cam_l = '/l_forearm_cam/image_rect_color'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L80_C0", "label": "ws_l =", "type": "assigned_variable", "loc": [80, 80], "level": 0, "parent": null, "vector": [14, 0, 0.6504, 0.0081, 0, 0.66, 0.4681, 657, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ws_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ws_l = '/wide_stereo/left/image_rect_color'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L81_C0", "label": "ws_r =", "type": "assigned_variable", "loc": [81, 81], "level": 0, "parent": null, "vector": [14, 0, 0.6585, 0.0081, 0, 0.66, 0.4894, 524, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ws_r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ws_r = '/wide_stereo/right/image_rect_color'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L82_C0", "label": "cloud_top =", "type": "assigned_variable", "loc": [82, 82], "level": 0, "parent": null, "vector": [14, 0, 0.6667, 0.0081, 0, 0.66, 0.5106, 433, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "cloud_top", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "cloud_top = '/full_cloud'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L84_C0", "label": "print()", "type": "expression", "loc": [84, 84], "level": 0, "parent": null, "vector": [8, 0, 0.6829, 0.0081, 0, 0.66, 0.5319, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('reading pressure messages')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L86_C0", "label": "msgs_dict = bag_sel()", "type": "assigned_variable", "loc": [86, 86], "level": 0, "parent": null, "vector": [14, 0, 0.6992, 0.0081, 0, 0.66, 0.5532, 932, 3, 2, 0, 0, 463, 10, 1], "semantic": {"name": "msgs_dict", "arg_names": [], "import_names": [], "rhs_call_name": "bag_sel", "annotation": ""}, "snippet": "msgs_dict = ru.bag_sel(fname, [press_lt, press_rt])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L89_C0", "label": "print()", "type": "expression", "loc": [89, 89], "level": 0, "parent": null, "vector": [8, 0, 0.7236, 0.0081, 0, 0.66, 0.5745, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('getting image times')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L90_C0", "label": "all_cam_times = group_by_first_el()", "type": "assigned_variable", "loc": [90, 90], "level": 0, "parent": null, "vector": [14, 0, 0.7317, 0.0081, 0, 0.66, 0.5957, 535, 3, 1, 0, 0, 923, 10, 3], "semantic": {"name": "all_cam_times", "arg_names": [], "import_names": [], "rhs_call_name": "group_by_first_el", "annotation": ""}, "snippet": "all_cam_times = group_by_first_el([[top, msg.header.stamp.to_time()] for top, msg, t in ru.bag_iter(fname_wide, [ws_l, ws_r])])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L91_C0", "label": "assign", "type": "assigned_variable", "loc": [91, 91], "level": 0, "parent": null, "vector": [14, 0, 0.7398, 0.0081, 0, 0.66, 0.617, 0, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "all_cam_times[forearm_cam_l] = [[top, msg.header.stamp.to_time()] for top, msg, t in ru.bag_iter(fname, [forearm_cam_l])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L93_C0", "label": "expression", "type": "expression", "loc": [93, 93], "level": 0, "parent": null, "vector": [8, 0, 0.7561, 0.0081, 0, 0.66, 0.6383, 0, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "[msg.header.stamp.to_time() for top, msg, t in ru.bag_iter(fname, ['/wide_stereo/left/image_raw'])][0:4]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L95_C0", "label": "print()", "type": "expression", "loc": [95, 95], "level": 0, "parent": null, "vector": [8, 0, 0.7724, 0.0081, 0, 0.66, 0.6596, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('processing pressure')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L96_C0", "label": "press_lmsgs =", "type": "assigned_variable", "loc": [96, 96], "level": 0, "parent": null, "vector": [14, 0, 0.7805, 0.0081, 0, 0.66, 0.6809, 488, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "press_lmsgs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "press_lmsgs = [msg for top, msg, t in msgs_dict[press_lt]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L97_C0", "label": "press_rmsgs =", "type": "assigned_variable", "loc": [97, 97], "level": 0, "parent": null, "vector": [14, 0, 0.7886, 0.0081, 0, 0.66, 0.7021, 705, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "press_rmsgs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "press_rmsgs = [msg for top, msg, t in msgs_dict[press_rt]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L100_C0", "label": "ll_mat, lr_mat, times_l = contact_mat()", "type": "assigned_variable", "loc": [100, 100], "level": 0, "parent": null, "vector": [14, 0, 0.813, 0.0081, 0, 0.66, 0.7234, 947, 3, 1, 0, 0, 709, 10, 1], "semantic": {"name": "ll_mat, lr_mat, times_l", "arg_names": [], "import_names": [], "rhs_call_name": "contact_mat", "annotation": ""}, "snippet": "ll_mat, lr_mat, times_l = contact_mat(press_lmsgs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L101_C0", "label": "rl_mat, rr_mat, times_r = contact_mat()", "type": "assigned_variable", "loc": [101, 101], "level": 0, "parent": null, "vector": [14, 0, 0.8211, 0.0081, 0, 0.66, 0.7447, 158, 3, 1, 0, 0, 709, 10, 1], "semantic": {"name": "rl_mat, rr_mat, times_r", "arg_names": [], "import_names": [], "rhs_call_name": "contact_mat", "annotation": ""}, "snippet": "rl_mat, rr_mat, times_r = contact_mat(press_rmsgs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L102_C0", "label": "contact_loc, times_contact_pressure = find_contact_times()", "type": "assigned_variable", "loc": [102, 102], "level": 0, "parent": null, "vector": [14, 0, 0.8293, 0.0081, 0, 0.66, 0.766, 379, 3, 3, 0, 0, 852, 10, 1], "semantic": {"name": "contact_loc, times_contact_pressure", "arg_names": [], "import_names": [], "rhs_call_name": "find_contact_times", "annotation": ""}, "snippet": "contact_loc, times_contact_pressure = find_contact_times(ll_mat, lr_mat, times_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L103_C0", "label": "print()", "type": "expression", "loc": [103, 103], "level": 0, "parent": null, "vector": [8, 0, 0.8374, 0.0081, 0, 0.66, 0.7872, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('contact loc', contact_loc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Import_L107_C0", "label": "pdb import pdb", "type": "import", "loc": [107, 107], "level": 0, "parent": null, "vector": [1, 0, 0.8699, 0.0081, 0, 0.66, 0.8085, 91, 0, 1, 0, 0, 91, 0, 0], "semantic": {"name": "pdb", "arg_names": [], "import_names": ["pdb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pdb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L108_C0", "label": "set_trace()", "type": "expression", "loc": [108, 108], "level": 0, "parent": null, "vector": [8, 0, 0.878, 0.0081, 0, 0.66, 0.8298, 796, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_trace", "arg_names": [], "import_names": [], "rhs_call_name": "set_trace", "annotation": ""}, "snippet": "pdb.set_trace()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L110_C0", "label": "find_contact_images()", "type": "expression", "loc": [110, 110], "level": 0, "parent": null, "vector": [8, 0, 0.8943, 0.0081, 0, 0.66, 0.8511, 705, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "find_contact_images", "arg_names": [], "import_names": [], "rhs_call_name": "find_contact_images", "annotation": ""}, "snippet": "find_contact_images(fname, times_contact_pressure.copy(), [t for top, t in all_cam_times[forearm_cam_l]], forearm_cam_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L111_C0", "label": "find_contact_images()", "type": "expression", "loc": [111, 111], "level": 0, "parent": null, "vector": [8, 0, 0.9024, 0.0081, 0, 0.66, 0.8723, 705, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "find_contact_images", "arg_names": [], "import_names": [], "rhs_call_name": "find_contact_images", "annotation": ""}, "snippet": "find_contact_images(fname_wide, times_contact_pressure.copy(), [t for top, t in all_cam_times[ws_l]], ws_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L112_C0", "label": "find_contact_images()", "type": "expression", "loc": [112, 112], "level": 0, "parent": null, "vector": [8, 0, 0.9106, 0.0081, 0, 0.66, 0.8936, 705, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "find_contact_images", "arg_names": [], "import_names": [], "rhs_call_name": "find_contact_images", "annotation": ""}, "snippet": "find_contact_images(fname_wide, times_contact_pressure.copy(), [t for top, t in all_cam_times[ws_r]], ws_r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L114_C0", "label": "print()", "type": "expression", "loc": [114, 114], "level": 0, "parent": null, "vector": [8, 0, 0.9268, 0.0081, 0, 0.66, 0.9149, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('plotting')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L116_C0", "label": "figure()", "type": "expression", "loc": [116, 116], "level": 0, "parent": null, "vector": [8, 0, 0.9431, 0.0081, 0, 0.66, 0.9362, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": "pb.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L117_C0", "label": "for i", "type": "for", "loc": [117, 118], "level": 0, "parent": null, "vector": [6, 0, 0.9553, 0.0163, 0, 0.66, 0.9574, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for i in range(ll_mat.shape[0]):\n pb.plot(times_l, ll_mat[i,:].T.A1, label=str(i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L118_C4", "label": "plot()", "type": "expression", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L117_C0", "vector": [8, 1, 0.9593, 0.0081, 1, 0.95, 0.0, 929, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pb.plot(times_l, ll_mat[i,:].T.A1, label=str(i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L119_C0", "label": "legend()", "type": "expression", "loc": [119, 119], "level": 0, "parent": null, "vector": [8, 0, 0.9675, 0.0081, 0, 0.66, 0.9787, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": "pb.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L120_C0", "label": "show()", "type": "expression", "loc": [120, 120], "level": 0, "parent": null, "vector": [8, 0, 0.9756, 0.0081, 0, 0.66, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": "pb.show()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Return_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Return_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:If_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:If_L41_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Return_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:If_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99676:For_L117_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99676:Expr_L118_C4"}]
import roslib; roslib.load_manifest('hai_sandbox') import rospy import sensor_msgs.msg as sm import hrl_lib.rutils as ru import numpy as np import pr2_msgs.msg as pm import geometry_msgs.msg as gm import tf import hrl_lib.tf_utils as tfu import tf.transformations as tr import time import hrl_lib.util as ut import pdb def np_to_pointcloud(points_mat, frame): pc = sm.PointCloud() pc.header.stamp = rospy.get_rostime() pc.header.frame_id = frame #pdb.set_trace() for i in range(points_mat.shape[1]): p32 = gm.Point32() p32.x = points_mat[0,i] p32.y = points_mat[1,i] p32.z = points_mat[2,i] pc.points.append(p32) return pc if __name__ == '__main__': #load pickle import sys #import pdb pname = sys.argv[1] #which frame are these contact points in? (base_link) scene, contact_points = ut.load_pickle(pname) #pdb.set_trace() #t, tip_locs # [len4 list, len4 list... ] #plot 3D cloud & contact location! = > using? rviz? rospy.init_node('test10') contact_pub = rospy.Publisher('contact_cloud', sm.PointCloud) touchll_pub = rospy.Publisher('touch_ll', sm.PointCloud) touchlr_pub = rospy.Publisher('touch_lr', sm.PointCloud) left_contact, right_contact = zip(*[(np.matrix(l[1][2]).T, np.matrix(l[1][3]).T) for l in contact_points]) left_contact = np.column_stack(left_contact) right_contact = np.column_stack(right_contact) scene_pc = np_to_pointcloud(scene, 'base_footprint') left_con_pc = np_to_pointcloud(left_contact, 'base_footprint') right_con_pc = np_to_pointcloud(right_contact, 'base_footprint') r = rospy.Rate(10) rospy.loginfo('test10: publishing') while not rospy.is_shutdown(): contact_pub.publish(scene_pc) touchll_pub.publish(left_con_pc) touchlr_pub.publish(right_con_pc) r.sleep()
ajibawa-2023/Python-Code-Large/train/row_99677
46
100
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.01, 0.01, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.01, 0.01, 0, 0.66, 0.0667, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.02, 0.01, 0, 0.66, 0.1333, 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_99677:Import_L3_C0", "label": "sensor_msgs.msg import sm", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.03, 0.01, 0, 0.66, 0.2, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["sm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sensor_msgs.msg as sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Import_L4_C0", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.04, 0.01, 0, 0.66, 0.2667, 847, 0, 1, 0, 0, 847, 0, 0], "semantic": {"name": "hrl_lib.rutils", "arg_names": [], "import_names": ["ru"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.rutils as ru"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Import_L5_C0", "label": "numpy import np", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.01, 0, 0.66, 0.3333, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Import_L6_C0", "label": "pr2_msgs.msg import pm", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.06, 0.01, 0, 0.66, 0.4, 797, 0, 1, 0, 0, 797, 0, 0], "semantic": {"name": "pr2_msgs.msg", "arg_names": [], "import_names": ["pm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pr2_msgs.msg as pm "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Import_L7_C0", "label": "geometry_msgs.msg import gm", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.07, 0.01, 0, 0.66, 0.4667, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["gm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import geometry_msgs.msg as gm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Import_L8_C0", "label": "tf import tf", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.08, 0.01, 0, 0.66, 0.5333, 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_99677:Import_L9_C0", "label": "hrl_lib.tf_utils import tfu", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.09, 0.01, 0, 0.66, 0.6, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "hrl_lib.tf_utils", "arg_names": [], "import_names": ["tfu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.tf_utils as tfu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Import_L10_C0", "label": "tf.transformations import tr", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.01, 0, 0.66, 0.6667, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Import_L11_C0", "label": "time import time", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.11, 0.01, 0, 0.66, 0.7333, 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_99677:Import_L12_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.12, 0.01, 0, 0.66, 0.8, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Import_L13_C0", "label": "pdb import pdb", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.13, 0.01, 0, 0.66, 0.8667, 91, 0, 1, 0, 0, 91, 0, 0], "semantic": {"name": "pdb", "arg_names": [], "import_names": ["pdb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pdb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:FunctionDef_L15_C0", "label": "np_to_pointcloud", "type": "function", "loc": [15, 26], "level": 0, "parent": null, "vector": [2, 0, 0.205, 0.12, 0, 0.66, 0.9333, 712, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "np_to_pointcloud", "arg_names": ["points_mat", "frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def np_to_pointcloud(points_mat, frame):\n pc = sm.PointCloud()\n pc.header.stamp = rospy.get_rostime()\n pc.header.frame_id = frame\n #pdb.set_trace()\n for i in range(points_mat.shape[1]):\n p32 = gm.Point32()\n p32.x = points_mat[0,i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L16_C4", "label": "pc = PointCloud()", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:FunctionDef_L15_C0", "vector": [14, 1, 0.16, 0.01, 1, 0.94, 0.0, 876, 3, 0, 0, 0, 428, 10, 1], "semantic": {"name": "pc", "arg_names": [], "import_names": [], "rhs_call_name": "PointCloud", "annotation": ""}, "snippet": " pc = sm.PointCloud()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L17_C4", "label": "pc.header.stamp = get_rostime()", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:FunctionDef_L15_C0", "vector": [14, 1, 0.17, 0.01, 1, 0.94, 0.25, 600, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "pc.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " pc.header.stamp = rospy.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L18_C4", "label": "pc.header.frame_id =", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:FunctionDef_L15_C0", "vector": [14, 1, 0.18, 0.01, 1, 0.94, 0.5, 62, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pc.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.header.frame_id = frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:For_L20_C4", "label": "for i", "type": "for", "loc": [20, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:FunctionDef_L15_C0", "vector": [6, 1, 0.225, 0.06, 1, 0.94, 0.75, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(points_mat.shape[1]):\n p32 = gm.Point32()\n p32.x = points_mat[0,i]\n p32.y = points_mat[1,i]\n p32.z = points_mat[2,i]\n pc.points.append(p32)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L21_C8", "label": "p32 = Point32()", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:For_L20_C4", "vector": [14, 2, 0.21, 0.01, 2, 0.34, 0.0, 87, 3, 0, 0, 0, 485, 10, 1], "semantic": {"name": "p32", "arg_names": [], "import_names": [], "rhs_call_name": "Point32", "annotation": ""}, "snippet": " p32 = gm.Point32()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L22_C8", "label": "p32.x =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:For_L20_C4", "vector": [14, 2, 0.22, 0.01, 2, 0.34, 0.25, 912, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p32.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p32.x = points_mat[0,i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L23_C8", "label": "p32.y =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:For_L20_C4", "vector": [14, 2, 0.23, 0.01, 2, 0.34, 0.5, 212, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p32.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p32.y = points_mat[1,i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L24_C8", "label": "p32.z =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:For_L20_C4", "vector": [14, 2, 0.24, 0.01, 2, 0.34, 0.75, 726, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p32.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p32.z = points_mat[2,i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Expr_L25_C8", "label": "append()", "type": "expression", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:For_L20_C4", "vector": [8, 2, 0.25, 0.01, 2, 0.34, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " pc.points.append(p32)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Return_L26_C4", "label": "return", "type": "return", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:FunctionDef_L15_C0", "vector": [13, 1, 0.26, 0.01, 1, 0.94, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "label": "if", "type": "if", "loc": [28, 60], "level": 0, "parent": null, "vector": [4, 0, 0.44, 0.33, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 20], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n #load pickle\n import sys\n #import pdb\n pname = sys.argv[1]\n\n #which frame are these contact points in? (base_link)\n scene, contact_points = ut.load_pickle(pname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Import_L30_C4", "label": "sys import sys", "type": "import", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "vector": [1, 1, 0.3, 0.01, 1, 0.42, 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_99677:Assign_L32_C4", "label": "pname =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "vector": [14, 1, 0.32, 0.01, 1, 0.42, 0.0667, 10, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pname = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L35_C4", "label": "scene, contact_points = load_pickle()", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "vector": [14, 1, 0.35, 0.01, 1, 0.42, 0.1333, 686, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "scene, contact_points", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " scene, contact_points = ut.load_pickle(pname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Expr_L41_C4", "label": "init_node()", "type": "expression", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "vector": [8, 1, 0.41, 0.01, 1, 0.42, 0.2, 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('test10')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L42_C4", "label": "contact_pub = Publisher()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "vector": [14, 1, 0.42, 0.01, 1, 0.42, 0.2667, 640, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "contact_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " contact_pub = rospy.Publisher('contact_cloud', sm.PointCloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L43_C4", "label": "touchll_pub = Publisher()", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "vector": [14, 1, 0.43, 0.01, 1, 0.42, 0.3333, 857, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "touchll_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " touchll_pub = rospy.Publisher('touch_ll', sm.PointCloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L44_C4", "label": "touchlr_pub = Publisher()", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "vector": [14, 1, 0.44, 0.01, 1, 0.42, 0.4, 602, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "touchlr_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " touchlr_pub = rospy.Publisher('touch_lr', sm.PointCloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L46_C4", "label": "left_contact, right_contact = zip()", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "vector": [14, 1, 0.46, 0.01, 1, 0.42, 0.4667, 351, 3, 1, 0, 0, 814, 10, 3], "semantic": {"name": "left_contact, right_contact", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " left_contact, right_contact = zip(*[(np.matrix(l[1][2]).T, np.matrix(l[1][3]).T) for l in contact_points])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L47_C4", "label": "left_contact = column_stack()", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "vector": [14, 1, 0.47, 0.01, 1, 0.42, 0.5333, 942, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "left_contact", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " left_contact = np.column_stack(left_contact)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L48_C4", "label": "right_contact = column_stack()", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "vector": [14, 1, 0.48, 0.01, 1, 0.42, 0.6, 751, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "right_contact", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " right_contact = np.column_stack(right_contact)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L50_C4", "label": "scene_pc = np_to_pointcloud()", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "vector": [14, 1, 0.5, 0.01, 1, 0.42, 0.6667, 452, 3, 2, 0, 0, 712, 10, 1], "semantic": {"name": "scene_pc", "arg_names": [], "import_names": [], "rhs_call_name": "np_to_pointcloud", "annotation": ""}, "snippet": " scene_pc = np_to_pointcloud(scene, 'base_footprint')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L51_C4", "label": "left_con_pc = np_to_pointcloud()", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "vector": [14, 1, 0.51, 0.01, 1, 0.42, 0.7333, 637, 3, 2, 0, 0, 712, 10, 1], "semantic": {"name": "left_con_pc", "arg_names": [], "import_names": [], "rhs_call_name": "np_to_pointcloud", "annotation": ""}, "snippet": " left_con_pc = np_to_pointcloud(left_contact, 'base_footprint')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L52_C4", "label": "right_con_pc = np_to_pointcloud()", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "vector": [14, 1, 0.52, 0.01, 1, 0.42, 0.8, 525, 3, 2, 0, 0, 712, 10, 1], "semantic": {"name": "right_con_pc", "arg_names": [], "import_names": [], "rhs_call_name": "np_to_pointcloud", "annotation": ""}, "snippet": " right_con_pc = np_to_pointcloud(right_contact, 'base_footprint')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L54_C4", "label": "r = Rate()", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "vector": [14, 1, 0.54, 0.01, 1, 0.42, 0.8667, 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_99677:Expr_L55_C4", "label": "loginfo()", "type": "expression", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "vector": [8, 1, 0.55, 0.01, 1, 0.42, 0.9333, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('test10: publishing')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:While_L56_C4", "label": "while", "type": "while", "loc": [56, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "vector": [5, 1, 0.58, 0.05, 1, 0.42, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n contact_pub.publish(scene_pc)\n touchll_pub.publish(left_con_pc)\n touchlr_pub.publish(right_con_pc)\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Expr_L57_C8", "label": "publish()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:While_L56_C4", "vector": [8, 2, 0.57, 0.01, 2, 0.21, 0.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " contact_pub.publish(scene_pc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Expr_L58_C8", "label": "publish()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:While_L56_C4", "vector": [8, 2, 0.58, 0.01, 2, 0.21, 0.3333, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " touchll_pub.publish(left_con_pc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Expr_L59_C8", "label": "publish()", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:While_L56_C4", "vector": [8, 2, 0.59, 0.01, 2, 0.21, 0.6667, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " touchlr_pub.publish(right_con_pc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99677:Expr_L60_C8", "label": "sleep()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99677:While_L56_C4", "vector": [8, 2, 0.6, 0.01, 2, 0.21, 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()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99677:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:For_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:For_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:For_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:For_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:For_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:For_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Expr_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Return_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Import_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Expr_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Expr_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:While_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:While_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:While_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:While_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99677:While_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99677:Expr_L60_C8"}]
import roslib; roslib.load_manifest('hai_sandbox') import rospy import actionlib import pr2_controllers_msgs.msg as pr2m import trajectory_msgs.msg as tm import sensor_msgs.msg as sm import cv class Arm: def __init__(self, name): self.joint_names = rospy.get_param('/%s/joints' % name) self.client = actionlib.SimpleActionClient('/%s/joint_trajectory_action' % name, pr2m.JointTrajectoryAction) rospy.loginfo('waiting for server') self.client.wait_for_server() self.recorded = [] class JointTrajRecordReplay: def __init__(self): self.left_arm = Arm('l_arm_controller') self.right_arm = Arm('r_arm_controller') self.names_index = None rospy.Subscriber("joint_states", sm.JointState, self.joint_state_cb) cv.NamedWindow('keyboard_input', 1) self.exit = False def rarm_goal(self, g): self.right_arm.client.send_goal(g) self.right_arm.client.wait_for_result() return self.right_arm.client.get_result() def get_joint_states(self, msg): if self.names_index == None: self.names_index = {} for i, n in enumerate(msg.name): self.names_index[n] = i positions = [[msg.position[self.names_index[n]] for n in names_list] for names_list in [self.right_arm.joint_names, self.left_arm.joint_names]] rpos = positions[0] lpos = positions[1] return lpos, rpos def construct_points(self, posl, tstep): points = [tm.JointTrajectoryPoint() for i in range(len(posl))] for i in range(len(posl)): points[i].positions = posl[i] points[i].velocities = [0 for j in range(7)] for i in range(len(posl)): points[i].time_from_start = rospy.Duration(i*tstep) return points def joint_state_cb(self, msg): k = chr(cv.WaitKey(1) & 0xff) if k == 'r': lpos, rpos = self.get_joint_states(msg) self.left_arm.recorded.append(lpos) self.right_arm.recorded.append(rpos) rospy.loginfo('Recorded \nr: %s \nl: %s' % (str(rpos), str(lpos))) elif k == chr(27): self.exit = True elif k == 'p': #Construct points lpos, rpos = self.get_joint_states(msg) rospy.loginfo('playing back') tstep = 2.0 l = list(self.right_arm.recorded) l.append(self.right_arm.recorded[0]) l.insert(0, rpos) points = self.construct_points(l, tstep) g = pr2m.JointTrajectoryGoal() g.trajectory.joint_names = self.right_arm.joint_names g.trajectory.points = points #g.trajectory.header.stamp = rospy.get_rostime() + rospy.Duration(len(l) * tstep) g.trajectory.header.stamp = rospy.get_rostime() + rospy.Duration(0) self.right_arm.client.send_goal(g) if __name__ == '__main__': try: rospy.init_node('traj_client') jtr = JointTrajRecordReplay() r = rospy.Rate(10) while not rospy.is_shutdown(): r.sleep() if jtr.exit: rospy.loginfo('exiting') break except rospy.ROSInterruptException: print 'prog interrupted' # def sample_goal(self): # points = [tm.JointTrajectoryPoint() for i in range(3)] # points[0].positions = [-.21, .44, -.56, -1.03, -13.1, -.089, -10.1377] # points[1].positions = [-.21, .21, -.51, -1.55, -13.18, -.856, -10.1] # points[2].positions = [-.21, .44, -.56, -1.03, -13.1, -.089, -10.1377] # for i in range(3): # points[i].velocities = [0 for j in range(7)] # # g = pr2m.JointTrajectoryGoal() # g.trajectory.joint_names = self.right_arm.joint_names # g.trajectory.points = points # g.trajectory.header.stamp = rospy.get_rostime() + rospy.Duration(3.) # g.trajectory.points[0].time_from_start = rospy.Duration(2.0/2) # g.trajectory.points[1].time_from_start = rospy.Duration(4.0/2) # g.trajectory.points[2].time_from_start = rospy.Duration(6.0/2) # return g #
ajibawa-2023/Python-Code-Large/train/row_99679
76
133
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0075, 0.0075, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0075, 0.0075, 0, 0.66, 0.1, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.015, 0.0075, 0, 0.66, 0.2, 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_99679:Import_L3_C0", "label": "actionlib import actionlib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0226, 0.0075, 0, 0.66, 0.3, 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_99679:Import_L4_C0", "label": "pr2_controllers_msgs.msg import pr2m", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0301, 0.0075, 0, 0.66, 0.4, 457, 0, 1, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["pr2m"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pr2_controllers_msgs.msg as pr2m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Import_L5_C0", "label": "trajectory_msgs.msg import tm", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0376, 0.0075, 0, 0.66, 0.5, 485, 0, 1, 0, 0, 485, 0, 0], "semantic": {"name": "trajectory_msgs.msg", "arg_names": [], "import_names": ["tm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import trajectory_msgs.msg as tm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Import_L6_C0", "label": "sensor_msgs.msg import sm", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0451, 0.0075, 0, 0.66, 0.6, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["sm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sensor_msgs.msg as sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Import_L7_C0", "label": "cv import cv", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0075, 0, 0.66, 0.7, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:ClassDef_L9_C0", "label": "Arm", "type": "class", "loc": [9, 15], "level": 0, "parent": null, "vector": [3, 0, 0.0902, 0.0526, 0, 0.66, 0.8, 739, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "Arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Arm:\n def __init__(self, name):\n self.joint_names = rospy.get_param('/%s/joints' % name)\n self.client = actionlib.SimpleActionClient('/%s/joint_trajectory_action' % name, pr2m.JointTrajectoryAction)\n rospy.loginfo('waiting for server')\n self.client.wait_for_server()\n self.recorded = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L10_C4", "label": "__init__", "type": "function", "loc": [10, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:ClassDef_L9_C0", "vector": [2, 1, 0.094, 0.0451, 1, 0.9, 0.0, 555, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name):\n self.joint_names = rospy.get_param('/%s/joints' % name)\n self.client = actionlib.SimpleActionClient('/%s/joint_trajectory_action' % name, pr2m.JointTrajectoryAction)\n rospy.loginfo('waiting for server')\n self.client.wait_for_server()\n self.recorded = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L11_C8", "label": "self.joint_names = get_param()", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L10_C4", "vector": [14, 2, 0.0827, 0.0075, 2, 0.74, 0.0, 338, 3, 1, 0, 0, 427, 10, 1], "semantic": {"name": "self.joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": " self.joint_names = rospy.get_param('/%s/joints' % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L12_C8", "label": "self.client = SimpleActionClient()", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L10_C4", "vector": [14, 2, 0.0902, 0.0075, 2, 0.74, 0.25, 349, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.client = actionlib.SimpleActionClient('/%s/joint_trajectory_action' % name, pr2m.JointTrajectoryAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L13_C8", "label": "loginfo()", "type": "expression", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L10_C4", "vector": [8, 2, 0.0977, 0.0075, 2, 0.74, 0.5, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('waiting for server')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L14_C8", "label": "wait_for_server()", "type": "expression", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L10_C4", "vector": [8, 2, 0.1053, 0.0075, 2, 0.74, 0.75, 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.client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L15_C8", "label": "self.recorded =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L10_C4", "vector": [14, 2, 0.1128, 0.0075, 2, 0.74, 1.0, 984, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.recorded", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.recorded = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:ClassDef_L17_C0", "label": "JointTrajRecordReplay", "type": "class", "loc": [17, 77], "level": 0, "parent": null, "vector": [3, 0, 0.3534, 0.4586, 0, 0.66, 0.9, 733, 0, 5, 0, 0, 0, 0, 36], "semantic": {"name": "JointTrajRecordReplay", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class JointTrajRecordReplay:\n\n def __init__(self):\n self.left_arm = Arm('l_arm_controller')\n self.right_arm = Arm('r_arm_controller')\n self.names_index = None\n rospy.Subscriber(\"joint_states\", sm.JointState, self.joint_state_cb)\n cv.NamedWindow('keyboard_input', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L19_C4", "label": "__init__", "type": "function", "loc": [19, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:ClassDef_L17_C0", "vector": [2, 1, 0.1654, 0.0526, 1, 0.43, 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.left_arm = Arm('l_arm_controller')\n self.right_arm = Arm('r_arm_controller')\n self.names_index = None\n rospy.Subscriber(\"joint_states\", sm.JointState, self.joint_state_cb)\n cv.NamedWindow('keyboard_input', 1)\n self.exit = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L20_C8", "label": "self.left_arm = Arm()", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L19_C4", "vector": [14, 2, 0.1504, 0.0075, 2, 0.55, 0.0, 676, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.left_arm", "arg_names": [], "import_names": [], "rhs_call_name": "Arm", "annotation": ""}, "snippet": " self.left_arm = Arm('l_arm_controller')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L21_C8", "label": "self.right_arm = Arm()", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L19_C4", "vector": [14, 2, 0.1579, 0.0075, 2, 0.55, 0.2, 803, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.right_arm", "arg_names": [], "import_names": [], "rhs_call_name": "Arm", "annotation": ""}, "snippet": " self.right_arm = Arm('r_arm_controller')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L22_C8", "label": "self.names_index =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L19_C4", "vector": [14, 2, 0.1654, 0.0075, 2, 0.55, 0.4, 519, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.names_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.names_index = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L23_C8", "label": "Subscriber()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L19_C4", "vector": [8, 2, 0.1729, 0.0075, 2, 0.55, 0.6, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber(\"joint_states\", sm.JointState, self.joint_state_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L24_C8", "label": "NamedWindow()", "type": "expression", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L19_C4", "vector": [8, 2, 0.1805, 0.0075, 2, 0.55, 0.8, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow('keyboard_input', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L25_C8", "label": "self.exit =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L19_C4", "vector": [14, 2, 0.188, 0.0075, 2, 0.55, 1.0, 569, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.exit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.exit = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L27_C4", "label": "rarm_goal", "type": "function", "loc": [27, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:ClassDef_L17_C0", "vector": [2, 1, 0.2143, 0.0301, 1, 0.43, 0.25, 553, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "rarm_goal", "arg_names": ["self", "g"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def rarm_goal(self, g):\n self.right_arm.client.send_goal(g)\n self.right_arm.client.wait_for_result()\n return self.right_arm.client.get_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L28_C8", "label": "send_goal()", "type": "expression", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L27_C4", "vector": [8, 2, 0.2105, 0.0075, 2, 0.69, 0.0, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.right_arm.client.send_goal(g)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L29_C8", "label": "wait_for_result()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L27_C4", "vector": [8, 2, 0.218, 0.0075, 2, 0.69, 0.5, 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.right_arm.client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Return_L30_C8", "label": "return", "type": "return", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L27_C4", "vector": [13, 2, 0.2256, 0.0075, 2, 0.69, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.right_arm.client.get_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L32_C4", "label": "get_joint_states", "type": "function", "loc": [32, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:ClassDef_L17_C0", "vector": [2, 1, 0.2707, 0.0677, 1, 0.43, 0.5, 716, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "get_joint_states", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_joint_states(self, msg):\n if self.names_index == None:\n self.names_index = {}\n for i, n in enumerate(msg.name):\n self.names_index[n] = i\n positions = [[msg.position[self.names_index[n]] for n in names_list] for names_list in [self.right_arm.joint_names, self.left_arm.joint_names]]\n rpos = positions[0]\n lpos = positions[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L33_C8", "label": "if", "type": "if", "loc": [33, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L32_C4", "vector": [4, 2, 0.2594, 0.0301, 2, 0.75, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.names_index == None:\n self.names_index = {}\n for i, n in enumerate(msg.name):\n self.names_index[n] = i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L34_C12", "label": "self.names_index =", "type": "assigned_variable", "loc": [34, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L33_C8", "vector": [14, 3, 0.2556, 0.0075, 3, 0.58, 0.0, 519, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.names_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.names_index = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:For_L35_C12", "label": "for i, n", "type": "for", "loc": [35, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L33_C8", "vector": [6, 3, 0.2669, 0.015, 3, 0.58, 1.0, 217, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i, n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, n in enumerate(msg.name):\n self.names_index[n] = i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L36_C16", "label": "assign", "type": "assigned_variable", "loc": [36, 36], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:For_L35_C12", "vector": [14, 4, 0.2707, 0.0075, 4, 0.31, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.names_index[n] = i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L37_C8", "label": "positions =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L32_C4", "vector": [14, 2, 0.2782, 0.0075, 2, 0.75, 0.25, 320, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "positions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " positions = [[msg.position[self.names_index[n]] for n in names_list] for names_list in [self.right_arm.joint_names, self.left_arm.joint_names]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L38_C8", "label": "rpos =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L32_C4", "vector": [14, 2, 0.2857, 0.0075, 2, 0.75, 0.5, 846, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rpos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rpos = positions[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L39_C8", "label": "lpos =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L32_C4", "vector": [14, 2, 0.2932, 0.0075, 2, 0.75, 0.75, 567, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lpos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lpos = positions[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Return_L40_C8", "label": "return", "type": "return", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L32_C4", "vector": [13, 2, 0.3008, 0.0075, 2, 0.75, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return lpos, rpos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L42_C4", "label": "construct_points", "type": "function", "loc": [42, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:ClassDef_L17_C0", "vector": [2, 1, 0.3421, 0.0602, 1, 0.43, 0.75, 427, 0, 3, 1, 0, 0, 0, 9], "semantic": {"name": "construct_points", "arg_names": ["self", "posl", "tstep"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def construct_points(self, posl, tstep):\n points = [tm.JointTrajectoryPoint() for i in range(len(posl))]\n for i in range(len(posl)):\n points[i].positions = posl[i]\n points[i].velocities = [0 for j in range(7)]\n for i in range(len(posl)):\n points[i].time_from_start = rospy.Duration(i*tstep)\n return points"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L43_C8", "label": "points =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L42_C4", "vector": [14, 2, 0.3233, 0.0075, 2, 0.48, 0.0, 738, 5, 0, 0, 0, 0, 0, 3], "semantic": {"name": "points", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " points = [tm.JointTrajectoryPoint() for i in range(len(posl))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:For_L44_C8", "label": "for i", "type": "for", "loc": [44, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L42_C4", "vector": [6, 2, 0.3383, 0.0226, 2, 0.48, 0.3333, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(posl)):\n points[i].positions = posl[i]\n points[i].velocities = [0 for j in range(7)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L45_C12", "label": "points[i].positions =", "type": "assigned_variable", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:For_L44_C8", "vector": [14, 3, 0.3383, 0.0075, 3, 0.94, 0.0, 379, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "points[i].positions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " points[i].positions = posl[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L46_C12", "label": "points[i].velocities =", "type": "assigned_variable", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:For_L44_C8", "vector": [14, 3, 0.3459, 0.0075, 3, 0.94, 1.0, 925, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "points[i].velocities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " points[i].velocities = [0 for j in range(7)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:For_L47_C8", "label": "for i", "type": "for", "loc": [47, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L42_C4", "vector": [6, 2, 0.3571, 0.015, 2, 0.48, 0.6667, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(posl)):\n points[i].time_from_start = rospy.Duration(i*tstep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L48_C12", "label": "points[i].time_from_start = Duration()", "type": "assigned_variable", "loc": [48, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:For_L47_C8", "vector": [14, 3, 0.3609, 0.0075, 3, 0.47, 0.0, 300, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "points[i].time_from_start", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " points[i].time_from_start = rospy.Duration(i*tstep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Return_L49_C8", "label": "return", "type": "return", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L42_C4", "vector": [13, 2, 0.3684, 0.0075, 2, 0.48, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return points"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L51_C4", "label": "joint_state_cb", "type": "function", "loc": [51, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:ClassDef_L17_C0", "vector": [2, 1, 0.4812, 0.203, 1, 0.43, 1.0, 340, 0, 2, 0, 0, 0, 0, 19], "semantic": {"name": "joint_state_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def joint_state_cb(self, msg):\n k = chr(cv.WaitKey(1) & 0xff)\n if k == 'r':\n lpos, rpos = self.get_joint_states(msg)\n self.left_arm.recorded.append(lpos)\n self.right_arm.recorded.append(rpos)\n rospy.loginfo('Recorded \\nr: %s \\nl: %s' % (str(rpos), str(lpos)))\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L52_C8", "label": "k = chr()", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L51_C4", "vector": [14, 2, 0.391, 0.0075, 2, 0.77, 0.0, 954, 3, 1, 0, 0, 915, 10, 2], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "chr", "annotation": ""}, "snippet": " k = chr(cv.WaitKey(1) & 0xff)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L53_C8", "label": "if", "type": "if", "loc": [53, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L51_C4", "vector": [4, 2, 0.4887, 0.188, 2, 0.77, 1.0, 0, 0, 0, 0, 0, 0, 0, 17], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if k == 'r':\n lpos, rpos = self.get_joint_states(msg)\n self.left_arm.recorded.append(lpos)\n self.right_arm.recorded.append(rpos)\n rospy.loginfo('Recorded \\nr: %s \\nl: %s' % (str(rpos), str(lpos)))\n\n elif k == chr(27):\n self.exit = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L54_C12", "label": "lpos, rpos = get_joint_states()", "type": "assigned_variable", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L53_C8", "vector": [14, 3, 0.406, 0.0075, 3, 0.2, 0.0, 986, 3, 1, 0, 0, 716, 10, 1], "semantic": {"name": "lpos, rpos", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_states", "annotation": ""}, "snippet": " lpos, rpos = self.get_joint_states(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L55_C12", "label": "append()", "type": "expression", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L53_C8", "vector": [8, 3, 0.4135, 0.0075, 3, 0.2, 0.25, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.left_arm.recorded.append(lpos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L56_C12", "label": "append()", "type": "expression", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L53_C8", "vector": [8, 3, 0.4211, 0.0075, 3, 0.2, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.right_arm.recorded.append(rpos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L57_C12", "label": "loginfo()", "type": "expression", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L53_C8", "vector": [8, 3, 0.4286, 0.0075, 3, 0.2, 0.75, 607, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Recorded \\nr: %s \\nl: %s' % (str(rpos), str(lpos)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L59_C8", "label": "if", "type": "if", "loc": [59, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L53_C8", "vector": [4, 3, 0.5113, 0.1429, 3, 0.2, 1.0, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif k == chr(27):\n self.exit = True\n\n elif k == 'p':\n #Construct points\n lpos, rpos = self.get_joint_states(msg)\n rospy.loginfo('playing back')\n tstep = 2.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L60_C12", "label": "self.exit =", "type": "assigned_variable", "loc": [60, 60], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L59_C8", "vector": [14, 4, 0.4511, 0.0075, 4, 0.37, 0.0, 569, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.exit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.exit = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "label": "if", "type": "if", "loc": [62, 77], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L59_C8", "vector": [4, 4, 0.5226, 0.1203, 4, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif k == 'p':\n #Construct points\n lpos, rpos = self.get_joint_states(msg)\n rospy.loginfo('playing back')\n tstep = 2.0\n l = list(self.right_arm.recorded)\n l.append(self.right_arm.recorded[0])\n l.insert(0, rpos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L64_C12", "label": "lpos, rpos = get_joint_states()", "type": "assigned_variable", "loc": [64, 64], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "vector": [14, 5, 0.4812, 0.0075, 5, 0.79, 0.0, 986, 3, 1, 0, 0, 716, 10, 1], "semantic": {"name": "lpos, rpos", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_states", "annotation": ""}, "snippet": " lpos, rpos = self.get_joint_states(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L65_C12", "label": "loginfo()", "type": "expression", "loc": [65, 65], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "vector": [8, 5, 0.4887, 0.0075, 5, 0.79, 0.0909, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('playing back')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L66_C12", "label": "tstep =", "type": "assigned_variable", "loc": [66, 66], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "vector": [14, 5, 0.4962, 0.0075, 5, 0.79, 0.1818, 433, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "tstep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tstep = 2.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L67_C12", "label": "l = list()", "type": "assigned_variable", "loc": [67, 67], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "vector": [14, 5, 0.5038, 0.0075, 5, 0.79, 0.2727, 810, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " l = list(self.right_arm.recorded)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L68_C12", "label": "append()", "type": "expression", "loc": [68, 68], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "vector": [8, 5, 0.5113, 0.0075, 5, 0.79, 0.3636, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " l.append(self.right_arm.recorded[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L69_C12", "label": "insert()", "type": "expression", "loc": [69, 69], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "vector": [8, 5, 0.5188, 0.0075, 5, 0.79, 0.4545, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " l.insert(0, rpos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L70_C12", "label": "points = construct_points()", "type": "assigned_variable", "loc": [70, 70], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "vector": [14, 5, 0.5263, 0.0075, 5, 0.79, 0.5455, 738, 3, 2, 0, 0, 427, 10, 1], "semantic": {"name": "points", "arg_names": [], "import_names": [], "rhs_call_name": "construct_points", "annotation": ""}, "snippet": " points = self.construct_points(l, tstep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L72_C12", "label": "g = JointTrajectoryGoal()", "type": "assigned_variable", "loc": [72, 72], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "vector": [14, 5, 0.5414, 0.0075, 5, 0.79, 0.6364, 384, 3, 0, 0, 0, 970, 10, 1], "semantic": {"name": "g", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectoryGoal", "annotation": ""}, "snippet": " g = pr2m.JointTrajectoryGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L73_C12", "label": "g.trajectory.joint_names =", "type": "assigned_variable", "loc": [73, 73], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "vector": [14, 5, 0.5489, 0.0075, 5, 0.79, 0.7273, 255, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "g.trajectory.joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " g.trajectory.joint_names = self.right_arm.joint_names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L74_C12", "label": "g.trajectory.points =", "type": "assigned_variable", "loc": [74, 74], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "vector": [14, 5, 0.5564, 0.0075, 5, 0.79, 0.8182, 5, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "g.trajectory.points", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " g.trajectory.points = points"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L76_C12", "label": "g.trajectory.header.stamp =", "type": "assigned_variable", "loc": [76, 76], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "vector": [14, 5, 0.5714, 0.0075, 5, 0.79, 0.9091, 981, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "g.trajectory.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " g.trajectory.header.stamp = rospy.get_rostime() + rospy.Duration(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L77_C12", "label": "send_goal()", "type": "expression", "loc": [77, 77], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "vector": [8, 5, 0.5789, 0.0075, 5, 0.79, 1.0, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.right_arm.client.send_goal(g)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L80_C0", "label": "if", "type": "if", "loc": [80, 91], "level": 0, "parent": null, "vector": [4, 0, 0.6429, 0.0902, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n try:\n rospy.init_node('traj_client')\n jtr = JointTrajRecordReplay()\n r = rospy.Rate(10)\n while not rospy.is_shutdown():\n r.sleep()\n if jtr.exit:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Try_L81_C4", "label": "try", "type": "try", "loc": [81, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L80_C0", "vector": [7, 1, 0.6466, 0.0827, 1, 0.1, 0.0, 0, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node('traj_client')\n jtr = JointTrajRecordReplay()\n r = rospy.Rate(10)\n while not rospy.is_shutdown():\n r.sleep()\n if jtr.exit:\n rospy.loginfo('exiting')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L82_C8", "label": "init_node()", "type": "expression", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:Try_L81_C4", "vector": [8, 2, 0.6165, 0.0075, 2, 0.7, 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('traj_client')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L83_C8", "label": "jtr = JointTrajRecordReplay()", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:Try_L81_C4", "vector": [14, 2, 0.6241, 0.0075, 2, 0.7, 0.3333, 484, 3, 0, 0, 0, 733, 10, 1], "semantic": {"name": "jtr", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajRecordReplay", "annotation": ""}, "snippet": " jtr = JointTrajRecordReplay()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L84_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:Try_L81_C4", "vector": [14, 2, 0.6316, 0.0075, 2, 0.7, 0.6667, 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_99679:While_L85_C8", "label": "while", "type": "while", "loc": [85, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:Try_L81_C4", "vector": [5, 2, 0.6541, 0.0376, 2, 0.7, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n r.sleep()\n if jtr.exit:\n rospy.loginfo('exiting')\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L86_C12", "label": "sleep()", "type": "expression", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:While_L85_C8", "vector": [8, 3, 0.6466, 0.0075, 3, 0.25, 0.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_99679:If_L87_C12", "label": "if", "type": "if", "loc": [87, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:While_L85_C8", "vector": [4, 3, 0.6617, 0.0226, 3, 0.25, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if jtr.exit:\n rospy.loginfo('exiting')\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L88_C16", "label": "loginfo()", "type": "expression", "loc": [88, 88], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L87_C12", "vector": [8, 4, 0.6617, 0.0075, 4, 0.1, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('exiting')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L91_C8", "label": "print()", "type": "expression", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99679:Try_L81_C4", "vector": [8, 2, 0.6842, 0.0075, 2, 0.7, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('prog interrupted')"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99679:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Return_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L34_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:For_L35_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:For_L35_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L36_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Return_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:For_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:For_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:For_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:For_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:For_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Return_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L70_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L77_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Try_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:Try_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:Try_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:Try_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:Try_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:While_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:While_L85_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:While_L85_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:If_L87_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L88_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99679:Try_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99679:Expr_L91_C8"}]
import roslib; roslib.load_manifest('hai_sandbox') import rospy import message_filters from sensor_msgs.msg import Image from sensor_msgs.msg import PointCloud2 import feature_extractor_fpfh.msg as fmsg import pdb def callback(image, fpfh_hist): print "got messages!" #print image.header.frame_id, fpfh_hist.header.frame_id print image.header.stamp.to_sec(), fpfh_hist.header.stamp.to_sec() def fpfh_cb(fpfh): #print fpfh.header.frame_id print '>>', fpfh.header.stamp.to_sec() #pdb.set_trace() def image_cb(image): #print "image", image.header.frame_id print image.header.stamp.to_sec() rospy.init_node('kinect_features') image_sub = message_filters.Subscriber('/camera/rgb/image_color', Image) fpfh_hist_sub = message_filters.Subscriber('fpfh_hist', fmsg.FPFHHist) depth_sub = message_filters.Subscriber('/camera/depth/points2', PointCloud2) #ts = message_filters.TimeSynchronizer([image_sub, fpfh_hist_sub], 10) ts = message_filters.TimeSynchronizer([image_sub, depth_sub], 10) ts.registerCallback(callback) #rospy.Subscriber('fpfh_hist', fmsg.FPFHHist, fpfh_cb) #rospy.Subscriber('/camera/rgb/image_color', Image, image_cb) print 'reading and spinning!' rospy.spin()
ajibawa-2023/Python-Code-Large/train/row_99680
23
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_99680:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0278, 0.0278, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99680:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0278, 0.0278, 0, 0.66, 0.0556, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99680:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0556, 0.0278, 0, 0.66, 0.1111, 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_99680:Import_L3_C0", "label": "message_filters import message_filters", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0278, 0, 0.66, 0.1667, 512, 0, 1, 0, 0, 512, 0, 0], "semantic": {"name": "message_filters", "arg_names": [], "import_names": ["message_filters"], "rhs_call_name": "", "annotation": ""}, "snippet": "import message_filters"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99680:ImportFrom_L4_C0", "label": "from sensor_msgs.msg import Image", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.0278, 0, 0.66, 0.2222, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["Image"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import Image"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99680:ImportFrom_L5_C0", "label": "from sensor_msgs.msg import PointCloud2", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1389, 0.0278, 0, 0.66, 0.2778, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["PointCloud2"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import PointCloud2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99680:Import_L6_C0", "label": "feature_extractor_fpfh.msg import fmsg", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.0278, 0, 0.66, 0.3333, 660, 0, 1, 0, 0, 660, 0, 0], "semantic": {"name": "feature_extractor_fpfh.msg", "arg_names": [], "import_names": ["fmsg"], "rhs_call_name": "", "annotation": ""}, "snippet": "import feature_extractor_fpfh.msg as fmsg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99680:Import_L7_C0", "label": "pdb import pdb", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1944, 0.0278, 0, 0.66, 0.3889, 91, 0, 1, 0, 0, 91, 0, 0], "semantic": {"name": "pdb", "arg_names": [], "import_names": ["pdb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pdb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99680:FunctionDef_L10_C0", "label": "callback", "type": "function", "loc": [10, 13], "level": 0, "parent": null, "vector": [2, 0, 0.3194, 0.1111, 0, 0.66, 0.4444, 342, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "callback", "arg_names": ["image", "fpfh_hist"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def callback(image, fpfh_hist):\n print(\"got messages!\")\n #print image.header.frame_id, fpfh_hist.header.frame_id\n print(image.header.stamp.to_sec(), fpfh_hist.header.stamp.to_sec())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99680:Expr_L11_C2", "label": "print()", "type": "expression", "loc": [11, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99680:FunctionDef_L10_C0", "vector": [8, 1, 0.3056, 0.0278, 1, 0.62, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"got messages!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99680:Expr_L13_C2", "label": "print()", "type": "expression", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99680:FunctionDef_L10_C0", "vector": [8, 1, 0.3611, 0.0278, 1, 0.62, 1.0, 535, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(image.header.stamp.to_sec(), fpfh_hist.header.stamp.to_sec())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99680:FunctionDef_L15_C0", "label": "fpfh_cb", "type": "function", "loc": [15, 17], "level": 0, "parent": null, "vector": [2, 0, 0.4444, 0.0833, 0, 0.66, 0.5, 203, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "fpfh_cb", "arg_names": ["fpfh"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def fpfh_cb(fpfh):\n #print fpfh.header.frame_id\n print('>>', fpfh.header.stamp.to_sec())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99680:Expr_L17_C2", "label": "print()", "type": "expression", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99680:FunctionDef_L15_C0", "vector": [8, 1, 0.4722, 0.0278, 1, 0.52, 0.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('>>', fpfh.header.stamp.to_sec())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99680:FunctionDef_L20_C0", "label": "image_cb", "type": "function", "loc": [20, 22], "level": 0, "parent": null, "vector": [2, 0, 0.5833, 0.0833, 0, 0.66, 0.5556, 757, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "image_cb", "arg_names": ["image"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def image_cb(image):\n #print \"image\", image.header.frame_id\n print(image.header.stamp.to_sec())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99680:Expr_L22_C2", "label": "print()", "type": "expression", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99680:FunctionDef_L20_C0", "vector": [8, 1, 0.6111, 0.0278, 1, 0.78, 0.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(image.header.stamp.to_sec())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99680:Expr_L24_C0", "label": "init_node()", "type": "expression", "loc": [24, 24], "level": 0, "parent": null, "vector": [8, 0, 0.6667, 0.0278, 0, 0.66, 0.6111, 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('kinect_features')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99680:Assign_L25_C0", "label": "image_sub = Subscriber()", "type": "assigned_variable", "loc": [25, 25], "level": 0, "parent": null, "vector": [14, 0, 0.6944, 0.0278, 0, 0.66, 0.6667, 680, 3, 2, 0, 0, 455, 10, 1], "semantic": {"name": "image_sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": "image_sub = message_filters.Subscriber('/camera/rgb/image_color', Image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99680:Assign_L26_C0", "label": "fpfh_hist_sub = Subscriber()", "type": "assigned_variable", "loc": [26, 26], "level": 0, "parent": null, "vector": [14, 0, 0.7222, 0.0278, 0, 0.66, 0.7222, 687, 3, 2, 0, 0, 455, 10, 1], "semantic": {"name": "fpfh_hist_sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": "fpfh_hist_sub = message_filters.Subscriber('fpfh_hist', fmsg.FPFHHist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99680:Assign_L27_C0", "label": "depth_sub = Subscriber()", "type": "assigned_variable", "loc": [27, 27], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.0278, 0, 0.66, 0.7778, 169, 3, 2, 0, 0, 455, 10, 1], "semantic": {"name": "depth_sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": "depth_sub = message_filters.Subscriber('/camera/depth/points2', PointCloud2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99680:Assign_L30_C0", "label": "ts = TimeSynchronizer()", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.8333, 0.0278, 0, 0.66, 0.8333, 278, 3, 2, 0, 0, 347, 10, 1], "semantic": {"name": "ts", "arg_names": [], "import_names": [], "rhs_call_name": "TimeSynchronizer", "annotation": ""}, "snippet": "ts = message_filters.TimeSynchronizer([image_sub, depth_sub], 10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99680:Expr_L31_C0", "label": "registerCallback()", "type": "expression", "loc": [31, 31], "level": 0, "parent": null, "vector": [8, 0, 0.8611, 0.0278, 0, 0.66, 0.8889, 505, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "registerCallback", "arg_names": [], "import_names": [], "rhs_call_name": "registerCallback", "annotation": ""}, "snippet": "ts.registerCallback(callback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99680:Expr_L34_C0", "label": "print()", "type": "expression", "loc": [34, 34], "level": 0, "parent": null, "vector": [8, 0, 0.9444, 0.0278, 0, 0.66, 0.9444, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('reading and spinning!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99680:Expr_L35_C0", "label": "spin()", "type": "expression", "loc": [35, 35], "level": 0, "parent": null, "vector": [8, 0, 0.9722, 0.0278, 0, 0.66, 1.0, 17, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "spin", "arg_names": [], "import_names": [], "rhs_call_name": "spin", "annotation": ""}, "snippet": "rospy.spin()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99680:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99680:Expr_L11_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99680:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99680:Expr_L13_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99680:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99680:Expr_L17_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99680:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99680:Expr_L22_C2"}]
import numpy as np import pdb def max_wrt_constrain(a, b, constraint_f, toler): return find_split(a, None, b, None, constraint_f, toler) def min_wrt_constrain(a, b, constraint_f, toler): return find_split(b, None, a, None, constraint_f, toler) def find_split(a, qa, b, qb, constraint_f, toler): #pdb.set_trace() print 'a', a, qa, 'b', b, qb #assume we're maximizing (or going towards b) if abs(b - a) < toler: if qb == True: return b elif qa == True: return a else: raise RuntimeError('min interval reached without finding a point that returns success') else: nqb = constraint_f(b) if nqb: return b else: mid = (a + b) / 2.0 nmid = constraint_f(mid) if not nmid: return find_split(a, qa, mid, nmid, constraint_f, toler) else: return find_split(mid, True, b, nqb, constraint_f, toler) def my_func(input): if input > 5.5: return True else: return False #print 'returned', find_split(-10.0, None, 20, None, my_func, .2) print 'returned', find_split(20.0, None, -10., None, my_func, .1)
ajibawa-2023/Python-Code-Large/train/row_99681
26
42
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99681:Import_L1_C0", "label": "numpy import np", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0238, 0.0238, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:Import_L2_C0", "label": "pdb import pdb", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0238, 0, 0.66, 0.1667, 91, 0, 1, 0, 0, 91, 0, 0], "semantic": {"name": "pdb", "arg_names": [], "import_names": ["pdb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pdb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:FunctionDef_L4_C0", "label": "max_wrt_constrain", "type": "function", "loc": [4, 5], "level": 0, "parent": null, "vector": [2, 0, 0.1071, 0.0476, 0, 0.66, 0.3333, 667, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "max_wrt_constrain", "arg_names": ["a", "b", "constraint_f", "toler"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def max_wrt_constrain(a, b, constraint_f, toler):\n return find_split(a, None, b, None, constraint_f, toler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:Return_L5_C4", "label": "return", "type": "return", "loc": [5, 5], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99681:FunctionDef_L4_C0", "vector": [13, 1, 0.119, 0.0238, 1, 0.28, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return find_split(a, None, b, None, constraint_f, toler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:FunctionDef_L7_C0", "label": "min_wrt_constrain", "type": "function", "loc": [7, 8], "level": 0, "parent": null, "vector": [2, 0, 0.1786, 0.0476, 0, 0.66, 0.5, 288, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "min_wrt_constrain", "arg_names": ["a", "b", "constraint_f", "toler"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def min_wrt_constrain(a, b, constraint_f, toler):\n return find_split(b, None, a, None, constraint_f, toler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:Return_L8_C4", "label": "return", "type": "return", "loc": [8, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99681:FunctionDef_L7_C0", "vector": [13, 1, 0.1905, 0.0238, 1, 0.83, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return find_split(b, None, a, None, constraint_f, toler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:FunctionDef_L10_C0", "label": "find_split", "type": "function", "loc": [10, 33], "level": 0, "parent": null, "vector": [2, 0, 0.5119, 0.5714, 0, 0.66, 0.6667, 419, 0, 6, 1, 0, 0, 0, 7], "semantic": {"name": "find_split", "arg_names": ["a", "qa", "b", "qb", "constraint_f", "toler"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def find_split(a, qa, b, qb, constraint_f, toler):\n #pdb.set_trace()\n print('a', a, qa, 'b', b, qb)\n #assume we're maximizing (or going towards b)\n if abs(b - a) < toler:\n if qb == True:\n return b\n elif qa == True:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:Expr_L12_C4", "label": "print()", "type": "expression", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99681:FunctionDef_L10_C0", "vector": [8, 1, 0.2857, 0.0238, 1, 0.43, 0.0, 535, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('a', a, qa, 'b', b, qb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L14_C4", "label": "if", "type": "if", "loc": [14, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99681:FunctionDef_L10_C0", "vector": [4, 1, 0.5595, 0.4762, 1, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if abs(b - a) < toler:\n if qb == True:\n return b\n elif qa == True:\n return a\n else:\n raise RuntimeError('min interval reached without finding a point that returns success')\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L15_C8", "label": "if", "type": "if", "loc": [15, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L14_C4", "vector": [4, 2, 0.4167, 0.1429, 2, 0.55, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if qb == True:\n return b\n elif qa == True:\n return a\n else:\n raise RuntimeError('min interval reached without finding a point that returns success')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:Return_L16_C12", "label": "return", "type": "return", "loc": [16, 16], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L15_C8", "vector": [13, 3, 0.381, 0.0238, 3, 0.68, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return b"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L17_C8", "label": "if", "type": "if", "loc": [17, 20], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L15_C8", "vector": [4, 3, 0.4405, 0.0952, 3, 0.68, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif qa == True:\n return a\n else:\n raise RuntimeError('min interval reached without finding a point that returns success')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:Return_L18_C12", "label": "return", "type": "return", "loc": [18, 18], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L17_C8", "vector": [13, 4, 0.4286, 0.0238, 4, 0.06, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return a"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:Assign_L22_C8", "label": "nqb = constraint_f()", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L14_C4", "vector": [14, 2, 0.5238, 0.0238, 2, 0.55, 0.5, 169, 3, 1, 0, 0, 877, 10, 1], "semantic": {"name": "nqb", "arg_names": [], "import_names": [], "rhs_call_name": "constraint_f", "annotation": ""}, "snippet": " nqb = constraint_f(b)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L24_C8", "label": "if", "type": "if", "loc": [24, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L14_C4", "vector": [4, 2, 0.6786, 0.2381, 2, 0.55, 1.0, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if nqb:\n return b\n\n else:\n mid = (a + b) / 2.0\n nmid = constraint_f(mid)\n if not nmid:\n return find_split(a, qa, mid, nmid, constraint_f, toler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:Return_L25_C12", "label": "return", "type": "return", "loc": [25, 25], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L24_C8", "vector": [13, 3, 0.5952, 0.0238, 3, 0.97, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return b"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:Assign_L28_C12", "label": "mid =", "type": "assigned_variable", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L24_C8", "vector": [14, 3, 0.6667, 0.0238, 3, 0.97, 0.3333, 254, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mid = (a + b) / 2.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:Assign_L29_C12", "label": "nmid = constraint_f()", "type": "assigned_variable", "loc": [29, 29], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L24_C8", "vector": [14, 3, 0.6905, 0.0238, 3, 0.97, 0.6667, 187, 3, 1, 0, 0, 877, 10, 1], "semantic": {"name": "nmid", "arg_names": [], "import_names": [], "rhs_call_name": "constraint_f", "annotation": ""}, "snippet": " nmid = constraint_f(mid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L30_C12", "label": "if", "type": "if", "loc": [30, 33], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L24_C8", "vector": [4, 3, 0.75, 0.0952, 3, 0.97, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not nmid:\n return find_split(a, qa, mid, nmid, constraint_f, toler)\n else:\n return find_split(mid, True, b, nqb, constraint_f, toler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:Return_L31_C16", "label": "return", "type": "return", "loc": [31, 31], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L30_C12", "vector": [13, 4, 0.7381, 0.0238, 4, 0.17, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return find_split(a, qa, mid, nmid, constraint_f, toler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:Return_L33_C16", "label": "return", "type": "return", "loc": [33, 33], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L30_C12", "vector": [13, 4, 0.7857, 0.0238, 4, 0.17, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return find_split(mid, True, b, nqb, constraint_f, toler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:FunctionDef_L35_C0", "label": "my_func", "type": "function", "loc": [35, 39], "level": 0, "parent": null, "vector": [2, 0, 0.881, 0.119, 0, 0.66, 0.8333, 862, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "my_func", "arg_names": ["input"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def my_func(input):\n if input > 5.5:\n return True\n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L36_C4", "label": "if", "type": "if", "loc": [36, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99681:FunctionDef_L35_C0", "vector": [4, 1, 0.8929, 0.0952, 1, 0.07, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if input > 5.5:\n return True\n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:Return_L37_C8", "label": "return", "type": "return", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L36_C4", "vector": [13, 2, 0.881, 0.0238, 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 True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99681:Return_L39_C8", "label": "return", "type": "return", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L36_C4", "vector": [13, 2, 0.9286, 0.0238, 2, 0.32, 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_99681:Expr_L42_C0", "label": "print()", "type": "expression", "loc": [42, 42], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.0238, 0, 0.66, 1.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('returned', find_split(20.0, None, -10., None, my_func, .1))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99681:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99681:Return_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99681:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99681:Return_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99681:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99681:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99681:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L15_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99681:Return_L16_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L15_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L17_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99681:Return_L18_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99681:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L24_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99681:Return_L25_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L24_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99681:Assign_L28_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L24_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99681:Assign_L29_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L24_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L30_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99681:Return_L31_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L30_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99681:Return_L33_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99681:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99681:Return_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99681:If_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99681:Return_L39_C8"}]
import roslib; roslib.load_manifest('hai_sandbox') import rospy import pr2_msgs.msg as pm import time import hrl_lib.util as hru class DataAccumulate: def __init__(self, topic, type): rospy.Subscriber(topic, type, self.callback) self.data = [] self.headers = [] self.t = None def callback(self, msg): msg.header.stamp = msg.header.stamp.to_time() self.data.append(msg) self.t = time.time() def done(self): if self.t != None: return (time.time() - self.t) > 2. else: return False if __name__ == '__main__': import sys rospy.init_node('test01') d = DataAccumulate('/pressure/l_gripper_motor', pm.PressureState) r = rospy.Rate(10) while not rospy.is_shutdown(): if d.done(): break print 'saved to', sys.argv[1] hru.save_pickle(d.data, sys.argv[1]) #print len(d.data) #hru.save_pickle(d.data[0]['stamp'], sys.argv[1]) #hru.save_pickle(d.data[0]['frame_id'], sys.argv[1]) #hru.save_pickle(d.data[0]['l_finger_tip'], sys.argv[1]) #hru.save_pickle(d.data[0]['r_finger_tip'], sys.argv[1]) #hru.save_pickle(d.headers, 'headers.pkl') #self.data.app #self.data.append({"stamp": msg.header.stamp.to_time(), # "frame_id": msg.header.frame_id, # "l_finger_tip": msg.l_finger_tip, # "r_finger_tip": msg.r_finger_tip}) #self.headers.append(msg.header)
ajibawa-2023/Python-Code-Large/train/row_99684
29
94
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99684:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0106, 0.0106, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0106, 0.0106, 0, 0.66, 0.1429, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0213, 0.0106, 0, 0.66, 0.2857, 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_99684:Import_L4_C0", "label": "pr2_msgs.msg import pm", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0426, 0.0106, 0, 0.66, 0.4286, 797, 0, 1, 0, 0, 797, 0, 0], "semantic": {"name": "pr2_msgs.msg", "arg_names": [], "import_names": ["pm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pr2_msgs.msg as pm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:Import_L5_C0", "label": "time import time", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0532, 0.0106, 0, 0.66, 0.5714, 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_99684:Import_L6_C0", "label": "hrl_lib.util import hru", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0638, 0.0106, 0, 0.66, 0.7143, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["hru"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as hru"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:ClassDef_L8_C0", "label": "DataAccumulate", "type": "class", "loc": [8, 24], "level": 0, "parent": null, "vector": [3, 0, 0.1702, 0.1809, 0, 0.66, 0.8571, 257, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "DataAccumulate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DataAccumulate:\n def __init__(self, topic, type):\n rospy.Subscriber(topic, type, self.callback)\n self.data = []\n self.headers = []\n self.t = None\n\n def callback(self, msg):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L9_C4", "label": "__init__", "type": "function", "loc": [9, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99684:ClassDef_L8_C0", "vector": [2, 1, 0.117, 0.0532, 1, 0.85, 0.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "topic", "type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, topic, type):\n rospy.Subscriber(topic, type, self.callback)\n self.data = []\n self.headers = []\n self.t = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:Expr_L10_C8", "label": "Subscriber()", "type": "expression", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L9_C4", "vector": [8, 2, 0.1064, 0.0106, 2, 0.84, 0.0, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber(topic, type, self.callback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:Assign_L11_C8", "label": "self.data =", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L9_C4", "vector": [14, 2, 0.117, 0.0106, 2, 0.84, 0.3333, 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_99684:Assign_L12_C8", "label": "self.headers =", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L9_C4", "vector": [14, 2, 0.1277, 0.0106, 2, 0.84, 0.6667, 131, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.headers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.headers = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:Assign_L13_C8", "label": "self.t =", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L9_C4", "vector": [14, 2, 0.1383, 0.0106, 2, 0.84, 1.0, 670, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.t = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L15_C4", "label": "callback", "type": "function", "loc": [15, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99684:ClassDef_L8_C0", "vector": [2, 1, 0.1755, 0.0426, 1, 0.85, 0.5, 342, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "callback", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def callback(self, msg):\n msg.header.stamp = msg.header.stamp.to_time()\n self.data.append(msg)\n self.t = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:Assign_L16_C8", "label": "msg.header.stamp = to_time()", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L15_C4", "vector": [14, 2, 0.1702, 0.0106, 2, 0.47, 0.0, 90, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "msg.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "to_time", "annotation": ""}, "snippet": " msg.header.stamp = msg.header.stamp.to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:Expr_L17_C8", "label": "append()", "type": "expression", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L15_C4", "vector": [8, 2, 0.1809, 0.0106, 2, 0.47, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.data.append(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:Assign_L18_C8", "label": "self.t = time()", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L15_C4", "vector": [14, 2, 0.1915, 0.0106, 2, 0.47, 1.0, 670, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "self.t", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " self.t = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L20_C4", "label": "done", "type": "function", "loc": [20, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99684:ClassDef_L8_C0", "vector": [2, 1, 0.234, 0.0532, 1, 0.85, 1.0, 151, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "done", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def done(self):\n if self.t != None:\n return (time.time() - self.t) > 2.\n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L21_C8", "label": "if", "type": "if", "loc": [21, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L20_C4", "vector": [4, 2, 0.2394, 0.0426, 2, 0.89, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.t != None:\n return (time.time() - self.t) > 2.\n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:Return_L22_C12", "label": "return", "type": "return", "loc": [22, 22], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L21_C8", "vector": [13, 3, 0.234, 0.0106, 3, 0.21, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (time.time() - self.t) > 2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:Return_L24_C12", "label": "return", "type": "return", "loc": [24, 24], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L21_C8", "vector": [13, 3, 0.2553, 0.0106, 3, 0.21, 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_99684:If_L26_C0", "label": "if", "type": "if", "loc": [26, 35], "level": 0, "parent": null, "vector": [4, 0, 0.3245, 0.1064, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import sys\n rospy.init_node('test01')\n d = DataAccumulate('/pressure/l_gripper_motor', pm.PressureState)\n r = rospy.Rate(10)\n while not rospy.is_shutdown():\n if d.done():\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:Import_L27_C4", "label": "sys import sys", "type": "import", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L26_C0", "vector": [1, 1, 0.2872, 0.0106, 1, 0.07, 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_99684:Expr_L28_C4", "label": "init_node()", "type": "expression", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L26_C0", "vector": [8, 1, 0.2979, 0.0106, 1, 0.07, 0.1667, 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('test01')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:Assign_L29_C4", "label": "d = DataAccumulate()", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L26_C0", "vector": [14, 1, 0.3085, 0.0106, 1, 0.07, 0.3333, 355, 3, 2, 0, 0, 257, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "DataAccumulate", "annotation": ""}, "snippet": " d = DataAccumulate('/pressure/l_gripper_motor', pm.PressureState)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:Assign_L30_C4", "label": "r = Rate()", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L26_C0", "vector": [14, 1, 0.3191, 0.0106, 1, 0.07, 0.5, 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_99684:While_L31_C4", "label": "while", "type": "while", "loc": [31, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L26_C0", "vector": [5, 1, 0.3404, 0.0319, 1, 0.07, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n if d.done():\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L32_C8", "label": "if", "type": "if", "loc": [32, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99684:While_L31_C4", "vector": [4, 2, 0.3457, 0.0213, 2, 0.13, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d.done():\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:Expr_L34_C4", "label": "print()", "type": "expression", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L26_C0", "vector": [8, 1, 0.3617, 0.0106, 1, 0.07, 0.8333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('saved to', sys.argv[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99684:Expr_L35_C4", "label": "save_pickle()", "type": "expression", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L26_C0", "vector": [8, 1, 0.3723, 0.0106, 1, 0.07, 1.0, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " hru.save_pickle(d.data, sys.argv[1])"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99684:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99684:Expr_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99684:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99684:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99684:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99684:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99684:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99684:Expr_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99684:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99684:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99684:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L21_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99684:Return_L22_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L21_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99684:Return_L24_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99684:Import_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99684:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99684:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99684:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99684:While_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99684:While_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99684:Expr_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99684:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99684:Expr_L35_C4"}]
import roslib; roslib.load_manifest('hai_sandbox') import rospy import hrl_lib.util as ut import hai_sandbox.pr2 as pr2 import numpy as np import time import pdb import sys def dict_to_ps(d): ps = gm.PoseStamped() ps.pose.position.x = d['pose']['position']['x'] ps.pose.position.y = d['pose']['position']['y'] ps.pose.position.z = d['pose']['position']['z'] ps.pose.orientation.x = d['pose']['orientation']['x'] ps.pose.orientation.y = d['pose']['orientation']['y'] ps.pose.orientation.z = d['pose']['orientation']['z'] ps.pose.orientation.w = d['pose']['orientation']['w'] ps.header.frame_id = d['header']['frame_id'] ps.header.stamp = d['header']['stamp'] return ps def imitate(data_fname): # data = {'base_pose': pose_base, # 'robot_pose': j0_dict, # 'arm': arm_used, # 'movement_states': None} data = ut.load_pickle(data_fname) rospy.init_node('imitate') robot = pr2.PR2() #self.pr2_pub = rospy.Publisher(pr2_control_topic, PoseStamped) state = 'drive' ##Need to be localized!! ## NOT LEARNED: go into safe state. ## drive. learned locations. (might learn path/driving too?) if state == 'drive': t, r = data['base_pose'] print t r = robot.base.set_pose(t, r, '/map', block=True) rospy.loginfo('result is %s' % str(r)) state = 'init_manipulation' ## Need a refinement step ## Move joints to initial state. learned initial state. (maybe coordinate this with sensors?) #Put robot in the correct state if state == 'init_manipulation': rospy.loginfo('STATE init_manipulation') j0_dict = data['robot_pose'] cpos = robot.pose() robot.left_arm.set_poses (np.column_stack([cpos['larm'], j0_dict['poses']['larm']]), np.array([0.1, 5.]), block=False) robot.right_arm.set_poses(np.column_stack([cpos['rarm'], j0_dict['poses']['rarm']]), np.array([0.1, 5.]), block=False) robot.head.set_poses(np.column_stack([cpos['head_traj'], j0_dict['poses']['head_traj']]), np.array([.01, 5.])) robot.torso.set_pose(j0_dict['poses']['torso'][0,0], block=True) state = 'manipulate' if state == 'manipulate_cart': rospy.loginfo('STATE manipulate') rospy.loginfo('there are %d states' % len(data['movement_states'])) ## For each contact state for state in range(len(data['movement_states'])): cur_state = data['movement_states'][state] rospy.loginfo("starting %s" % cur_state['name']) left_cart = cur_state['cartesian'][0] right_cart = cur_state['cartesian'][1] start_time = cur_state['start_time'] for ldict, rdict in zip(left_cart, right_cart): lps = dict_to_ps(ldict) rps = dict_to_ps(rdict) time_from_start = ((lps.header.stamp - start_time) + (rps.header.stamp - start_time))/2.0 cur_time = rospy.get_rostime() ntime = cur_time + rospy.Duration(time_from_start) diff_time = (ntime - rospy.get_rostime()).to_sec() if diff_time < 0: rospy.logerror('DIFF time < 0, %f' % diff_time) time.sleep(diff_time - .005) #Publish... if state == 'manipulate': rospy.loginfo('STATE manipulate') rospy.loginfo('there are %d states' % len(data['movement_states'])) ## For each contact state for state in range(len(data['movement_states'])): cur_state = data['movement_states'][state] rospy.loginfo("starting %s" % cur_state['name']) larm, lvel, ltime, rarm, rvel, rtime = zip(*[[jdict['poses']['larm'], jdict['vels']['larm'], jdict['time'], \ jdict['poses']['rarm'], jdict['vels']['rarm'], jdict['time']] \ for jdict in cur_state['joint_states']]) larm = np.column_stack(larm) rarm = np.column_stack(rarm) lvel = np.column_stack(lvel) rvel = np.column_stack(rvel) ltime = np.array(ltime) - cur_state['start_time'] rtime = np.array(rtime) - cur_state['start_time'] ## send trajectory. wait until contact state changes or traj. finished executing. robot.left_arm.set_poses(larm[:,0], np.array([2.]), block=False) robot.right_arm.set_poses(rarm[:,0], np.array([2.]), block=True) robot.left_arm.set_poses(larm, ltime, vel_mat=lvel, block=False) robot.right_arm.set_poses(rarm, rtime, vel_mat=rvel, block=True) rospy.loginfo("%s FINISHED" % cur_state['name']) time.sleep(5) ## rosbag implementation steps in time and also figures out how long to sleep until it needs to publish next message ## Just play pose stamped back at 10 hz ## For each contact state class ControllerTest: def __init__(self): pass def run(self): self.robot = pr2.PR2() rospy.loginfo('switching to cartesian controllers') self.robot.controller_manager.switch(['l_cart', 'r_cart'], ['l_arm_controller', 'r_arm_controller']) rospy.on_shutdown(self.shutdown) r = rospy.Rate(1) #publish posture & cartesian poses while not rospy.is_shutdown(): self.robot.left_arm.set_posture(self.robot.left_arm.POSTURES['elbowupl']) self.robot.right_arm.set_posture(self.robot.right_arm.POSTURES['elbowupr']) r.sleep() def shutdown(self): rospy.loginfo('switching back joint controllers') self.robot.controller_manager.switch(['l_arm_controller', 'r_arm_controller'], ['l_cart', 'r_cart']) if __name__ == '__main__': imitate(sys.argv[1]) if False: c = ControllerTest() c.run()
ajibawa-2023/Python-Code-Large/train/row_99685
99
151
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0066, 0.0066, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0066, 0.0066, 0, 0.66, 0.0833, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0132, 0.0066, 0, 0.66, 0.1667, 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_99685:Import_L4_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0265, 0.0066, 0, 0.66, 0.25, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Import_L5_C0", "label": "hai_sandbox.pr2 import pr2", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0331, 0.0066, 0, 0.66, 0.3333, 788, 0, 1, 0, 0, 788, 0, 0], "semantic": {"name": "hai_sandbox.pr2", "arg_names": [], "import_names": ["pr2"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hai_sandbox.pr2 as pr2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Import_L7_C0", "label": "numpy import np", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0464, 0.0066, 0, 0.66, 0.4167, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Import_L8_C0", "label": "time import time", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.053, 0.0066, 0, 0.66, 0.5, 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_99685:Import_L9_C0", "label": "pdb import pdb", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0596, 0.0066, 0, 0.66, 0.5833, 91, 0, 1, 0, 0, 91, 0, 0], "semantic": {"name": "pdb", "arg_names": [], "import_names": ["pdb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pdb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Import_L10_C0", "label": "sys import sys", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0662, 0.0066, 0, 0.66, 0.6667, 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_99685:FunctionDef_L12_C0", "label": "dict_to_ps", "type": "function", "loc": [12, 23], "level": 0, "parent": null, "vector": [2, 0, 0.1159, 0.0795, 0, 0.66, 0.75, 275, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "dict_to_ps", "arg_names": ["d"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def dict_to_ps(d):\n ps = gm.PoseStamped()\n ps.pose.position.x = d['pose']['position']['x']\n ps.pose.position.y = d['pose']['position']['y']\n ps.pose.position.z = d['pose']['position']['z']\n ps.pose.orientation.x = d['pose']['orientation']['x']\n ps.pose.orientation.y = d['pose']['orientation']['y']\n ps.pose.orientation.z = d['pose']['orientation']['z']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L13_C4", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "vector": [14, 1, 0.0861, 0.0066, 1, 0.51, 0.0, 232, 3, 0, 0, 0, 226, 10, 1], "semantic": {"name": "ps", "arg_names": [], "import_names": [], "rhs_call_name": "PoseStamped", "annotation": ""}, "snippet": " ps = gm.PoseStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L14_C4", "label": "ps.pose.position.x =", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "vector": [14, 1, 0.0927, 0.0066, 1, 0.51, 0.1, 782, 6, 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 = d['pose']['position']['x']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L15_C4", "label": "ps.pose.position.y =", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "vector": [14, 1, 0.0993, 0.0066, 1, 0.51, 0.2, 661, 6, 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 = d['pose']['position']['y']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L16_C4", "label": "ps.pose.position.z =", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "vector": [14, 1, 0.106, 0.0066, 1, 0.51, 0.3, 771, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.z = d['pose']['position']['z']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L17_C4", "label": "ps.pose.orientation.x =", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "vector": [14, 1, 0.1126, 0.0066, 1, 0.51, 0.4, 628, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.x = d['pose']['orientation']['x']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L18_C4", "label": "ps.pose.orientation.y =", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "vector": [14, 1, 0.1192, 0.0066, 1, 0.51, 0.5, 848, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.y = d['pose']['orientation']['y']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L19_C4", "label": "ps.pose.orientation.z =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "vector": [14, 1, 0.1258, 0.0066, 1, 0.51, 0.6, 126, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.z = d['pose']['orientation']['z']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L20_C4", "label": "ps.pose.orientation.w =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "vector": [14, 1, 0.1325, 0.0066, 1, 0.51, 0.7, 163, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.w = d['pose']['orientation']['w']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L21_C4", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "vector": [14, 1, 0.1391, 0.0066, 1, 0.51, 0.8, 293, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.header.frame_id = d['header']['frame_id']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L22_C4", "label": "ps.header.stamp =", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "vector": [14, 1, 0.1457, 0.0066, 1, 0.51, 0.9, 161, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.header.stamp = d['header']['stamp']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Return_L23_C4", "label": "return", "type": "return", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "vector": [13, 1, 0.1523, 0.0066, 1, 0.51, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ps"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L26_C0", "label": "imitate", "type": "function", "loc": [26, 114], "level": 0, "parent": null, "vector": [2, 0, 0.4636, 0.5894, 0, 0.66, 0.8333, 107, 0, 1, 0, 0, 0, 0, 55], "semantic": {"name": "imitate", "arg_names": ["data_fname"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def imitate(data_fname):\n # data = {'base_pose': pose_base, \n # 'robot_pose': j0_dict,\n # 'arm': arm_used,\n # 'movement_states': None}\n data = ut.load_pickle(data_fname)\n rospy.init_node('imitate')\n robot = pr2.PR2()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L31_C4", "label": "data = load_pickle()", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L26_C0", "vector": [14, 1, 0.2053, 0.0066, 1, 0.45, 0.0, 929, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " data = ut.load_pickle(data_fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L32_C4", "label": "init_node()", "type": "expression", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L26_C0", "vector": [8, 1, 0.2119, 0.0066, 1, 0.45, 0.1429, 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('imitate')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L33_C4", "label": "robot = PR2()", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L26_C0", "vector": [14, 1, 0.2185, 0.0066, 1, 0.45, 0.2857, 735, 3, 0, 0, 0, 573, 10, 1], "semantic": {"name": "robot", "arg_names": [], "import_names": [], "rhs_call_name": "PR2", "annotation": ""}, "snippet": " robot = pr2.PR2()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L35_C4", "label": "state =", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L26_C0", "vector": [14, 1, 0.2318, 0.0066, 1, 0.45, 0.4286, 688, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " state = 'drive'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L41_C4", "label": "if", "type": "if", "loc": [41, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L26_C0", "vector": [4, 1, 0.2881, 0.0397, 1, 0.45, 0.5714, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state == 'drive':\n t, r = data['base_pose']\n print(t)\n r = robot.base.set_pose(t, r, '/map', block=True)\n rospy.loginfo('result is %s' % str(r))\n state = 'init_manipulation'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L42_C8", "label": "t, r =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L41_C4", "vector": [14, 2, 0.2781, 0.0066, 2, 0.07, 0.0, 361, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t, r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t, r = data['base_pose']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L43_C8", "label": "print()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L41_C4", "vector": [8, 2, 0.2848, 0.0066, 2, 0.07, 0.25, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L44_C8", "label": "r = set_pose()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L41_C4", "vector": [14, 2, 0.2914, 0.0066, 2, 0.07, 0.5, 436, 3, 4, 0, 0, 371, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "set_pose", "annotation": ""}, "snippet": " r = robot.base.set_pose(t, r, '/map', block=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L45_C8", "label": "loginfo()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L41_C4", "vector": [8, 2, 0.298, 0.0066, 2, 0.07, 0.75, 607, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('result is %s' % str(r))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L46_C8", "label": "state =", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L41_C4", "vector": [14, 2, 0.3046, 0.0066, 2, 0.07, 1.0, 688, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " state = 'init_manipulation'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L51_C4", "label": "if", "type": "if", "loc": [51, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L26_C0", "vector": [4, 1, 0.3642, 0.0596, 1, 0.45, 0.7143, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state == 'init_manipulation':\n rospy.loginfo('STATE init_manipulation')\n j0_dict = data['robot_pose']\n cpos = robot.pose()\n robot.left_arm.set_poses (np.column_stack([cpos['larm'], j0_dict['poses']['larm']]), np.array([0.1, 5.]), block=False)\n robot.right_arm.set_poses(np.column_stack([cpos['rarm'], j0_dict['poses']['rarm']]), np.array([0.1, 5.]), block=False)\n robot.head.set_poses(np.column_stack([cpos['head_traj'], j0_dict['poses']['head_traj']]), np.array([.01, 5.]))\n robot.torso.set_pose(j0_dict['poses']['torso'][0,0], block=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L52_C8", "label": "loginfo()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L51_C4", "vector": [8, 2, 0.3444, 0.0066, 2, 0.0, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('STATE init_manipulation')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L53_C8", "label": "j0_dict =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L51_C4", "vector": [14, 2, 0.351, 0.0066, 2, 0.0, 0.1429, 234, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "j0_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " j0_dict = data['robot_pose']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L54_C8", "label": "cpos = pose()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L51_C4", "vector": [14, 2, 0.3576, 0.0066, 2, 0.0, 0.2857, 346, 3, 0, 0, 0, 767, 10, 1], "semantic": {"name": "cpos", "arg_names": [], "import_names": [], "rhs_call_name": "pose", "annotation": ""}, "snippet": " cpos = robot.pose()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L55_C8", "label": "set_poses()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L51_C4", "vector": [8, 2, 0.3642, 0.0066, 2, 0.0, 0.4286, 40, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "set_poses", "arg_names": [], "import_names": [], "rhs_call_name": "set_poses", "annotation": ""}, "snippet": " robot.left_arm.set_poses (np.column_stack([cpos['larm'], j0_dict['poses']['larm']]), np.array([0.1, 5.]), block=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L56_C8", "label": "set_poses()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L51_C4", "vector": [8, 2, 0.3709, 0.0066, 2, 0.0, 0.5714, 40, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "set_poses", "arg_names": [], "import_names": [], "rhs_call_name": "set_poses", "annotation": ""}, "snippet": " robot.right_arm.set_poses(np.column_stack([cpos['rarm'], j0_dict['poses']['rarm']]), np.array([0.1, 5.]), block=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L57_C8", "label": "set_poses()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L51_C4", "vector": [8, 2, 0.3775, 0.0066, 2, 0.0, 0.7143, 40, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "set_poses", "arg_names": [], "import_names": [], "rhs_call_name": "set_poses", "annotation": ""}, "snippet": " robot.head.set_poses(np.column_stack([cpos['head_traj'], j0_dict['poses']['head_traj']]), np.array([.01, 5.]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L58_C8", "label": "set_pose()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L51_C4", "vector": [8, 2, 0.3841, 0.0066, 2, 0.0, 0.8571, 371, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_pose", "arg_names": [], "import_names": [], "rhs_call_name": "set_pose", "annotation": ""}, "snippet": " robot.torso.set_pose(j0_dict['poses']['torso'][0,0], block=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L59_C8", "label": "state =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L51_C4", "vector": [14, 2, 0.3907, 0.0066, 2, 0.0, 1.0, 688, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " state = 'manipulate'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L61_C4", "label": "if", "type": "if", "loc": [61, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L26_C0", "vector": [4, 1, 0.4735, 0.1457, 1, 0.45, 0.8571, 0, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state == 'manipulate_cart':\n rospy.loginfo('STATE manipulate')\n rospy.loginfo('there are %d states' % len(data['movement_states']))\n ## For each contact state\n for state in range(len(data['movement_states'])):\n cur_state = data['movement_states'][state]\n rospy.loginfo(\"starting %s\" % cur_state['name'])\n left_cart = cur_state['cartesian'][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L62_C8", "label": "loginfo()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L61_C4", "vector": [8, 2, 0.4106, 0.0066, 2, 0.34, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('STATE manipulate')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L63_C8", "label": "loginfo()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L61_C4", "vector": [8, 2, 0.4172, 0.0066, 2, 0.34, 0.5, 607, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('there are %d states' % len(data['movement_states']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L65_C8", "label": "for state", "type": "for", "loc": [65, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L61_C4", "vector": [6, 2, 0.4868, 0.1192, 2, 0.34, 1.0, 688, 3, 0, 0, 0, 0, 0, 12], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for state in range(len(data['movement_states'])):\n cur_state = data['movement_states'][state]\n rospy.loginfo(\"starting %s\" % cur_state['name'])\n left_cart = cur_state['cartesian'][0]\n right_cart = cur_state['cartesian'][1]\n start_time = cur_state['start_time']\n\n for ldict, rdict in zip(left_cart, right_cart):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L66_C12", "label": "cur_state =", "type": "assigned_variable", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L65_C8", "vector": [14, 3, 0.4371, 0.0066, 3, 0.33, 0.0, 782, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cur_state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cur_state = data['movement_states'][state]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L67_C12", "label": "loginfo()", "type": "expression", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L65_C8", "vector": [8, 3, 0.4437, 0.0066, 3, 0.33, 0.2, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"starting %s\" % cur_state['name'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L68_C12", "label": "left_cart =", "type": "assigned_variable", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L65_C8", "vector": [14, 3, 0.4503, 0.0066, 3, 0.33, 0.4, 730, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "left_cart", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left_cart = cur_state['cartesian'][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L69_C12", "label": "right_cart =", "type": "assigned_variable", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L65_C8", "vector": [14, 3, 0.457, 0.0066, 3, 0.33, 0.6, 383, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "right_cart", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " right_cart = cur_state['cartesian'][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L70_C12", "label": "start_time =", "type": "assigned_variable", "loc": [70, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L65_C8", "vector": [14, 3, 0.4636, 0.0066, 3, 0.33, 0.8, 511, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_time = cur_state['start_time']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L72_C12", "label": "for ldict, rdict", "type": "for", "loc": [72, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L65_C8", "vector": [6, 3, 0.5099, 0.0728, 3, 0.33, 1.0, 213, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "ldict, rdict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for ldict, rdict in zip(left_cart, right_cart):\n lps = dict_to_ps(ldict)\n rps = dict_to_ps(rdict)\n time_from_start = ((lps.header.stamp - start_time) + (rps.header.stamp - start_time))/2.0\n cur_time = rospy.get_rostime()\n ntime = cur_time + rospy.Duration(time_from_start)\n\n diff_time = (ntime - rospy.get_rostime()).to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L73_C16", "label": "lps = dict_to_ps()", "type": "assigned_variable", "loc": [73, 73], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L72_C12", "vector": [14, 4, 0.4834, 0.0066, 4, 0.86, 0.0, 573, 3, 1, 0, 0, 275, 10, 1], "semantic": {"name": "lps", "arg_names": [], "import_names": [], "rhs_call_name": "dict_to_ps", "annotation": ""}, "snippet": " lps = dict_to_ps(ldict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L74_C16", "label": "rps = dict_to_ps()", "type": "assigned_variable", "loc": [74, 74], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L72_C12", "vector": [14, 4, 0.4901, 0.0066, 4, 0.86, 0.1429, 109, 3, 1, 0, 0, 275, 10, 1], "semantic": {"name": "rps", "arg_names": [], "import_names": [], "rhs_call_name": "dict_to_ps", "annotation": ""}, "snippet": " rps = dict_to_ps(rdict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L75_C16", "label": "time_from_start =", "type": "assigned_variable", "loc": [75, 75], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L72_C12", "vector": [14, 4, 0.4967, 0.0066, 4, 0.86, 0.2857, 433, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_from_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_from_start = ((lps.header.stamp - start_time) + (rps.header.stamp - start_time))/2.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L76_C16", "label": "cur_time = get_rostime()", "type": "assigned_variable", "loc": [76, 76], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L72_C12", "vector": [14, 4, 0.5033, 0.0066, 4, 0.86, 0.4286, 618, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "cur_time", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " cur_time = rospy.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L77_C16", "label": "ntime =", "type": "assigned_variable", "loc": [77, 77], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L72_C12", "vector": [14, 4, 0.5099, 0.0066, 4, 0.86, 0.5714, 885, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ntime", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ntime = cur_time + rospy.Duration(time_from_start)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L79_C16", "label": "diff_time = to_sec()", "type": "assigned_variable", "loc": [79, 79], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L72_C12", "vector": [14, 4, 0.5232, 0.0066, 4, 0.86, 0.7143, 12, 3, 0, 0, 0, 750, 10, 2], "semantic": {"name": "diff_time", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " diff_time = (ntime - rospy.get_rostime()).to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L80_C16", "label": "if", "type": "if", "loc": [80, 81], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L72_C12", "vector": [4, 4, 0.5331, 0.0132, 4, 0.86, 0.8571, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if diff_time < 0:\n rospy.logerror('DIFF time < 0, %f' % diff_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L81_C20", "label": "logerror()", "type": "expression", "loc": [81, 81], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L80_C16", "vector": [8, 5, 0.5364, 0.0066, 5, 0.27, 0.0, 739, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerror", "arg_names": [], "import_names": [], "rhs_call_name": "logerror", "annotation": ""}, "snippet": " rospy.logerror('DIFF time < 0, %f' % diff_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L82_C16", "label": "sleep()", "type": "expression", "loc": [82, 82], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L72_C12", "vector": [8, 4, 0.543, 0.0066, 4, 0.86, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(diff_time - .005)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L87_C4", "label": "if", "type": "if", "loc": [87, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L26_C0", "vector": [4, 1, 0.6656, 0.1854, 1, 0.45, 1.0, 0, 0, 0, 0, 0, 0, 0, 21], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state == 'manipulate':\n rospy.loginfo('STATE manipulate')\n rospy.loginfo('there are %d states' % len(data['movement_states']))\n ## For each contact state\n for state in range(len(data['movement_states'])):\n cur_state = data['movement_states'][state]\n rospy.loginfo(\"starting %s\" % cur_state['name'])\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L88_C8", "label": "loginfo()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L87_C4", "vector": [8, 2, 0.5828, 0.0066, 2, 0.07, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('STATE manipulate')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L89_C8", "label": "loginfo()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L87_C4", "vector": [8, 2, 0.5894, 0.0066, 2, 0.07, 0.5, 607, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('there are %d states' % len(data['movement_states']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "label": "for state", "type": "for", "loc": [91, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L87_C4", "vector": [6, 2, 0.6788, 0.1589, 2, 0.07, 1.0, 688, 3, 0, 0, 0, 0, 0, 18], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for state in range(len(data['movement_states'])):\n cur_state = data['movement_states'][state]\n rospy.loginfo(\"starting %s\" % cur_state['name'])\n \n larm, lvel, ltime, rarm, rvel, rtime = zip(*[[jdict['poses']['larm'], jdict['vels']['larm'], jdict['time'], \\\n jdict['poses']['rarm'], jdict['vels']['rarm'], jdict['time']] \\\n for jdict in cur_state['joint_states']])\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L92_C12", "label": "cur_state =", "type": "assigned_variable", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "vector": [14, 3, 0.6093, 0.0066, 3, 0.58, 0.0, 782, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cur_state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cur_state = data['movement_states'][state]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L93_C12", "label": "loginfo()", "type": "expression", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "vector": [8, 3, 0.6159, 0.0066, 3, 0.58, 0.0714, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"starting %s\" % cur_state['name'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L95_C12", "label": "larm, lvel, ltime, rarm, rvel, rtime = zip()", "type": "assigned_variable", "loc": [95, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "vector": [14, 3, 0.6358, 0.0199, 3, 0.58, 0.1429, 653, 3, 1, 0, 0, 814, 10, 1], "semantic": {"name": "larm, lvel, ltime, rarm, rvel, rtime", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " larm, lvel, ltime, rarm, rvel, rtime = zip(*[[jdict['poses']['larm'], jdict['vels']['larm'], jdict['time'], \\\n jdict['poses']['rarm'], jdict['vels']['rarm'], jdict['time']] \\\n for jdict in cur_state['joint_states']])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L99_C12", "label": "larm = column_stack()", "type": "assigned_variable", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "vector": [14, 3, 0.6556, 0.0066, 3, 0.58, 0.2143, 76, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "larm", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " larm = np.column_stack(larm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L100_C12", "label": "rarm = column_stack()", "type": "assigned_variable", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "vector": [14, 3, 0.6623, 0.0066, 3, 0.58, 0.2857, 937, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "rarm", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " rarm = np.column_stack(rarm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L101_C12", "label": "lvel = column_stack()", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "vector": [14, 3, 0.6689, 0.0066, 3, 0.58, 0.3571, 817, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "lvel", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " lvel = np.column_stack(lvel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L102_C12", "label": "rvel = column_stack()", "type": "assigned_variable", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "vector": [14, 3, 0.6755, 0.0066, 3, 0.58, 0.4286, 597, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "rvel", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " rvel = np.column_stack(rvel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L103_C12", "label": "ltime =", "type": "assigned_variable", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "vector": [14, 3, 0.6821, 0.0066, 3, 0.58, 0.5, 43, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ltime", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ltime = np.array(ltime) - cur_state['start_time']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L104_C12", "label": "rtime =", "type": "assigned_variable", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "vector": [14, 3, 0.6887, 0.0066, 3, 0.58, 0.5714, 605, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rtime", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rtime = np.array(rtime) - cur_state['start_time']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L107_C12", "label": "set_poses()", "type": "expression", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "vector": [8, 3, 0.7086, 0.0066, 3, 0.58, 0.6429, 40, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "set_poses", "arg_names": [], "import_names": [], "rhs_call_name": "set_poses", "annotation": ""}, "snippet": " robot.left_arm.set_poses(larm[:,0], np.array([2.]), block=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L108_C12", "label": "set_poses()", "type": "expression", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "vector": [8, 3, 0.7152, 0.0066, 3, 0.58, 0.7143, 40, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "set_poses", "arg_names": [], "import_names": [], "rhs_call_name": "set_poses", "annotation": ""}, "snippet": " robot.right_arm.set_poses(rarm[:,0], np.array([2.]), block=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L110_C12", "label": "set_poses()", "type": "expression", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "vector": [8, 3, 0.7285, 0.0066, 3, 0.58, 0.7857, 40, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "set_poses", "arg_names": [], "import_names": [], "rhs_call_name": "set_poses", "annotation": ""}, "snippet": " robot.left_arm.set_poses(larm, ltime, vel_mat=lvel, block=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L111_C12", "label": "set_poses()", "type": "expression", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "vector": [8, 3, 0.7351, 0.0066, 3, 0.58, 0.8571, 40, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "set_poses", "arg_names": [], "import_names": [], "rhs_call_name": "set_poses", "annotation": ""}, "snippet": " robot.right_arm.set_poses(rarm, rtime, vel_mat=rvel, block=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L113_C12", "label": "loginfo()", "type": "expression", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "vector": [8, 3, 0.7483, 0.0066, 3, 0.58, 0.9286, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"%s FINISHED\" % cur_state['name'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L114_C12", "label": "sleep()", "type": "expression", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "vector": [8, 3, 0.755, 0.0066, 3, 0.58, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:ClassDef_L120_C0", "label": "ControllerTest", "type": "class", "loc": [120, 138], "level": 0, "parent": null, "vector": [3, 0, 0.8543, 0.1258, 0, 0.66, 0.9167, 988, 0, 3, 0, 0, 0, 0, 11], "semantic": {"name": "ControllerTest", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ControllerTest:\n def __init__(self):\n pass\n\n def run(self):\n self.robot = pr2.PR2()\n rospy.loginfo('switching to cartesian controllers')\n self.robot.controller_manager.switch(['l_cart', 'r_cart'], ['l_arm_controller', 'r_arm_controller'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L121_C4", "label": "__init__", "type": "function", "loc": [121, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:ClassDef_L120_C0", "vector": [2, 1, 0.8046, 0.0132, 1, 0.42, 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 pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L124_C4", "label": "run", "type": "function", "loc": [124, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:ClassDef_L120_C0", "vector": [2, 1, 0.8543, 0.0728, 1, 0.42, 0.5, 679, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run(self):\n self.robot = pr2.PR2()\n rospy.loginfo('switching to cartesian controllers')\n self.robot.controller_manager.switch(['l_cart', 'r_cart'], ['l_arm_controller', 'r_arm_controller'])\n rospy.on_shutdown(self.shutdown)\n r = rospy.Rate(1)\n #publish posture & cartesian poses\n while not rospy.is_shutdown():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L125_C8", "label": "self.robot = PR2()", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L124_C4", "vector": [14, 2, 0.8278, 0.0066, 2, 0.49, 0.0, 879, 3, 0, 0, 0, 573, 10, 1], "semantic": {"name": "self.robot", "arg_names": [], "import_names": [], "rhs_call_name": "PR2", "annotation": ""}, "snippet": " self.robot = pr2.PR2()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L126_C8", "label": "loginfo()", "type": "expression", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L124_C4", "vector": [8, 2, 0.8344, 0.0066, 2, 0.49, 0.2, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('switching to cartesian controllers')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L127_C8", "label": "switch()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L124_C4", "vector": [8, 2, 0.8411, 0.0066, 2, 0.49, 0.4, 748, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "switch", "arg_names": [], "import_names": [], "rhs_call_name": "switch", "annotation": ""}, "snippet": " self.robot.controller_manager.switch(['l_cart', 'r_cart'], ['l_arm_controller', 'r_arm_controller'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L128_C8", "label": "on_shutdown()", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L124_C4", "vector": [8, 2, 0.8477, 0.0066, 2, 0.49, 0.6, 533, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "on_shutdown", "arg_names": [], "import_names": [], "rhs_call_name": "on_shutdown", "annotation": ""}, "snippet": " rospy.on_shutdown(self.shutdown)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L129_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L124_C4", "vector": [14, 2, 0.8543, 0.0066, 2, 0.49, 0.8, 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_99685:While_L131_C8", "label": "while", "type": "while", "loc": [131, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L124_C4", "vector": [5, 2, 0.8775, 0.0265, 2, 0.49, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n self.robot.left_arm.set_posture(self.robot.left_arm.POSTURES['elbowupl'])\n self.robot.right_arm.set_posture(self.robot.right_arm.POSTURES['elbowupr'])\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L132_C12", "label": "set_posture()", "type": "expression", "loc": [132, 132], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:While_L131_C8", "vector": [8, 3, 0.8742, 0.0066, 3, 0.99, 0.0, 300, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_posture", "arg_names": [], "import_names": [], "rhs_call_name": "set_posture", "annotation": ""}, "snippet": " self.robot.left_arm.set_posture(self.robot.left_arm.POSTURES['elbowupl'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L133_C12", "label": "set_posture()", "type": "expression", "loc": [133, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:While_L131_C8", "vector": [8, 3, 0.8808, 0.0066, 3, 0.99, 0.5, 300, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_posture", "arg_names": [], "import_names": [], "rhs_call_name": "set_posture", "annotation": ""}, "snippet": " self.robot.right_arm.set_posture(self.robot.right_arm.POSTURES['elbowupr'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L134_C12", "label": "sleep()", "type": "expression", "loc": [134, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:While_L131_C8", "vector": [8, 3, 0.8874, 0.0066, 3, 0.99, 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_99685:FunctionDef_L136_C4", "label": "shutdown", "type": "function", "loc": [136, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:ClassDef_L120_C0", "vector": [2, 1, 0.9073, 0.0199, 1, 0.42, 1.0, 322, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "shutdown", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def shutdown(self):\n rospy.loginfo('switching back joint controllers')\n self.robot.controller_manager.switch(['l_arm_controller', 'r_arm_controller'], ['l_cart', 'r_cart'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L137_C8", "label": "loginfo()", "type": "expression", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L136_C4", "vector": [8, 2, 0.9073, 0.0066, 2, 0.27, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('switching back joint controllers')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L138_C8", "label": "switch()", "type": "expression", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L136_C4", "vector": [8, 2, 0.9139, 0.0066, 2, 0.27, 1.0, 748, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "switch", "arg_names": [], "import_names": [], "rhs_call_name": "switch", "annotation": ""}, "snippet": " self.robot.controller_manager.switch(['l_arm_controller', 'r_arm_controller'], ['l_cart', 'r_cart'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L141_C0", "label": "if", "type": "if", "loc": [141, 145], "level": 0, "parent": null, "vector": [4, 0, 0.947, 0.0331, 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 imitate(sys.argv[1])\n if False:\n c = ControllerTest()\n c.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L142_C4", "label": "imitate()", "type": "expression", "loc": [142, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L141_C0", "vector": [8, 1, 0.9404, 0.0066, 1, 0.98, 0.0, 107, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "imitate", "arg_names": [], "import_names": [], "rhs_call_name": "imitate", "annotation": ""}, "snippet": " imitate(sys.argv[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L143_C4", "label": "if", "type": "if", "loc": [143, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L141_C0", "vector": [4, 1, 0.9536, 0.0199, 1, 0.98, 1.0, 0, 1, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n c = ControllerTest()\n c.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L144_C8", "label": "c = ControllerTest()", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L143_C4", "vector": [14, 2, 0.9536, 0.0066, 2, 0.68, 0.0, 411, 3, 0, 0, 0, 988, 10, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "ControllerTest", "annotation": ""}, "snippet": " c = ControllerTest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L145_C8", "label": "run()", "type": "expression", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L143_C4", "vector": [8, 2, 0.9603, 0.0066, 2, 0.68, 1.0, 679, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " c.run()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Return_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L70_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L72_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L73_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L72_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L74_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L72_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L75_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L72_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L76_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L72_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L77_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L72_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L79_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L72_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L80_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L80_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L81_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L72_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L82_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:For_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:ClassDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:ClassDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:While_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:While_L131_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L132_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:While_L131_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:While_L131_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L134_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:ClassDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:FunctionDef_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99685:If_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99685:Expr_L145_C8"}]
import roslib; roslib.load_manifest('hai_sandbox') import cv import hai_sandbox.features as fea import hrl_camera.ros_camera as rc import rospy #prosilica = rc.Prosilica('prosilica', 'streaming') #prosilica = rc.ROSCamera('/narrow_stereo/right/image_rect') prosilica = rc.ROSCamera('/wide_stereo/right/image_rect_color') cv.NamedWindow('surf', 1) while not rospy.is_shutdown(): f = prosilica.get_frame() loc, desc = fea.surf_color(f, params=(0, 3000, 3, 4)) fdrawn = fea.draw_surf(f, loc, (0, 255, 0)) cv.ShowImage('surf', fdrawn) cv.WaitKey(33)
ajibawa-2023/Python-Code-Large/train/row_99687
14
17
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99687:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0588, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99687:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0588, 0.0588, 0, 0.66, 0.125, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99687:Import_L2_C0", "label": "cv import cv", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1176, 0.0588, 0, 0.66, 0.25, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99687:Import_L3_C0", "label": "hai_sandbox.features import fea", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1765, 0.0588, 0, 0.66, 0.375, 673, 0, 1, 0, 0, 673, 0, 0], "semantic": {"name": "hai_sandbox.features", "arg_names": [], "import_names": ["fea"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hai_sandbox.features as fea"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99687:Import_L4_C0", "label": "hrl_camera.ros_camera import rc", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.2353, 0.0588, 0, 0.66, 0.5, 798, 0, 1, 0, 0, 798, 0, 0], "semantic": {"name": "hrl_camera.ros_camera", "arg_names": [], "import_names": ["rc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_camera.ros_camera as rc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99687:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.2941, 0.0588, 0, 0.66, 0.625, 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_99687:Assign_L9_C0", "label": "prosilica = ROSCamera()", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5294, 0.0588, 0, 0.66, 0.75, 501, 3, 1, 0, 0, 94, 10, 1], "semantic": {"name": "prosilica", "arg_names": [], "import_names": [], "rhs_call_name": "ROSCamera", "annotation": ""}, "snippet": "prosilica = rc.ROSCamera('/wide_stereo/right/image_rect_color')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99687:Expr_L10_C0", "label": "NamedWindow()", "type": "expression", "loc": [10, 10], "level": 0, "parent": null, "vector": [8, 0, 0.5882, 0.0588, 0, 0.66, 0.875, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": "cv.NamedWindow('surf', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99687:While_L11_C0", "label": "while", "type": "while", "loc": [11, 16], "level": 0, "parent": null, "vector": [5, 0, 0.7941, 0.3529, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "while not rospy.is_shutdown():\n f = prosilica.get_frame()\n loc, desc = fea.surf_color(f, params=(0, 3000, 3, 4))\n fdrawn = fea.draw_surf(f, loc, (0, 255, 0))\n cv.ShowImage('surf', fdrawn)\n cv.WaitKey(33)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99687:Assign_L12_C4", "label": "f = get_frame()", "type": "assigned_variable", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99687:While_L11_C0", "vector": [14, 1, 0.7059, 0.0588, 1, 0.83, 0.0, 899, 3, 0, 0, 0, 489, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "get_frame", "annotation": ""}, "snippet": " f = prosilica.get_frame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99687:Assign_L13_C4", "label": "loc, desc = surf_color()", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99687:While_L11_C0", "vector": [14, 1, 0.7647, 0.0588, 1, 0.83, 0.25, 527, 3, 2, 0, 0, 716, 10, 1], "semantic": {"name": "loc, desc", "arg_names": [], "import_names": [], "rhs_call_name": "surf_color", "annotation": ""}, "snippet": " loc, desc = fea.surf_color(f, params=(0, 3000, 3, 4))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99687:Assign_L14_C4", "label": "fdrawn = draw_surf()", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99687:While_L11_C0", "vector": [14, 1, 0.8235, 0.0588, 1, 0.83, 0.5, 824, 3, 3, 0, 0, 124, 10, 1], "semantic": {"name": "fdrawn", "arg_names": [], "import_names": [], "rhs_call_name": "draw_surf", "annotation": ""}, "snippet": " fdrawn = fea.draw_surf(f, loc, (0, 255, 0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99687:Expr_L15_C4", "label": "ShowImage()", "type": "expression", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99687:While_L11_C0", "vector": [8, 1, 0.8824, 0.0588, 1, 0.83, 0.75, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage('surf', fdrawn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99687:Expr_L16_C4", "label": "WaitKey()", "type": "expression", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99687:While_L11_C0", "vector": [8, 1, 0.9412, 0.0588, 1, 0.83, 1.0, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "WaitKey", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " cv.WaitKey(33)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99687:While_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99687:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99687:While_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99687:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99687:While_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99687:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99687:While_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99687:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99687:While_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99687:Expr_L16_C4"}]
import roslib; roslib.load_manifest('hai_sandbox') import rospy import sensor_msgs.msg as sm import hrl_lib.rutils as ru import numpy as np import pr2_msgs.msg as pm import tf import hrl_lib.tf_utils as tfu import tf.transformations as tr import time import hrl_lib.util as ut def pointcloud_to_np(pc): plist = [] for p in pc.points: plist.append([p.x, p.y, p.z]) return np.matrix(plist).T class ContactTipLocation: def __init__(self): rospy.init_node('contact3d') rospy.Subscriber('/pressure/l_gripper_motor', pm.PressureState, self.lpress_cb) rospy.Subscriber('/pressure/l_gripper_motor', pm.PressureState, self.rpress_cb) self.ftip_frames = ['r_gripper_l_finger_tip_link', 'r_gripper_r_finger_tip_link', 'l_gripper_l_finger_tip_link', 'l_gripper_r_finger_tip_link'] self.tflistener = tf.TransformListener() self.lmat0 = None self.rmat0 = None self.contact_locs = [] self.last_msg = None def lpress_cb(self, pmsg): #conv to mat lmat = np.matrix((pmsg.l_finger_tip)).T rmat = np.matrix((pmsg.r_finger_tip)).T if self.lmat0 == None: self.lmat0 = lmat self.rmat0 = rmat return #zero lmat = lmat - self.lmat0 rmat = rmat - self.rmat0 #touch detected if np.any(np.abs(lmat) > 250) or np.any(np.abs(rmat) > 250): #TODO: replace this with something more sound #Contact has been made!! look up gripper tip location to_frame = 'base_link' def frame_loc(from_frame): p_base = tfu.transform('base_footprint', from_frame, self.tflistener) \ * tfu.tf_as_matrix(([0., 0., 0., 1.], tr.quaternion_from_euler(0,0,0))) #* tfu.tf_as_matrix((p.A1.tolist(), tr.quaternion_from_euler(0,0,0))) return tfu.matrix_as_tf(p_base) tip_locs = [frame_loc(n)[0] for n in self.ftip_frames] t = pmsg.header.stamp.to_time() rospy.loginfo("contact detected at %.3f" % t) self.contact_locs.append([t, tip_locs]) self.last_msg = time.time() rospy.loginfo('lpress_cb ' + str(np.max(rmat)) + ' ' + str(np.max(lmat))) def rpress_cb(self, pmsesg): pass #contact_mat(pmesg) if __name__ == '__main__': import sys import pdb fname = sys.argv[1] scene = None # Use offline bag files # Load the pointcloud messages # Find out the variance in # of points # Select one as canonical i = 0 for top, pc, t in ru.bag_iter(fname, ['/full_cloud']): # Want first message of at least this size if len(pc.points) > 20000: if i > 0: pdb.set_trace() scene = pointcloud_to_np(pc) break i = i + 1 # Run online to get gripper tip locations from TF # Subscribe to pressure readings, find contact times & get gripper tip locations ctl = ContactTipLocation() r = rospy.Rate(10) print 'running contact tip recorder' while not rospy.is_shutdown(): r.sleep() if ctl.last_msg != None and (time.time() - ctl.last_msg) > 60.0: break print 'saving pickle contact_locs.pkl' ut.save_pickle([scene, ctl.contact_locs], 'contact_locs.pkl') pdb.set_trace() print 'done.' # Use gripper tip locations to find out where in this pointcloud we are #class Contact3d: # def __init__(self): # rospy.init_node("contact_loc") # rospy.Subscriber('full_cloud', sm.PointCloud, self.point_cloud_cb) # # def point_cloud_cb(self, pc_msg): # if len(pc_msg.points) < 1: # return # pointcloud_to_np(pc_msg.points) #c = Contact3d() #r = rospy.Rate(10) #print 'running' #while not rospy.is_shutdown(): # r.sleep()
ajibawa-2023/Python-Code-Large/train/row_99688
71
144
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0069, 0.0069, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0069, 0.0069, 0, 0.66, 0.0714, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0139, 0.0069, 0, 0.66, 0.1429, 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_99688:Import_L3_C0", "label": "sensor_msgs.msg import sm", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0208, 0.0069, 0, 0.66, 0.2143, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["sm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sensor_msgs.msg as sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Import_L4_C0", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0278, 0.0069, 0, 0.66, 0.2857, 847, 0, 1, 0, 0, 847, 0, 0], "semantic": {"name": "hrl_lib.rutils", "arg_names": [], "import_names": ["ru"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.rutils as ru"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Import_L5_C0", "label": "numpy import np", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0347, 0.0069, 0, 0.66, 0.3571, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Import_L6_C0", "label": "pr2_msgs.msg import pm", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.0069, 0, 0.66, 0.4286, 797, 0, 1, 0, 0, 797, 0, 0], "semantic": {"name": "pr2_msgs.msg", "arg_names": [], "import_names": ["pm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pr2_msgs.msg as pm "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Import_L7_C0", "label": "tf import tf", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0486, 0.0069, 0, 0.66, 0.5, 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_99688:Import_L8_C0", "label": "hrl_lib.tf_utils import tfu", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0556, 0.0069, 0, 0.66, 0.5714, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "hrl_lib.tf_utils", "arg_names": [], "import_names": ["tfu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.tf_utils as tfu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Import_L9_C0", "label": "tf.transformations import tr", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0069, 0, 0.66, 0.6429, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Import_L10_C0", "label": "time import time", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0694, 0.0069, 0, 0.66, 0.7143, 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_99688:Import_L11_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0764, 0.0069, 0, 0.66, 0.7857, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L13_C0", "label": "pointcloud_to_np", "type": "function", "loc": [13, 17], "level": 0, "parent": null, "vector": [2, 0, 0.1042, 0.0347, 0, 0.66, 0.8571, 2, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "pointcloud_to_np", "arg_names": ["pc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pointcloud_to_np(pc):\n plist = []\n for p in pc.points:\n plist.append([p.x, p.y, p.z])\n return np.matrix(plist).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L14_C4", "label": "plist =", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L13_C0", "vector": [14, 1, 0.0972, 0.0069, 1, 0.17, 0.0, 938, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "plist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plist = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:For_L15_C4", "label": "for p", "type": "for", "loc": [15, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L13_C0", "vector": [6, 1, 0.1076, 0.0139, 1, 0.17, 0.5, 491, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for p in pc.points:\n plist.append([p.x, p.y, p.z])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L16_C8", "label": "append()", "type": "expression", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:For_L15_C4", "vector": [8, 2, 0.1111, 0.0069, 2, 0.33, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " plist.append([p.x, p.y, p.z])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Return_L17_C4", "label": "return", "type": "return", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L13_C0", "vector": [13, 1, 0.1181, 0.0069, 1, 0.17, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix(plist).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:ClassDef_L20_C0", "label": "ContactTipLocation", "type": "class", "loc": [20, 68], "level": 0, "parent": null, "vector": [3, 0, 0.3056, 0.3403, 0, 0.66, 0.9286, 791, 0, 4, 0, 0, 0, 0, 24], "semantic": {"name": "ContactTipLocation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ContactTipLocation:\n def __init__(self):\n rospy.init_node('contact3d')\n rospy.Subscriber('/pressure/l_gripper_motor', pm.PressureState, self.lpress_cb)\n rospy.Subscriber('/pressure/l_gripper_motor', pm.PressureState, self.rpress_cb)\n self.ftip_frames = ['r_gripper_l_finger_tip_link',\n 'r_gripper_r_finger_tip_link',\n 'l_gripper_l_finger_tip_link',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L21_C4", "label": "__init__", "type": "function", "loc": [21, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:ClassDef_L20_C0", "vector": [2, 1, 0.191, 0.0972, 1, 0.55, 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 rospy.init_node('contact3d')\n rospy.Subscriber('/pressure/l_gripper_motor', pm.PressureState, self.lpress_cb)\n rospy.Subscriber('/pressure/l_gripper_motor', pm.PressureState, self.rpress_cb)\n self.ftip_frames = ['r_gripper_l_finger_tip_link',\n 'r_gripper_r_finger_tip_link',\n 'l_gripper_l_finger_tip_link',\n 'l_gripper_r_finger_tip_link']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L22_C8", "label": "init_node()", "type": "expression", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L21_C4", "vector": [8, 2, 0.1528, 0.0069, 2, 0.36, 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('contact3d')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L23_C8", "label": "Subscriber()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L21_C4", "vector": [8, 2, 0.1597, 0.0069, 2, 0.36, 0.125, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/pressure/l_gripper_motor', pm.PressureState, self.lpress_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L24_C8", "label": "Subscriber()", "type": "expression", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L21_C4", "vector": [8, 2, 0.1667, 0.0069, 2, 0.36, 0.25, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/pressure/l_gripper_motor', pm.PressureState, self.rpress_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L25_C8", "label": "self.ftip_frames =", "type": "assigned_variable", "loc": [25, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L21_C4", "vector": [14, 2, 0.184, 0.0278, 2, 0.36, 0.375, 946, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ftip_frames", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ftip_frames = ['r_gripper_l_finger_tip_link',\n 'r_gripper_r_finger_tip_link',\n 'l_gripper_l_finger_tip_link',\n 'l_gripper_r_finger_tip_link']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L30_C8", "label": "self.tflistener = TransformListener()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L21_C4", "vector": [14, 2, 0.2083, 0.0069, 2, 0.36, 0.5, 50, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tflistener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.tflistener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L31_C8", "label": "self.lmat0 =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L21_C4", "vector": [14, 2, 0.2153, 0.0069, 2, 0.36, 0.625, 529, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.lmat0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.lmat0 = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L32_C8", "label": "self.rmat0 =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L21_C4", "vector": [14, 2, 0.2222, 0.0069, 2, 0.36, 0.75, 344, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.rmat0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rmat0 = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L33_C8", "label": "self.contact_locs =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L21_C4", "vector": [14, 2, 0.2292, 0.0069, 2, 0.36, 0.875, 853, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.contact_locs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.contact_locs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L34_C8", "label": "self.last_msg =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L21_C4", "vector": [14, 2, 0.2361, 0.0069, 2, 0.36, 1.0, 806, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.last_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.last_msg = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L36_C4", "label": "lpress_cb", "type": "function", "loc": [36, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:ClassDef_L20_C0", "vector": [2, 1, 0.3507, 0.2083, 1, 0.55, 0.5, 369, 0, 2, 1, 0, 0, 0, 20], "semantic": {"name": "lpress_cb", "arg_names": ["self", "pmsg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def lpress_cb(self, pmsg):\n #conv to mat\n lmat = np.matrix((pmsg.l_finger_tip)).T\n rmat = np.matrix((pmsg.r_finger_tip)).T\n if self.lmat0 == None:\n self.lmat0 = lmat\n self.rmat0 = rmat\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L38_C8", "label": "lmat =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L36_C4", "vector": [14, 2, 0.2639, 0.0069, 2, 0.95, 0.0, 697, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "lmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lmat = np.matrix((pmsg.l_finger_tip)).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L39_C8", "label": "rmat =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L36_C4", "vector": [14, 2, 0.2708, 0.0069, 2, 0.95, 0.1429, 674, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rmat = np.matrix((pmsg.r_finger_tip)).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L40_C8", "label": "if", "type": "if", "loc": [40, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L36_C4", "vector": [4, 2, 0.2882, 0.0278, 2, 0.95, 0.2857, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.lmat0 == None:\n self.lmat0 = lmat\n self.rmat0 = rmat\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L41_C12", "label": "self.lmat0 =", "type": "assigned_variable", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L40_C8", "vector": [14, 3, 0.2847, 0.0069, 3, 0.37, 0.0, 529, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.lmat0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.lmat0 = lmat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L42_C12", "label": "self.rmat0 =", "type": "assigned_variable", "loc": [42, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L40_C8", "vector": [14, 3, 0.2917, 0.0069, 3, 0.37, 0.5, 344, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rmat0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rmat0 = rmat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Return_L43_C12", "label": "return", "type": "return", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L40_C8", "vector": [13, 3, 0.2986, 0.0069, 3, 0.37, 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_99688:Assign_L46_C8", "label": "lmat =", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L36_C4", "vector": [14, 2, 0.3194, 0.0069, 2, 0.95, 0.4286, 697, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lmat = lmat - self.lmat0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L47_C8", "label": "rmat =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L36_C4", "vector": [14, 2, 0.3264, 0.0069, 2, 0.95, 0.5714, 674, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rmat = rmat - self.rmat0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L50_C8", "label": "if", "type": "if", "loc": [50, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L36_C4", "vector": [4, 2, 0.3889, 0.0903, 2, 0.95, 0.7143, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.any(np.abs(lmat) > 250) or np.any(np.abs(rmat) > 250): #TODO: replace this with something more sound\n #Contact has been made!! look up gripper tip location\n to_frame = 'base_link'\n def frame_loc(from_frame):\n p_base = tfu.transform('base_footprint', from_frame, self.tflistener) \\\n * tfu.tf_as_matrix(([0., 0., 0., 1.], tr.quaternion_from_euler(0,0,0)))\n #* tfu.tf_as_matrix((p.A1.tolist(), tr.quaternion_from_euler(0,0,0)))\n return tfu.matrix_as_tf(p_base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L52_C12", "label": "to_frame =", "type": "assigned_variable", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L50_C8", "vector": [14, 3, 0.3611, 0.0069, 3, 0.41, 0.0, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "to_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " to_frame = 'base_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L53_C12", "label": "frame_loc", "type": "function", "loc": [53, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L50_C8", "vector": [2, 3, 0.3819, 0.0347, 3, 0.41, 0.2, 319, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "frame_loc", "arg_names": ["from_frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def frame_loc(from_frame):\n p_base = tfu.transform('base_footprint', from_frame, self.tflistener) \\\n * tfu.tf_as_matrix(([0., 0., 0., 1.], tr.quaternion_from_euler(0,0,0)))\n #* tfu.tf_as_matrix((p.A1.tolist(), tr.quaternion_from_euler(0,0,0)))\n return tfu.matrix_as_tf(p_base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L54_C16", "label": "p_base =", "type": "assigned_variable", "loc": [54, 55], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L53_C12", "vector": [14, 4, 0.3785, 0.0139, 4, 0.2, 0.0, 544, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "p_base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_base = tfu.transform('base_footprint', from_frame, self.tflistener) \\\n * tfu.tf_as_matrix(([0., 0., 0., 1.], tr.quaternion_from_euler(0,0,0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Return_L57_C16", "label": "return", "type": "return", "loc": [57, 57], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L53_C12", "vector": [13, 4, 0.3958, 0.0069, 4, 0.2, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tfu.matrix_as_tf(p_base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L59_C12", "label": "tip_locs =", "type": "assigned_variable", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L50_C8", "vector": [14, 3, 0.4097, 0.0069, 3, 0.41, 0.4, 561, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tip_locs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tip_locs = [frame_loc(n)[0] for n in self.ftip_frames]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L60_C12", "label": "t = to_time()", "type": "assigned_variable", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L50_C8", "vector": [14, 3, 0.4167, 0.0069, 3, 0.41, 0.6, 15, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "to_time", "annotation": ""}, "snippet": " t = pmsg.header.stamp.to_time() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L61_C12", "label": "loginfo()", "type": "expression", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L50_C8", "vector": [8, 3, 0.4236, 0.0069, 3, 0.41, 0.8, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"contact detected at %.3f\" % t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L62_C12", "label": "append()", "type": "expression", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L50_C8", "vector": [8, 3, 0.4306, 0.0069, 3, 0.41, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.contact_locs.append([t, tip_locs])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L64_C8", "label": "self.last_msg = time()", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L36_C4", "vector": [14, 2, 0.4444, 0.0069, 2, 0.95, 0.8571, 806, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "self.last_msg", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " self.last_msg = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L65_C8", "label": "loginfo()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L36_C4", "vector": [8, 2, 0.4514, 0.0069, 2, 0.95, 1.0, 607, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('lpress_cb ' + str(np.max(rmat)) + ' ' + str(np.max(lmat)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L67_C4", "label": "rpress_cb", "type": "function", "loc": [67, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:ClassDef_L20_C0", "vector": [2, 1, 0.4688, 0.0139, 1, 0.55, 1.0, 475, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "rpress_cb", "arg_names": ["self", "pmsesg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def rpress_cb(self, pmsesg):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "label": "if", "type": "if", "loc": [72, 106], "level": 0, "parent": null, "vector": [4, 0, 0.6181, 0.2431, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import sys\n import pdb\n\n fname = sys.argv[1]\n scene = None\n # Use offline bag files\n # Load the pointcloud messages"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Import_L73_C4", "label": "sys import sys", "type": "import", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "vector": [1, 1, 0.5069, 0.0069, 1, 0.8, 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_99688:Import_L74_C4", "label": "pdb import pdb", "type": "import", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "vector": [1, 1, 0.5139, 0.0069, 1, 0.8, 0.0769, 91, 0, 1, 0, 0, 91, 0, 0], "semantic": {"name": "pdb", "arg_names": [], "import_names": ["pdb"], "rhs_call_name": "", "annotation": ""}, "snippet": " import pdb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L76_C4", "label": "fname =", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "vector": [14, 1, 0.5278, 0.0069, 1, 0.8, 0.1538, 190, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fname = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L77_C4", "label": "scene =", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "vector": [14, 1, 0.5347, 0.0069, 1, 0.8, 0.2308, 766, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "scene", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scene = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L82_C4", "label": "i =", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "vector": [14, 1, 0.5694, 0.0069, 1, 0.8, 0.3077, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:For_L83_C4", "label": "for top, pc, t", "type": "for", "loc": [83, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "vector": [6, 1, 0.6007, 0.0556, 1, 0.8, 0.3846, 184, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "top, pc, t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for top, pc, t in ru.bag_iter(fname, ['/full_cloud']):\n # Want first message of at least this size\n if len(pc.points) > 20000:\n if i > 0:\n pdb.set_trace()\n scene = pointcloud_to_np(pc)\n break\n i = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L85_C8", "label": "if", "type": "if", "loc": [85, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:For_L83_C4", "vector": [4, 2, 0.6076, 0.0417, 2, 0.48, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(pc.points) > 20000:\n if i > 0:\n pdb.set_trace()\n scene = pointcloud_to_np(pc)\n break\n i = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L86_C12", "label": "if", "type": "if", "loc": [86, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L85_C8", "vector": [4, 3, 0.6076, 0.0278, 3, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i > 0:\n pdb.set_trace()\n scene = pointcloud_to_np(pc)\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L87_C16", "label": "set_trace()", "type": "expression", "loc": [87, 87], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L86_C12", "vector": [8, 4, 0.6042, 0.0069, 4, 0.1, 0.0, 796, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_trace", "arg_names": [], "import_names": [], "rhs_call_name": "set_trace", "annotation": ""}, "snippet": " pdb.set_trace()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L88_C16", "label": "scene = pointcloud_to_np()", "type": "assigned_variable", "loc": [88, 88], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L86_C12", "vector": [14, 4, 0.6111, 0.0069, 4, 0.1, 1.0, 766, 3, 1, 0, 0, 2, 10, 1], "semantic": {"name": "scene", "arg_names": [], "import_names": [], "rhs_call_name": "pointcloud_to_np", "annotation": ""}, "snippet": " scene = pointcloud_to_np(pc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L90_C12", "label": "i =", "type": "assigned_variable", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L85_C8", "vector": [14, 3, 0.625, 0.0069, 3, 0.99, 1.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L94_C4", "label": "ctl = ContactTipLocation()", "type": "assigned_variable", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "vector": [14, 1, 0.6528, 0.0069, 1, 0.8, 0.4615, 1, 3, 0, 0, 0, 791, 10, 1], "semantic": {"name": "ctl", "arg_names": [], "import_names": [], "rhs_call_name": "ContactTipLocation", "annotation": ""}, "snippet": " ctl = ContactTipLocation()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L95_C4", "label": "r = Rate()", "type": "assigned_variable", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "vector": [14, 1, 0.6597, 0.0069, 1, 0.8, 0.5385, 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_99688:Expr_L96_C4", "label": "print()", "type": "expression", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "vector": [8, 1, 0.6667, 0.0069, 1, 0.8, 0.6154, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('running contact tip recorder')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:While_L97_C4", "label": "while", "type": "while", "loc": [97, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "vector": [5, 1, 0.684, 0.0278, 1, 0.8, 0.6923, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n r.sleep()\n if ctl.last_msg != None and (time.time() - ctl.last_msg) > 60.0:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L98_C8", "label": "sleep()", "type": "expression", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:While_L97_C4", "vector": [8, 2, 0.6806, 0.0069, 2, 0.87, 0.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_99688:If_L99_C8", "label": "if", "type": "if", "loc": [99, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:While_L97_C4", "vector": [4, 2, 0.691, 0.0139, 2, 0.87, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ctl.last_msg != None and (time.time() - ctl.last_msg) > 60.0:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L102_C4", "label": "print()", "type": "expression", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "vector": [8, 1, 0.7083, 0.0069, 1, 0.8, 0.7692, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('saving pickle contact_locs.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L103_C4", "label": "save_pickle()", "type": "expression", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "vector": [8, 1, 0.7153, 0.0069, 1, 0.8, 0.8462, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle([scene, ctl.contact_locs], 'contact_locs.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L105_C4", "label": "set_trace()", "type": "expression", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "vector": [8, 1, 0.7292, 0.0069, 1, 0.8, 0.9231, 796, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_trace", "arg_names": [], "import_names": [], "rhs_call_name": "set_trace", "annotation": ""}, "snippet": " pdb.set_trace()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L106_C4", "label": "print()", "type": "expression", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "vector": [8, 1, 0.7361, 0.0069, 1, 0.8, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('done.')"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:For_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:For_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Return_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Return_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L53_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L54_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L53_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Return_L57_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:FunctionDef_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Import_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Import_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:For_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:For_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L85_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L86_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L87_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L86_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L88_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L85_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:While_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:While_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:While_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99688:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99688:Expr_L106_C4"}]
import roslib; roslib.load_manifest('hai_sandbox') import rospy import hrl_lib.util as ut import sensor_msgs.msg as sm import sys class CamInfoCB: def __init__(self, topic): rospy.init_node('grab_cam_info') rospy.Subscriber(topic, sm.CameraInfo, self.cb) self.msg = None def cb(self, msg): self.msg = msg topic = sys.argv[1] save_name = sys.argv[2] c = CamInfoCB(topic) r = rospy.Rate(10) while not rospy.is_shutdown() and c.msg == None: r.sleep() ut.save_pickle(c.msg, save_name)
ajibawa-2023/Python-Code-Large/train/row_99689
20
24
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99689:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.0417, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99689:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0417, 0.0417, 0, 0.66, 0.0833, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99689:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0417, 0, 0.66, 0.1667, 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_99689:Import_L3_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.0417, 0, 0.66, 0.25, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99689:Import_L4_C0", "label": "sensor_msgs.msg import sm", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.0417, 0, 0.66, 0.3333, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["sm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sensor_msgs.msg as sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99689:Import_L5_C0", "label": "sys import sys", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.2083, 0.0417, 0, 0.66, 0.4167, 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_99689:ClassDef_L7_C0", "label": "CamInfoCB", "type": "class", "loc": [7, 14], "level": 0, "parent": null, "vector": [3, 0, 0.4375, 0.3333, 0, 0.66, 0.5, 147, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "CamInfoCB", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CamInfoCB:\n def __init__(self, topic):\n rospy.init_node('grab_cam_info')\n rospy.Subscriber(topic, sm.CameraInfo, self.cb)\n self.msg = None\n\n def cb(self, msg):\n self.msg = msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99689:FunctionDef_L8_C4", "label": "__init__", "type": "function", "loc": [8, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99689:ClassDef_L7_C0", "vector": [2, 1, 0.3958, 0.1667, 1, 0.13, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, topic):\n rospy.init_node('grab_cam_info')\n rospy.Subscriber(topic, sm.CameraInfo, self.cb)\n self.msg = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99689:Expr_L9_C8", "label": "init_node()", "type": "expression", "loc": [9, 9], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99689:FunctionDef_L8_C4", "vector": [8, 2, 0.375, 0.0417, 2, 0.5, 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('grab_cam_info')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99689:Expr_L10_C8", "label": "Subscriber()", "type": "expression", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99689:FunctionDef_L8_C4", "vector": [8, 2, 0.4167, 0.0417, 2, 0.5, 0.5, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber(topic, sm.CameraInfo, self.cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99689:Assign_L11_C8", "label": "self.msg =", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99689:FunctionDef_L8_C4", "vector": [14, 2, 0.4583, 0.0417, 2, 0.5, 1.0, 528, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.msg = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99689:FunctionDef_L13_C4", "label": "cb", "type": "function", "loc": [13, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99689:ClassDef_L7_C0", "vector": [2, 1, 0.5625, 0.0833, 1, 0.13, 1.0, 540, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def cb(self, msg):\n self.msg = msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99689:Assign_L14_C8", "label": "self.msg =", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99689:FunctionDef_L13_C4", "vector": [14, 2, 0.5833, 0.0417, 2, 0.52, 0.0, 528, 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_99689:Assign_L16_C0", "label": "topic =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.6667, 0.0417, 0, 0.66, 0.5833, 225, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "topic = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99689:Assign_L17_C0", "label": "save_name =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.7083, 0.0417, 0, 0.66, 0.6667, 894, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "save_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "save_name = sys.argv[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99689:Assign_L18_C0", "label": "c = CamInfoCB()", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.0417, 0, 0.66, 0.75, 411, 3, 1, 0, 0, 147, 10, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "CamInfoCB", "annotation": ""}, "snippet": "c = CamInfoCB(topic)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99689:Assign_L19_C0", "label": "r = Rate()", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.7917, 0.0417, 0, 0.66, 0.8333, 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_99689:While_L20_C0", "label": "while", "type": "while", "loc": [20, 21], "level": 0, "parent": null, "vector": [5, 0, 0.8542, 0.0833, 0, 0.66, 0.9167, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "while not rospy.is_shutdown() and c.msg == None:\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99689:Expr_L21_C4", "label": "sleep()", "type": "expression", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99689:While_L20_C0", "vector": [8, 1, 0.875, 0.0417, 1, 0.45, 0.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_99689:Expr_L22_C0", "label": "save_pickle()", "type": "expression", "loc": [22, 22], "level": 0, "parent": null, "vector": [8, 0, 0.9167, 0.0417, 0, 0.66, 1.0, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": "ut.save_pickle(c.msg, save_name)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99689:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99689:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99689:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99689:Expr_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99689:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99689:Expr_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99689:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99689:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99689:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99689:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99689:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99689:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99689:While_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99689:Expr_L21_C4"}]
import roslib; roslib.load_manifest('hai_sandbox') import rospy import kinematics_msgs.srv as ks import hrl_lib.tf_utils as tfu import tf import hai_sandbox.pr2_kinematics as pr2k import sensor_msgs.msg as sm import hrl_lib.rutils as ru import numpy as np import hrl_lib.util as ut def script(): rospy.init_node('forward_kin') tflistener = tf.TransformListener() print 'waiting for transform' tflistener.waitForTransform('r_gripper_tool_frame', 'r_wrist_roll_link', rospy.Time(), rospy.Duration(10)) print 'waiting for services' rospy.wait_for_service('pr2_right_arm_kinematics/get_fk_solver_info')#, ks.GetKinematicSolverInfo ) rospy.wait_for_service('pr2_right_arm_kinematics/get_fk')#, ks.GetPositionFK) print 'done init' r_fk_info = rospy.ServiceProxy('pr2_right_arm_kinematics/get_fk_solver_info', ks.GetKinematicSolverInfo ) r_fk = rospy.ServiceProxy('pr2_right_arm_kinematics/get_fk', ks.GetPositionFK) resp = r_fk_info() print 'get_fk_solver_info returned', resp.kinematic_solver_info.joint_names print 'get_fk_solver_info returned', resp.kinematic_solver_info.limits print 'get_fk_solver_info returned', resp.kinematic_solver_info.link_names fk_req = ks.GetPositionFKRequest() fk_req.header.frame_id = 'torso_lift_link' fk_req.fk_link_names = ['r_wrist_roll_link'] fk_req.robot_state.joint_state.name = resp.kinematic_solver_info.joint_names fk_req.robot_state.joint_state.position = [.5 for i in range(len(resp.kinematic_solver_info.joint_names))] fk_resp = r_fk(fk_req) rtip_T_wr = tfu.transform('r_gripper_tool_frame', 'r_wrist_roll_link', tflistener) right_wr = tfu.pose_as_matrix(fk_resp.pose_stamped[0].pose) rtip_pose = rtip_T_wr * right_wr print tfu.matrix_as_tf(rtip_pose) class TestForwardKin: def __init__(self): self.name_dict = None self.msgs = [] self.joint_idx = {} rospy.init_node('forward_kin') self.tflistener = tf.TransformListener() self.fkright = pr2k.PR2ArmKinematics('right', self.tflistener) self.point_cloud_pub = rospy.Publisher('right_fk', sm.PointCloud) rospy.Subscriber('/joint_states', sm.JointState, self.joint_state_cb) print 'done init' def joint_state_cb(self, msg): if self.name_dict == None: self.name_dict = {} for i, n in enumerate(msg.name): self.name_dict[n] = i self.joint_groups = ut.load_pickle('link_names.pkl') for group in self.joint_groups.keys(): self.joint_idx[group] = [self.name_dict[name] for name in self.joint_groups[group]] dmat = np.matrix(msg.position).T joint_angles = dmat[self.joint_idx['rarm'], 0].A1.tolist() #print len(joint_angles) #print dmat.shape, self.joint_idx['rarm'] rtip_pose = self.fkright.fk('base_footprint', 'r_wrist_roll_link', 'r_gripper_tool_frame', joint_angles) position = rtip_pose[0:3,3] #print position.T pc = ru.np_to_pointcloud(position, 'base_footprint') pc.header.stamp = rospy.get_rostime() self.point_cloud_pub.publish(pc) def run(self): r = rospy.Rate(10) while not rospy.is_shutdown(): r.sleep() def kin_class(): tflistener = tf.TransformListener() right = pr2k.PR2ArmKinematics('right', tflistener) rtip_pose = right.fk('torso_lift_link', 'r_wrist_roll_link', 'r_gripper_tool_frame', [.5 for i in range(len(right.joint_names))]) print tfu.matrix_as_tf(rtip_pose) left = pr2k.PR2ArmKinematics('left', tflistener) ltip_pose = left.fk('torso_lift_link', 'l_wrist_roll_link', 'l_gripper_tool_frame', [.5 for i in range(len(left.joint_names))]) print tfu.matrix_as_tf(ltip_pose) if __name__ == '__main__': #kin_class() t = TestForwardKin() t.run()
ajibawa-2023/Python-Code-Large/train/row_99690
77
118
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0085, 0.0085, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0085, 0.0085, 0, 0.66, 0.0714, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0169, 0.0085, 0, 0.66, 0.1429, 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_99690:Import_L3_C0", "label": "kinematics_msgs.srv import ks", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0254, 0.0085, 0, 0.66, 0.2143, 247, 0, 1, 0, 0, 247, 0, 0], "semantic": {"name": "kinematics_msgs.srv", "arg_names": [], "import_names": ["ks"], "rhs_call_name": "", "annotation": ""}, "snippet": "import kinematics_msgs.srv as ks"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Import_L4_C0", "label": "hrl_lib.tf_utils import tfu", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0339, 0.0085, 0, 0.66, 0.2857, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "hrl_lib.tf_utils", "arg_names": [], "import_names": ["tfu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.tf_utils as tfu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Import_L5_C0", "label": "tf import tf", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0424, 0.0085, 0, 0.66, 0.3571, 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_99690:Import_L6_C0", "label": "hai_sandbox.pr2_kinematics import pr2k", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0508, 0.0085, 0, 0.66, 0.4286, 11, 0, 1, 0, 0, 11, 0, 0], "semantic": {"name": "hai_sandbox.pr2_kinematics", "arg_names": [], "import_names": ["pr2k"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hai_sandbox.pr2_kinematics as pr2k"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Import_L7_C0", "label": "sensor_msgs.msg import sm", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0593, 0.0085, 0, 0.66, 0.5, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["sm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sensor_msgs.msg as sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Import_L8_C0", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0678, 0.0085, 0, 0.66, 0.5714, 847, 0, 1, 0, 0, 847, 0, 0], "semantic": {"name": "hrl_lib.rutils", "arg_names": [], "import_names": ["ru"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.rutils as ru"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Import_L9_C0", "label": "numpy import np", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0763, 0.0085, 0, 0.66, 0.6429, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Import_L10_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0847, 0.0085, 0, 0.66, 0.7143, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "label": "script", "type": "function", "loc": [12, 40], "level": 0, "parent": null, "vector": [2, 0, 0.2203, 0.2458, 0, 0.66, 0.7857, 254, 0, 0, 0, 0, 0, 0, 24], "semantic": {"name": "script", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def script():\n rospy.init_node('forward_kin')\n tflistener = tf.TransformListener()\n print('waiting for transform')\n tflistener.waitForTransform('r_gripper_tool_frame', 'r_wrist_roll_link', rospy.Time(), rospy.Duration(10))\n print('waiting for services')\n rospy.wait_for_service('pr2_right_arm_kinematics/get_fk_solver_info')#, ks.GetKinematicSolverInfo )\n rospy.wait_for_service('pr2_right_arm_kinematics/get_fk')#, ks.GetPositionFK)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L13_C4", "label": "init_node()", "type": "expression", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [8, 1, 0.1102, 0.0085, 1, 0.88, 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('forward_kin')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L14_C4", "label": "tflistener = TransformListener()", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [14, 1, 0.1186, 0.0085, 1, 0.88, 0.0435, 313, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "tflistener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " tflistener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L15_C4", "label": "print()", "type": "expression", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [8, 1, 0.1271, 0.0085, 1, 0.88, 0.087, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('waiting for transform')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L16_C4", "label": "waitForTransform()", "type": "expression", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [8, 1, 0.1356, 0.0085, 1, 0.88, 0.1304, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " tflistener.waitForTransform('r_gripper_tool_frame', 'r_wrist_roll_link', rospy.Time(), rospy.Duration(10))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L17_C4", "label": "print()", "type": "expression", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [8, 1, 0.1441, 0.0085, 1, 0.88, 0.1739, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('waiting for services')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L18_C4", "label": "wait_for_service()", "type": "expression", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [8, 1, 0.1525, 0.0085, 1, 0.88, 0.2174, 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('pr2_right_arm_kinematics/get_fk_solver_info')#, ks.GetKinematicSolverInfo )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L19_C4", "label": "wait_for_service()", "type": "expression", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [8, 1, 0.161, 0.0085, 1, 0.88, 0.2609, 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('pr2_right_arm_kinematics/get_fk')#, ks.GetPositionFK)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L20_C4", "label": "print()", "type": "expression", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [8, 1, 0.1695, 0.0085, 1, 0.88, 0.3043, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('done init')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L22_C4", "label": "r_fk_info = ServiceProxy()", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [14, 1, 0.1864, 0.0085, 1, 0.88, 0.3478, 178, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "r_fk_info", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " r_fk_info = rospy.ServiceProxy('pr2_right_arm_kinematics/get_fk_solver_info', ks.GetKinematicSolverInfo )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L23_C4", "label": "r_fk = ServiceProxy()", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [14, 1, 0.1949, 0.0085, 1, 0.88, 0.3913, 263, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "r_fk", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " r_fk = rospy.ServiceProxy('pr2_right_arm_kinematics/get_fk', ks.GetPositionFK)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L25_C4", "label": "resp = r_fk_info()", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [14, 1, 0.2119, 0.0085, 1, 0.88, 0.4348, 48, 3, 0, 0, 0, 178, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "r_fk_info", "annotation": ""}, "snippet": " resp = r_fk_info()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L26_C4", "label": "print()", "type": "expression", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [8, 1, 0.2203, 0.0085, 1, 0.88, 0.4783, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('get_fk_solver_info returned', resp.kinematic_solver_info.joint_names)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L27_C4", "label": "print()", "type": "expression", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [8, 1, 0.2288, 0.0085, 1, 0.88, 0.5217, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('get_fk_solver_info returned', resp.kinematic_solver_info.limits)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L28_C4", "label": "print()", "type": "expression", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [8, 1, 0.2373, 0.0085, 1, 0.88, 0.5652, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('get_fk_solver_info returned', resp.kinematic_solver_info.link_names)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L30_C4", "label": "fk_req = GetPositionFKRequest()", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [14, 1, 0.2542, 0.0085, 1, 0.88, 0.6087, 192, 3, 0, 0, 0, 7, 10, 1], "semantic": {"name": "fk_req", "arg_names": [], "import_names": [], "rhs_call_name": "GetPositionFKRequest", "annotation": ""}, "snippet": " fk_req = ks.GetPositionFKRequest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L31_C4", "label": "fk_req.header.frame_id =", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [14, 1, 0.2627, 0.0085, 1, 0.88, 0.6522, 144, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "fk_req.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fk_req.header.frame_id = 'torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L32_C4", "label": "fk_req.fk_link_names =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [14, 1, 0.2712, 0.0085, 1, 0.88, 0.6957, 255, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "fk_req.fk_link_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fk_req.fk_link_names = ['r_wrist_roll_link']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L33_C4", "label": "fk_req.robot_state.joint_state.name =", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [14, 1, 0.2797, 0.0085, 1, 0.88, 0.7391, 345, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fk_req.robot_state.joint_state.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fk_req.robot_state.joint_state.name = resp.kinematic_solver_info.joint_names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L34_C4", "label": "fk_req.robot_state.joint_state.position =", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [14, 1, 0.2881, 0.0085, 1, 0.88, 0.7826, 514, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "fk_req.robot_state.joint_state.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fk_req.robot_state.joint_state.position = [.5 for i in range(len(resp.kinematic_solver_info.joint_names))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L35_C4", "label": "fk_resp = r_fk()", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [14, 1, 0.2966, 0.0085, 1, 0.88, 0.8261, 178, 3, 1, 0, 0, 263, 10, 1], "semantic": {"name": "fk_resp", "arg_names": [], "import_names": [], "rhs_call_name": "r_fk", "annotation": ""}, "snippet": " fk_resp = r_fk(fk_req)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L37_C4", "label": "rtip_T_wr = transform()", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [14, 1, 0.3136, 0.0085, 1, 0.88, 0.8696, 233, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "rtip_T_wr", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " rtip_T_wr = tfu.transform('r_gripper_tool_frame', 'r_wrist_roll_link', tflistener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L38_C4", "label": "right_wr = pose_as_matrix()", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [14, 1, 0.322, 0.0085, 1, 0.88, 0.913, 639, 3, 1, 0, 0, 770, 10, 1], "semantic": {"name": "right_wr", "arg_names": [], "import_names": [], "rhs_call_name": "pose_as_matrix", "annotation": ""}, "snippet": " right_wr = tfu.pose_as_matrix(fk_resp.pose_stamped[0].pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L39_C4", "label": "rtip_pose =", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [14, 1, 0.3305, 0.0085, 1, 0.88, 0.9565, 981, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rtip_pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rtip_pose = rtip_T_wr * right_wr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L40_C4", "label": "print()", "type": "expression", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "vector": [8, 1, 0.339, 0.0085, 1, 0.88, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(tfu.matrix_as_tf(rtip_pose))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:ClassDef_L42_C0", "label": "TestForwardKin", "type": "class", "loc": [42, 81], "level": 0, "parent": null, "vector": [3, 0, 0.5212, 0.339, 0, 0.66, 0.8571, 730, 0, 3, 0, 0, 0, 0, 18], "semantic": {"name": "TestForwardKin", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TestForwardKin:\n def __init__(self):\n self.name_dict = None\n self.msgs = []\n self.joint_idx = {}\n\n rospy.init_node('forward_kin')\n self.tflistener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L43_C4", "label": "__init__", "type": "function", "loc": [43, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:ClassDef_L42_C0", "vector": [2, 1, 0.411, 0.1017, 1, 0.82, 0.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 self.name_dict = None\n self.msgs = []\n self.joint_idx = {}\n\n rospy.init_node('forward_kin')\n self.tflistener = tf.TransformListener()\n self.fkright = pr2k.PR2ArmKinematics('right', self.tflistener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L44_C8", "label": "self.name_dict =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L43_C4", "vector": [14, 2, 0.3729, 0.0085, 2, 0.73, 0.0, 409, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.name_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name_dict = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L45_C8", "label": "self.msgs =", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L43_C4", "vector": [14, 2, 0.3814, 0.0085, 2, 0.73, 0.125, 12, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.msgs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.msgs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L46_C8", "label": "self.joint_idx =", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L43_C4", "vector": [14, 2, 0.3898, 0.0085, 2, 0.73, 0.25, 717, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.joint_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_idx = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L48_C8", "label": "init_node()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L43_C4", "vector": [8, 2, 0.4068, 0.0085, 2, 0.73, 0.375, 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('forward_kin')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L49_C8", "label": "self.tflistener = TransformListener()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L43_C4", "vector": [14, 2, 0.4153, 0.0085, 2, 0.73, 0.5, 50, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tflistener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.tflistener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L50_C8", "label": "self.fkright = PR2ArmKinematics()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L43_C4", "vector": [14, 2, 0.4237, 0.0085, 2, 0.73, 0.625, 108, 3, 2, 0, 0, 108, 10, 1], "semantic": {"name": "self.fkright", "arg_names": [], "import_names": [], "rhs_call_name": "PR2ArmKinematics", "annotation": ""}, "snippet": " self.fkright = pr2k.PR2ArmKinematics('right', self.tflistener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L51_C8", "label": "self.point_cloud_pub = Publisher()", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L43_C4", "vector": [14, 2, 0.4322, 0.0085, 2, 0.73, 0.75, 36, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.point_cloud_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.point_cloud_pub = rospy.Publisher('right_fk', sm.PointCloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L53_C8", "label": "Subscriber()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L43_C4", "vector": [8, 2, 0.4492, 0.0085, 2, 0.73, 0.875, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/joint_states', sm.JointState, self.joint_state_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L54_C8", "label": "print()", "type": "expression", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L43_C4", "vector": [8, 2, 0.4576, 0.0085, 2, 0.73, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('done init')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L57_C4", "label": "joint_state_cb", "type": "function", "loc": [57, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:ClassDef_L42_C0", "vector": [2, 1, 0.5636, 0.1695, 1, 0.82, 0.5, 340, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "joint_state_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def joint_state_cb(self, msg):\n if self.name_dict == None:\n self.name_dict = {}\n for i, n in enumerate(msg.name):\n self.name_dict[n] = i \n self.joint_groups = ut.load_pickle('link_names.pkl')\n for group in self.joint_groups.keys():\n self.joint_idx[group] = [self.name_dict[name] for name in self.joint_groups[group]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:If_L58_C8", "label": "if", "type": "if", "loc": [58, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L57_C4", "vector": [4, 2, 0.5169, 0.0593, 2, 0.92, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.name_dict == None:\n self.name_dict = {}\n for i, n in enumerate(msg.name):\n self.name_dict[n] = i \n self.joint_groups = ut.load_pickle('link_names.pkl')\n for group in self.joint_groups.keys():\n self.joint_idx[group] = [self.name_dict[name] for name in self.joint_groups[group]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L59_C12", "label": "self.name_dict =", "type": "assigned_variable", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:If_L58_C8", "vector": [14, 3, 0.5, 0.0085, 3, 0.21, 0.0, 409, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.name_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:For_L60_C12", "label": "for i, n", "type": "for", "loc": [60, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:If_L58_C8", "vector": [6, 3, 0.5127, 0.0169, 3, 0.21, 0.3333, 217, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i, n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, n in enumerate(msg.name):\n self.name_dict[n] = i "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L61_C16", "label": "assign", "type": "assigned_variable", "loc": [61, 61], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:For_L60_C12", "vector": [14, 4, 0.5169, 0.0085, 4, 0.19, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name_dict[n] = i "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L62_C12", "label": "self.joint_groups = load_pickle()", "type": "assigned_variable", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:If_L58_C8", "vector": [14, 3, 0.5254, 0.0085, 3, 0.21, 0.6667, 452, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "self.joint_groups", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " self.joint_groups = ut.load_pickle('link_names.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:For_L63_C12", "label": "for group", "type": "for", "loc": [63, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:If_L58_C8", "vector": [6, 3, 0.5381, 0.0169, 3, 0.21, 1.0, 43, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "group", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for group in self.joint_groups.keys():\n self.joint_idx[group] = [self.name_dict[name] for name in self.joint_groups[group]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L64_C16", "label": "assign", "type": "assigned_variable", "loc": [64, 64], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:For_L63_C12", "vector": [14, 4, 0.5424, 0.0085, 4, 0.62, 0.0, 0, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_idx[group] = [self.name_dict[name] for name in self.joint_groups[group]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L66_C8", "label": "dmat =", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L57_C4", "vector": [14, 2, 0.5593, 0.0085, 2, 0.92, 0.1429, 447, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dmat = np.matrix(msg.position).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L67_C8", "label": "joint_angles = tolist()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L57_C4", "vector": [14, 2, 0.5678, 0.0085, 2, 0.92, 0.2857, 844, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "joint_angles", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " joint_angles = dmat[self.joint_idx['rarm'], 0].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L70_C8", "label": "rtip_pose = fk()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L57_C4", "vector": [14, 2, 0.5932, 0.0085, 2, 0.92, 0.4286, 981, 3, 4, 0, 0, 714, 10, 1], "semantic": {"name": "rtip_pose", "arg_names": [], "import_names": [], "rhs_call_name": "fk", "annotation": ""}, "snippet": " rtip_pose = self.fkright.fk('base_footprint', 'r_wrist_roll_link', 'r_gripper_tool_frame', joint_angles)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L71_C8", "label": "position =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L57_C4", "vector": [14, 2, 0.6017, 0.0085, 2, 0.92, 0.5714, 516, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " position = rtip_pose[0:3,3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L74_C8", "label": "pc = np_to_pointcloud()", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L57_C4", "vector": [14, 2, 0.6271, 0.0085, 2, 0.92, 0.7143, 876, 3, 2, 0, 0, 712, 10, 1], "semantic": {"name": "pc", "arg_names": [], "import_names": [], "rhs_call_name": "np_to_pointcloud", "annotation": ""}, "snippet": " pc = ru.np_to_pointcloud(position, 'base_footprint')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L75_C8", "label": "pc.header.stamp = get_rostime()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L57_C4", "vector": [14, 2, 0.6356, 0.0085, 2, 0.92, 0.8571, 600, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "pc.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " pc.header.stamp = rospy.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L76_C8", "label": "publish()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L57_C4", "vector": [8, 2, 0.6441, 0.0085, 2, 0.92, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.point_cloud_pub.publish(pc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L78_C4", "label": "run", "type": "function", "loc": [78, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:ClassDef_L42_C0", "vector": [2, 1, 0.6737, 0.0339, 1, 0.82, 1.0, 679, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run(self):\n r = rospy.Rate(10)\n while not rospy.is_shutdown():\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L79_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L78_C4", "vector": [14, 2, 0.6695, 0.0085, 2, 0.93, 0.0, 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_99690:While_L80_C8", "label": "while", "type": "while", "loc": [80, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L78_C4", "vector": [5, 2, 0.6822, 0.0169, 2, 0.93, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L81_C12", "label": "sleep()", "type": "expression", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:While_L80_C8", "vector": [8, 3, 0.6864, 0.0085, 3, 0.44, 0.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_99690:FunctionDef_L84_C0", "label": "kin_class", "type": "function", "loc": [84, 92], "level": 0, "parent": null, "vector": [2, 0, 0.7458, 0.0763, 0, 0.66, 0.9286, 132, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "kin_class", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def kin_class():\n tflistener = tf.TransformListener()\n right = pr2k.PR2ArmKinematics('right', tflistener)\n rtip_pose = right.fk('torso_lift_link', 'r_wrist_roll_link', 'r_gripper_tool_frame', [.5 for i in range(len(right.joint_names))])\n print(tfu.matrix_as_tf(rtip_pose))\n\n left = pr2k.PR2ArmKinematics('left', tflistener)\n ltip_pose = left.fk('torso_lift_link', 'l_wrist_roll_link', 'l_gripper_tool_frame', [.5 for i in range(len(left.joint_names))])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L85_C4", "label": "tflistener = TransformListener()", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L84_C0", "vector": [14, 1, 0.7203, 0.0085, 1, 0.62, 0.0, 313, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "tflistener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " tflistener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L86_C4", "label": "right = PR2ArmKinematics()", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L84_C0", "vector": [14, 1, 0.7288, 0.0085, 1, 0.62, 0.1667, 724, 3, 2, 0, 0, 108, 10, 1], "semantic": {"name": "right", "arg_names": [], "import_names": [], "rhs_call_name": "PR2ArmKinematics", "annotation": ""}, "snippet": " right = pr2k.PR2ArmKinematics('right', tflistener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L87_C4", "label": "rtip_pose = fk()", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L84_C0", "vector": [14, 1, 0.7373, 0.0085, 1, 0.62, 0.3333, 981, 3, 4, 0, 0, 714, 10, 3], "semantic": {"name": "rtip_pose", "arg_names": [], "import_names": [], "rhs_call_name": "fk", "annotation": ""}, "snippet": " rtip_pose = right.fk('torso_lift_link', 'r_wrist_roll_link', 'r_gripper_tool_frame', [.5 for i in range(len(right.joint_names))])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L88_C4", "label": "print()", "type": "expression", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L84_C0", "vector": [8, 1, 0.7458, 0.0085, 1, 0.62, 0.5, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(tfu.matrix_as_tf(rtip_pose))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L90_C4", "label": "left = PR2ArmKinematics()", "type": "assigned_variable", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L84_C0", "vector": [14, 1, 0.7627, 0.0085, 1, 0.62, 0.6667, 605, 3, 2, 0, 0, 108, 10, 1], "semantic": {"name": "left", "arg_names": [], "import_names": [], "rhs_call_name": "PR2ArmKinematics", "annotation": ""}, "snippet": " left = pr2k.PR2ArmKinematics('left', tflistener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L91_C4", "label": "ltip_pose = fk()", "type": "assigned_variable", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L84_C0", "vector": [14, 1, 0.7712, 0.0085, 1, 0.62, 0.8333, 25, 3, 4, 0, 0, 714, 10, 3], "semantic": {"name": "ltip_pose", "arg_names": [], "import_names": [], "rhs_call_name": "fk", "annotation": ""}, "snippet": " ltip_pose = left.fk('torso_lift_link', 'l_wrist_roll_link', 'l_gripper_tool_frame', [.5 for i in range(len(left.joint_names))])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L92_C4", "label": "print()", "type": "expression", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L84_C0", "vector": [8, 1, 0.7797, 0.0085, 1, 0.62, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(tfu.matrix_as_tf(ltip_pose))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:If_L94_C0", "label": "if", "type": "if", "loc": [94, 97], "level": 0, "parent": null, "vector": [4, 0, 0.8093, 0.0339, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n #kin_class()\n t = TestForwardKin()\n t.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L96_C4", "label": "t = TestForwardKin()", "type": "assigned_variable", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:If_L94_C0", "vector": [14, 1, 0.8136, 0.0085, 1, 0.84, 0.0, 15, 3, 0, 0, 0, 730, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "TestForwardKin", "annotation": ""}, "snippet": " t = TestForwardKin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L97_C4", "label": "run()", "type": "expression", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99690:If_L94_C0", "vector": [8, 1, 0.822, 0.0085, 1, 0.84, 1.0, 679, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " t.run()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:If_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:If_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:If_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:For_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:For_L60_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L61_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:If_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:If_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:For_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:For_L63_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L64_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:While_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:While_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:FunctionDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:If_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Assign_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99690:If_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99690:Expr_L97_C4"}]
import roslib; roslib.load_manifest('hai_sandbox') import rospy rospy.init_node('param_saver') import hrl_lib.util as ut joint_groups = {} joint_groups['rarm'] = rospy.get_param('/r_arm_controller/joints') joint_groups['larm'] = rospy.get_param('/l_arm_controller/joints') joint_groups['head_traj'] = rospy.get_param('/head_traj_controller/joints') joint_groups['torso'] = rospy.get_param('/torso_controller/joints') ut.save_pickle(joint_groups, 'link_names.pkl')
ajibawa-2023/Python-Code-Large/train/row_99691
11
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_99691:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0909, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99691:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0909, 0.0909, 0, 0.66, 0.1, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99691:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1818, 0.0909, 0, 0.66, 0.2, 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_99691:Expr_L3_C0", "label": "init_node()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.2727, 0.0909, 0, 0.66, 0.3, 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('param_saver')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99691:Import_L4_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.3636, 0.0909, 0, 0.66, 0.4, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99691:Assign_L6_C0", "label": "joint_groups =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.5455, 0.0909, 0, 0.66, 0.5, 351, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "joint_groups", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "joint_groups = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99691:Assign_L7_C0", "label": " = get_param()", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.6364, 0.0909, 0, 0.66, 0.6, 0, 3, 1, 0, 0, 427, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": "joint_groups['rarm'] = rospy.get_param('/r_arm_controller/joints')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99691:Assign_L8_C0", "label": " = get_param()", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.7273, 0.0909, 0, 0.66, 0.7, 0, 3, 1, 0, 0, 427, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": "joint_groups['larm'] = rospy.get_param('/l_arm_controller/joints')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99691:Assign_L9_C0", "label": " = get_param()", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.8182, 0.0909, 0, 0.66, 0.8, 0, 3, 1, 0, 0, 427, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": "joint_groups['head_traj'] = rospy.get_param('/head_traj_controller/joints')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99691:Assign_L10_C0", "label": " = get_param()", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.9091, 0.0909, 0, 0.66, 0.9, 0, 3, 1, 0, 0, 427, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": "joint_groups['torso'] = rospy.get_param('/torso_controller/joints')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99691:Expr_L11_C0", "label": "save_pickle()", "type": "expression", "loc": [11, 11], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.0909, 0, 0.66, 1.0, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": "ut.save_pickle(joint_groups, 'link_names.pkl')"}]
[]
import roslib; roslib.load_manifest('hai_sandbox') import rospy import actionlib import hrl_lib.tf_utils as tfu import hrl_lib.util as ut import hrl_pr2_lib.devices as hd import hrl_camera.ros_camera as rc import hai_sandbox.recognize_3d as r3d #import hai_sandbox.msg as hmsg import geometry_msgs.msg as gmsg import tf from cv_bridge import CvBridge, CvBridgeError import numpy as np import ml_lib.dataset as ds import cv import datetime import hrl_lib.util as ut import math def str_from_time(ctime): return datetime.datetime.fromtimestamp(ctime).strftime('%Y_%m_%d_%H_%M_%S') class InterestPointPerception(r3d.InterestPointAppBase): def __init__(self, object_name, labeled_data_fname, tf_listener): r3d.InterestPointAppBase.__init__(self, object_name, labeled_data_fname) self.tf_listener = tf_listener if tf_listener == None: self.tf_listener = tf.TransformListener() self.laser_scan = hd.LaserScanner('point_cloud_srv') self.prosilica = rc.Prosilica('prosilica', 'polled') self.prosilica_cal = rc.ROSCameraCalibration('/prosilica/camera_info') self.image_pub = r3d.ImagePublisher(object_name + '_perception', self.prosilica_cal) self.last_added = None self.disp = r3d.RvizDisplayThread(self.prosilica_cal) self.disp.start() def scan(self, point3d): rospy.loginfo('InterestPointPerception: scanning..') point_cloud_bl = self.laser_scan.scan(math.radians(180.), math.radians(-180.), 15) prosilica_image = self.prosilica.get_frame() image_T_laser = tfu.transform('/high_def_optical_frame', '/base_link', self.tf_listener) #Extract features self.feature_extractor = r3d.IntensityCloudData(point_cloud_bl, prosilica_image, image_T_laser, self.prosilica_cal, point3d, self.rec_params) fex = self.feature_extractor self.disp.display_scan(fex.point_cloud3d_orig, fex.points3d_valid_laser, fex.colors_valid, prosilica_image, self.prosilica_cal) rospy.loginfo('InterestPointPerception: extracting features..') #self.instances, self.points2d, self.points3d = self.feature_extractor.extract_vectorized_features() rospy.loginfo('InterestPointPerception: finished extraction.') def is_ready(self): return self.learner != None def add_example(self, point3d_bl, label, pt2d=None): fex = self.feature_extractor feature = fex.feature_vec_at_mat(point3d_bl) if feature == None: return False pt2d = fex.calibration_obj.project(tfu.transform_points(fex.image_T_laser, point3d_bl)) label = np.matrix(label) self.add_to_dataset(feature, label, pt2d, point3d_bl) self.last_added = {'pt': pt2d, 'l': label} return True def select_next_instances(self, n): #selected_idx, selected_dist = self.learner.select_next_instances(self.instances, n) return self.learner.select_next_instances(self.instances, n) def get_likely_success_points(self): #do something to reduce number of points points3d_pos = self.classified_dataset.pt3d[:, np.where(self.classified_dataset.outputs == r3d.POSITIVE)[1].A1] return points3d_pos def draw_and_send(self): self.classify() img = cv.CloneMat(self.feature_extractor.image_cv) #draw classified points. colors = {r3d.POSITIVE: [0,255,0], r3d.NEGATIVE: [0,0,255]} r3d.draw_labeled_points(img, self.classified_dataset) #draw labeled data. r3d.draw_labeled_points(img, self.dataset, colors[r3d.POSITIVE], colors[r3d.NEGATIVE]) #draw latest addition and its label. r3d.draw_points(img, self.last_added['pt'], colors[self.last_added['l']], 4) self.image_pub.publish(img, self.feature_extractor.calibration_obj) if __name__ == '__main__': import sys object_name = sys.argv[1] datafile = sys.argv[2] server = InterestPointActions(object_name, datafile) rospy.spin() #def classify(self): # r3d.InterestPointAppBase.classify(self) # points3d_pos = self.classified_dataset.pt3d[:, np.where(self.classified_dataset.outputs == r3d.POSITIVE)[1].A1] # return points3d_pos #def add_to_dataset(self, feature, label, pt2d, pt3d): # if self.dataset == None: # self.dataset = InterestPointDataset(feature, label, [pt2d], [pt3d], self.feature_extractor) # else: # self.dataset.add(feature, label, pt2d, pt3d) # #pos_ex = np.sum(self.dataset.outputs) # #neg_ex = self.dataset.outputs.shape[1] - pos_ex # #if pos_ex > 2 and neg_ex > 2 and self.blank: # # self.train_learner() # # self.blank = False #def train(self): # return None #def train(self): # if self.dataset != None: # #train # self.ipdetector.train(self.dataset) # #classify # #pdb.set_trace() # results = [] # for i in range(self.instances.shape[1]): # results.append(self.ipdetector.learner.classify(self.instances[:,i])) # #pdb.set_trace() # plist = [self.points2d[:, i] for i in range(self.points2d.shape[1])] # p3list = [self.points3d[:, i] for i in range(self.points3d.shape[1])] # self.classified_dataset = InterestPointDataset(self.instances, np.matrix(results), # plist, p3list, self.feature_extractor) #self.object_name = object_name #self.ipdetector = r3d.InterestPointDetector() #self.dataset = None #self.labeled_data_fname = datafile #if datafile != None: # self.load_labeled_data() #self.feature_extractor = None #def load_labeled_data(self): # self.dataset = ut.load_pickle(self.labeled_data_fname) # print 'loaded from', self.labeled_data_fname # self.dataset.pt2d = [None] * len(self.dataset.pt2d) # self.dataset.pt3d = [None] * len(self.dataset.pt3d) # self.ipdetector = InterestPointDetector(self.dataset) # self.ipdetector.train(self.dataset) #def add_to_dataset(self, feature, label, pt2d, pt3d): # if self.dataset == None: # self.dataset = InterestPointDataset(feature, label, [pt2d], [pt3d], self.feature_extractor) # else: # self.dataset.add(feature, label, pt2d, pt3d) # pos_ex = np.sum(self.dataset.outputs) # neg_ex = self.dataset.outputs.shape[1] - pos_ex # if pos_ex > 2 and neg_ex > 2 and self.blank: # self.train_learner() # self.blank = False # def __init__(self, object_name, datafile): # self.node_name = object_name + '_active_perception_server' # self.object_name = object_name # rospy.init_node(self.node_name) # # #Load learner # self.learner = r3d.SVMPCA_ActiveLearner() # self.rec_params = r3d.Recognize3DParam() # # rospy.loginfo('Loading dataset: ' + datafile) # labeled_light_switch_dataset = ut.load_pickle(datafile) # rospy.loginfo('Training %s.' % object_name) # self.learner.train(labeled_light_switch_dataset, # labeled_light_switch_dataset.sizes['intensity'], # self.rec_params.variance_keep) # # rospy.loginfo('Launching ROS connections') # # #Create message listeners # self.tf_listener = tf.TransformListener() # self.bridge = CvBridge() # # #Create servers # self.find_as = actionlib.SimpleActionServer('find_' + object_name, # hmsg.InterestPointLocate, self.find_cb, False) # self.find_as.start() # #self.find_as.is_preempt_requested() # #self.find_as.set_preempted() # #self.find_as.publish_feedback(self._feedback) # #self.find_as.set_succeeded() # # self.add_example_as = actionlib.SimpleActionServer('add_example_' + object_name, # hmsg.InterestPointAddExample, self.add_example_cb, False) # self.add_example_as.start() # # self.pick_as = actionlib.SimpleActionServer('pick_' + object_name, # hmsg.InterestPointPick, self.pick_cb, False) # self.pick_as.start() # # rospy.loginfo('Ready.') # # #rospy.loginfo('Loading dataset: ' + datafile) # #rospy.loginfo('Training %s.' % object_name) # #rospy.loginfo('Launching ROS connections') # # def _find(self, cloud, image, calib, center, radius): # #preprocess # self.rec_params.radius = goal.radius # image_T_laser = tfu.transform(calib.frame, cloud.header.frame_id, self.tf_listener) # ic_data = r3d.IntensityCloudData(cloud, image, image_T_laser, calib, center, self.rec_params) # # #label # instances = ic_data.extract_vectorized_features() # results = [] # for i in range(instances.shape[1]): # nlabel = self.learner.classify(instances[:, i]) # results.append(nlabel) # # results = np.matrix(results) # # #draw and save results # image_cpy = cv.CloneImage(image) # r3d.draw_labeled_points(ic_data, ds.Dataset(self.instances, results), image_cpy) # cv.SaveImage('%s_%s.png' % (self.object_name, str_from_time(cloud.header.stamp.to_time())), image_cpy) # # #want 3d location of each instance # positive_indices = np.where(results == r3d.POSITIVE)[1] # positive_points_3d = ic_data.sampled_points[:, positive_indices] # # #return a random point for now # rindex = np.random.randint(0, len(positive_indices)) # # return positive_points_3d[:,rindex] # # # def find_cb(self, goal): # calib = rc.ROSCameraCalibration(offline=True) # calib.camera_info(goal.camera_info) # imagecv = self.bridge.imgmsg_to_cv(goal.image, encoding="bgr8") # centermat = np.matrix([goal.center.x, goal.center.y, goal.center.z]).T # round_points = self._find(goal.cloud, imagecv, centermat, goal_radius) # # results = hmsg.InterestPointLocateResult() # results.header.frame_id = goal.cloud.header.frame_id # results.header.stamp = rospy.Time.now() # results.interest_points = [gmsg.Point(*round_point[:,i].T.A1.tolist()) for i in range(round_points.shape[1])] # self.find_as.set_succeeded() # # def add_example_cb(self, goal): # pass # # def pick_cb(self, goal): # pass
ajibawa-2023/Python-Code-Large/train/row_99692
74
283
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0035, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0035, 0.0035, 0, 0.66, 0.05, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0071, 0.0035, 0, 0.66, 0.1, 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_99692:Import_L3_C0", "label": "actionlib import actionlib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0106, 0.0035, 0, 0.66, 0.15, 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_99692:Import_L5_C0", "label": "hrl_lib.tf_utils import tfu", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0177, 0.0035, 0, 0.66, 0.2, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "hrl_lib.tf_utils", "arg_names": [], "import_names": ["tfu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.tf_utils as tfu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Import_L6_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0212, 0.0035, 0, 0.66, 0.25, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Import_L7_C0", "label": "hrl_pr2_lib.devices import hd", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0247, 0.0035, 0, 0.66, 0.3, 854, 0, 1, 0, 0, 854, 0, 0], "semantic": {"name": "hrl_pr2_lib.devices", "arg_names": [], "import_names": ["hd"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_pr2_lib.devices as hd"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Import_L8_C0", "label": "hrl_camera.ros_camera import rc", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0283, 0.0035, 0, 0.66, 0.35, 798, 0, 1, 0, 0, 798, 0, 0], "semantic": {"name": "hrl_camera.ros_camera", "arg_names": [], "import_names": ["rc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_camera.ros_camera as rc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Import_L10_C0", "label": "hai_sandbox.recognize_3d import r3d", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0353, 0.0035, 0, 0.66, 0.4, 520, 0, 1, 0, 0, 520, 0, 0], "semantic": {"name": "hai_sandbox.recognize_3d", "arg_names": [], "import_names": ["r3d"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hai_sandbox.recognize_3d as r3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Import_L12_C0", "label": "geometry_msgs.msg import gmsg", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0424, 0.0035, 0, 0.66, 0.45, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["gmsg"], "rhs_call_name": "", "annotation": ""}, "snippet": "import geometry_msgs.msg as gmsg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Import_L13_C0", "label": "tf import tf", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0459, 0.0035, 0, 0.66, 0.5, 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_99692:ImportFrom_L14_C0", "label": "from cv_bridge import CvBridge, CvBridgeError", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0495, 0.0035, 0, 0.66, 0.55, 851, 0, 2, 0, 0, 851, 0, 0], "semantic": {"name": "cv_bridge", "arg_names": [], "import_names": ["CvBridge", "CvBridgeError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from cv_bridge import CvBridge, CvBridgeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Import_L15_C0", "label": "numpy import np", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.053, 0.0035, 0, 0.66, 0.6, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Import_L16_C0", "label": "ml_lib.dataset import ds", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0565, 0.0035, 0, 0.66, 0.65, 809, 0, 1, 0, 0, 809, 0, 0], "semantic": {"name": "ml_lib.dataset", "arg_names": [], "import_names": ["ds"], "rhs_call_name": "", "annotation": ""}, "snippet": "import ml_lib.dataset as ds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Import_L17_C0", "label": "cv import cv", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0601, 0.0035, 0, 0.66, 0.7, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Import_L18_C0", "label": "datetime import datetime", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0636, 0.0035, 0, 0.66, 0.75, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["datetime"], "rhs_call_name": "", "annotation": ""}, "snippet": "import datetime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Import_L19_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0671, 0.0035, 0, 0.66, 0.8, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Import_L20_C0", "label": "math import math", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0707, 0.0035, 0, 0.66, 0.85, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L22_C0", "label": "str_from_time", "type": "function", "loc": [22, 23], "level": 0, "parent": null, "vector": [2, 0, 0.0795, 0.0071, 0, 0.66, 0.9, 477, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "str_from_time", "arg_names": ["ctime"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def str_from_time(ctime):\n return datetime.datetime.fromtimestamp(ctime).strftime('%Y_%m_%d_%H_%M_%S')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Return_L23_C4", "label": "return", "type": "return", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L22_C0", "vector": [13, 1, 0.0813, 0.0035, 1, 0.04, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return datetime.datetime.fromtimestamp(ctime).strftime('%Y_%m_%d_%H_%M_%S')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:ClassDef_L25_C0", "label": "InterestPointPerception", "type": "class", "loc": [25, 96], "level": 0, "parent": null, "vector": [3, 0, 0.2138, 0.2544, 0, 0.66, 0.95, 943, 0, 7, 0, 0, 245, 0, 31], "semantic": {"name": "InterestPointPerception", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class InterestPointPerception(r3d.InterestPointAppBase): \n\n def __init__(self, object_name, labeled_data_fname, tf_listener):\n r3d.InterestPointAppBase.__init__(self, object_name, labeled_data_fname)\n\n self.tf_listener = tf_listener\n if tf_listener == None:\n self.tf_listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4", "label": "__init__", "type": "function", "loc": [27, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:ClassDef_L25_C0", "vector": [2, 1, 0.1166, 0.0459, 1, 0.49, 0.0, 555, 0, 4, 0, 0, 0, 0, 8], "semantic": {"name": "__init__", "arg_names": ["self", "object_name", "labeled_data_fname", "tf_listener"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, object_name, labeled_data_fname, tf_listener):\n r3d.InterestPointAppBase.__init__(self, object_name, labeled_data_fname)\n\n self.tf_listener = tf_listener\n if tf_listener == None:\n self.tf_listener = tf.TransformListener()\n self.laser_scan = hd.LaserScanner('point_cloud_srv')\n self.prosilica = rc.Prosilica('prosilica', 'polled')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L28_C8", "label": "__init__()", "type": "expression", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4", "vector": [8, 2, 0.0989, 0.0035, 2, 0.24, 0.0, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " r3d.InterestPointAppBase.__init__(self, object_name, labeled_data_fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L30_C8", "label": "self.tf_listener =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4", "vector": [14, 2, 0.106, 0.0035, 2, 0.24, 0.1111, 639, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tf_listener", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tf_listener = tf_listener"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:If_L31_C8", "label": "if", "type": "if", "loc": [31, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4", "vector": [4, 2, 0.1113, 0.0071, 2, 0.24, 0.2222, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tf_listener == None:\n self.tf_listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L32_C12", "label": "self.tf_listener = TransformListener()", "type": "assigned_variable", "loc": [32, 32], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:If_L31_C8", "vector": [14, 3, 0.1131, 0.0035, 3, 0.2, 0.0, 639, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tf_listener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.tf_listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L33_C8", "label": "self.laser_scan = LaserScanner()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4", "vector": [14, 2, 0.1166, 0.0035, 2, 0.24, 0.3333, 337, 3, 1, 0, 0, 232, 10, 1], "semantic": {"name": "self.laser_scan", "arg_names": [], "import_names": [], "rhs_call_name": "LaserScanner", "annotation": ""}, "snippet": " self.laser_scan = hd.LaserScanner('point_cloud_srv')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L34_C8", "label": "self.prosilica = Prosilica()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4", "vector": [14, 2, 0.1201, 0.0035, 2, 0.24, 0.4444, 433, 3, 2, 0, 0, 878, 10, 1], "semantic": {"name": "self.prosilica", "arg_names": [], "import_names": [], "rhs_call_name": "Prosilica", "annotation": ""}, "snippet": " self.prosilica = rc.Prosilica('prosilica', 'polled')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L35_C8", "label": "self.prosilica_cal = ROSCameraCalibration()", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4", "vector": [14, 2, 0.1237, 0.0035, 2, 0.24, 0.5556, 399, 3, 1, 0, 0, 289, 10, 1], "semantic": {"name": "self.prosilica_cal", "arg_names": [], "import_names": [], "rhs_call_name": "ROSCameraCalibration", "annotation": ""}, "snippet": " self.prosilica_cal = rc.ROSCameraCalibration('/prosilica/camera_info')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L36_C8", "label": "self.image_pub = ImagePublisher()", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4", "vector": [14, 2, 0.1272, 0.0035, 2, 0.24, 0.6667, 780, 3, 2, 0, 0, 833, 10, 1], "semantic": {"name": "self.image_pub", "arg_names": [], "import_names": [], "rhs_call_name": "ImagePublisher", "annotation": ""}, "snippet": " self.image_pub = r3d.ImagePublisher(object_name + '_perception', self.prosilica_cal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L37_C8", "label": "self.last_added =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4", "vector": [14, 2, 0.1307, 0.0035, 2, 0.24, 0.7778, 425, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.last_added", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.last_added = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L38_C8", "label": "self.disp = RvizDisplayThread()", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4", "vector": [14, 2, 0.1343, 0.0035, 2, 0.24, 0.8889, 284, 3, 1, 0, 0, 967, 10, 1], "semantic": {"name": "self.disp", "arg_names": [], "import_names": [], "rhs_call_name": "RvizDisplayThread", "annotation": ""}, "snippet": " self.disp = r3d.RvizDisplayThread(self.prosilica_cal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L39_C8", "label": "start()", "type": "expression", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4", "vector": [8, 2, 0.1378, 0.0035, 2, 0.24, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.disp.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L41_C4", "label": "scan", "type": "function", "loc": [41, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:ClassDef_L25_C0", "vector": [2, 1, 0.1749, 0.0636, 1, 0.49, 0.1667, 202, 0, 2, 0, 0, 0, 0, 10], "semantic": {"name": "scan", "arg_names": ["self", "point3d"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def scan(self, point3d):\n rospy.loginfo('InterestPointPerception: scanning..')\n point_cloud_bl = self.laser_scan.scan(math.radians(180.), math.radians(-180.), 15)\n prosilica_image = self.prosilica.get_frame()\n image_T_laser = tfu.transform('/high_def_optical_frame', '/base_link', self.tf_listener)\n\n #Extract features\n self.feature_extractor = r3d.IntensityCloudData(point_cloud_bl, "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L42_C8", "label": "loginfo()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L41_C4", "vector": [8, 2, 0.1484, 0.0035, 2, 0.41, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('InterestPointPerception: scanning..')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L43_C8", "label": "point_cloud_bl = scan()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L41_C4", "vector": [14, 2, 0.1519, 0.0035, 2, 0.41, 0.125, 271, 3, 3, 0, 0, 202, 10, 3], "semantic": {"name": "point_cloud_bl", "arg_names": [], "import_names": [], "rhs_call_name": "scan", "annotation": ""}, "snippet": " point_cloud_bl = self.laser_scan.scan(math.radians(180.), math.radians(-180.), 15)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L44_C8", "label": "prosilica_image = get_frame()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L41_C4", "vector": [14, 2, 0.1555, 0.0035, 2, 0.41, 0.25, 341, 3, 0, 0, 0, 489, 10, 1], "semantic": {"name": "prosilica_image", "arg_names": [], "import_names": [], "rhs_call_name": "get_frame", "annotation": ""}, "snippet": " prosilica_image = self.prosilica.get_frame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L45_C8", "label": "image_T_laser = transform()", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L41_C4", "vector": [14, 2, 0.159, 0.0035, 2, 0.41, 0.375, 867, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "image_T_laser", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " image_T_laser = tfu.transform('/high_def_optical_frame', '/base_link', self.tf_listener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L48_C8", "label": "self.feature_extractor = IntensityCloudData()", "type": "assigned_variable", "loc": [48, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L41_C4", "vector": [14, 2, 0.1731, 0.0106, 2, 0.41, 0.5, 400, 3, 6, 0, 0, 580, 10, 1], "semantic": {"name": "self.feature_extractor", "arg_names": [], "import_names": [], "rhs_call_name": "IntensityCloudData", "annotation": ""}, "snippet": " self.feature_extractor = r3d.IntensityCloudData(point_cloud_bl, \n prosilica_image, image_T_laser, self.prosilica_cal, \n point3d, self.rec_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L52_C8", "label": "fex =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L41_C4", "vector": [14, 2, 0.1837, 0.0035, 2, 0.41, 0.625, 528, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fex", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fex = self.feature_extractor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L53_C8", "label": "display_scan()", "type": "expression", "loc": [53, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L41_C4", "vector": [8, 2, 0.189, 0.0071, 2, 0.41, 0.75, 581, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "display_scan", "arg_names": [], "import_names": [], "rhs_call_name": "display_scan", "annotation": ""}, "snippet": " self.disp.display_scan(fex.point_cloud3d_orig, fex.points3d_valid_laser, fex.colors_valid,\n prosilica_image, self.prosilica_cal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L56_C8", "label": "loginfo()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L41_C4", "vector": [8, 2, 0.1979, 0.0035, 2, 0.41, 0.875, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('InterestPointPerception: extracting features..')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L58_C8", "label": "loginfo()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L41_C4", "vector": [8, 2, 0.2049, 0.0035, 2, 0.41, 1.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('InterestPointPerception: finished extraction.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L60_C4", "label": "is_ready", "type": "function", "loc": [60, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:ClassDef_L25_C0", "vector": [2, 1, 0.2138, 0.0071, 1, 0.49, 0.3333, 446, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_ready", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_ready(self):\n return self.learner != None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Return_L61_C8", "label": "return", "type": "return", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L60_C4", "vector": [13, 2, 0.2155, 0.0035, 2, 0.38, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.learner != None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L63_C4", "label": "add_example", "type": "function", "loc": [63, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:ClassDef_L25_C0", "vector": [2, 1, 0.2385, 0.0353, 1, 0.49, 0.5, 938, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "add_example", "arg_names": ["self", "point3d_bl", "label", "pt2d"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_example(self, point3d_bl, label, pt2d=None):\n fex = self.feature_extractor\n feature = fex.feature_vec_at_mat(point3d_bl)\n if feature == None:\n return False\n pt2d = fex.calibration_obj.project(tfu.transform_points(fex.image_T_laser, point3d_bl))\n label = np.matrix(label)\n self.add_to_dataset(feature, label, pt2d, point3d_bl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L64_C8", "label": "fex =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L63_C4", "vector": [14, 2, 0.2261, 0.0035, 2, 0.49, 0.0, 528, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fex", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fex = self.feature_extractor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L65_C8", "label": "feature = feature_vec_at_mat()", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L63_C4", "vector": [14, 2, 0.2297, 0.0035, 2, 0.49, 0.1429, 484, 3, 1, 0, 0, 670, 10, 1], "semantic": {"name": "feature", "arg_names": [], "import_names": [], "rhs_call_name": "feature_vec_at_mat", "annotation": ""}, "snippet": " feature = fex.feature_vec_at_mat(point3d_bl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:If_L66_C8", "label": "if", "type": "if", "loc": [66, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L63_C4", "vector": [4, 2, 0.235, 0.0071, 2, 0.49, 0.2857, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if feature == None:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Return_L67_C12", "label": "return", "type": "return", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:If_L66_C8", "vector": [13, 3, 0.2367, 0.0035, 3, 0.77, 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_99692:Assign_L68_C8", "label": "pt2d = project()", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L63_C4", "vector": [14, 2, 0.2403, 0.0035, 2, 0.49, 0.4286, 289, 3, 1, 0, 0, 841, 10, 2], "semantic": {"name": "pt2d", "arg_names": [], "import_names": [], "rhs_call_name": "project", "annotation": ""}, "snippet": " pt2d = fex.calibration_obj.project(tfu.transform_points(fex.image_T_laser, point3d_bl))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L69_C8", "label": "label = matrix()", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L63_C4", "vector": [14, 2, 0.2438, 0.0035, 2, 0.49, 0.5714, 811, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " label = np.matrix(label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L70_C8", "label": "add_to_dataset()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L63_C4", "vector": [8, 2, 0.2473, 0.0035, 2, 0.49, 0.7143, 666, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_to_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "add_to_dataset", "annotation": ""}, "snippet": " self.add_to_dataset(feature, label, pt2d, point3d_bl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L71_C8", "label": "self.last_added =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L63_C4", "vector": [14, 2, 0.2509, 0.0035, 2, 0.49, 0.8571, 425, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.last_added", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.last_added = {'pt': pt2d, 'l': label}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Return_L72_C8", "label": "return", "type": "return", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L63_C4", "vector": [13, 2, 0.2544, 0.0035, 2, 0.49, 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_99692:FunctionDef_L74_C4", "label": "select_next_instances", "type": "function", "loc": [74, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:ClassDef_L25_C0", "vector": [2, 1, 0.265, 0.0106, 1, 0.49, 0.6667, 853, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "select_next_instances", "arg_names": ["self", "n"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def select_next_instances(self, n):\n #selected_idx, selected_dist = self.learner.select_next_instances(self.instances, n)\n return self.learner.select_next_instances(self.instances, n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Return_L76_C8", "label": "return", "type": "return", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L74_C4", "vector": [13, 2, 0.2686, 0.0035, 2, 0.09, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.learner.select_next_instances(self.instances, n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L78_C4", "label": "get_likely_success_points", "type": "function", "loc": [78, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:ClassDef_L25_C0", "vector": [2, 1, 0.2809, 0.0141, 1, 0.49, 0.8333, 681, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_likely_success_points", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_likely_success_points(self):\n #do something to reduce number of points\n points3d_pos = self.classified_dataset.pt3d[:, np.where(self.classified_dataset.outputs == r3d.POSITIVE)[1].A1]\n return points3d_pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L80_C8", "label": "points3d_pos =", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L78_C4", "vector": [14, 2, 0.2827, 0.0035, 2, 0.11, 0.0, 182, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "points3d_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " points3d_pos = self.classified_dataset.pt3d[:, np.where(self.classified_dataset.outputs == r3d.POSITIVE)[1].A1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Return_L81_C8", "label": "return", "type": "return", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L78_C4", "vector": [13, 2, 0.2862, 0.0035, 2, 0.11, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return points3d_pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L83_C4", "label": "draw_and_send", "type": "function", "loc": [83, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:ClassDef_L25_C0", "vector": [2, 1, 0.3163, 0.0495, 1, 0.49, 1.0, 763, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "draw_and_send", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def draw_and_send(self):\n self.classify()\n img = cv.CloneMat(self.feature_extractor.image_cv)\n #draw classified points.\n colors = {r3d.POSITIVE: [0,255,0], r3d.NEGATIVE: [0,0,255]}\n r3d.draw_labeled_points(img, self.classified_dataset)\n\n #draw labeled data. "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L84_C8", "label": "classify()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L83_C4", "vector": [8, 2, 0.2968, 0.0035, 2, 0.59, 0.0, 702, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "classify", "arg_names": [], "import_names": [], "rhs_call_name": "classify", "annotation": ""}, "snippet": " self.classify()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L85_C8", "label": "img = CloneMat()", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L83_C4", "vector": [14, 2, 0.3004, 0.0035, 2, 0.59, 0.1667, 200, 3, 1, 0, 0, 201, 10, 1], "semantic": {"name": "img", "arg_names": [], "import_names": [], "rhs_call_name": "CloneMat", "annotation": ""}, "snippet": " img = cv.CloneMat(self.feature_extractor.image_cv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L87_C8", "label": "colors =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L83_C4", "vector": [14, 2, 0.3074, 0.0035, 2, 0.59, 0.3333, 656, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "colors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " colors = {r3d.POSITIVE: [0,255,0], r3d.NEGATIVE: [0,0,255]}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L88_C8", "label": "draw_labeled_points()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L83_C4", "vector": [8, 2, 0.311, 0.0035, 2, 0.59, 0.5, 202, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "draw_labeled_points", "arg_names": [], "import_names": [], "rhs_call_name": "draw_labeled_points", "annotation": ""}, "snippet": " r3d.draw_labeled_points(img, self.classified_dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L91_C8", "label": "draw_labeled_points()", "type": "expression", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L83_C4", "vector": [8, 2, 0.3216, 0.0035, 2, 0.59, 0.6667, 202, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "draw_labeled_points", "arg_names": [], "import_names": [], "rhs_call_name": "draw_labeled_points", "annotation": ""}, "snippet": " r3d.draw_labeled_points(img, self.dataset, colors[r3d.POSITIVE], colors[r3d.NEGATIVE])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L94_C8", "label": "draw_points()", "type": "expression", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L83_C4", "vector": [8, 2, 0.3322, 0.0035, 2, 0.59, 0.8333, 154, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "draw_points", "arg_names": [], "import_names": [], "rhs_call_name": "draw_points", "annotation": ""}, "snippet": " r3d.draw_points(img, self.last_added['pt'], colors[self.last_added['l']], 4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L96_C8", "label": "publish()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L83_C4", "vector": [8, 2, 0.3392, 0.0035, 2, 0.59, 1.0, 102, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.image_pub.publish(img, self.feature_extractor.calibration_obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:If_L99_C0", "label": "if", "type": "if", "loc": [99, 105], "level": 0, "parent": null, "vector": [4, 0, 0.3604, 0.0247, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import sys\n\n object_name = sys.argv[1]\n datafile = sys.argv[2]\n server = InterestPointActions(object_name, datafile)\n rospy.spin() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Import_L100_C4", "label": "sys import sys", "type": "import", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:If_L99_C0", "vector": [1, 1, 0.3534, 0.0035, 1, 0.92, 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_99692:Assign_L102_C4", "label": "object_name =", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:If_L99_C0", "vector": [14, 1, 0.3604, 0.0035, 1, 0.92, 0.25, 663, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "object_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " object_name = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L103_C4", "label": "datafile =", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:If_L99_C0", "vector": [14, 1, 0.364, 0.0035, 1, 0.92, 0.5, 14, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "datafile", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " datafile = sys.argv[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L104_C4", "label": "server = InterestPointActions()", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:If_L99_C0", "vector": [14, 1, 0.3675, 0.0035, 1, 0.92, 0.75, 268, 3, 2, 0, 0, 239, 10, 1], "semantic": {"name": "server", "arg_names": [], "import_names": [], "rhs_call_name": "InterestPointActions", "annotation": ""}, "snippet": " server = InterestPointActions(object_name, datafile)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L105_C4", "label": "spin()", "type": "expression", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99692:If_L99_C0", "vector": [8, 1, 0.371, 0.0035, 1, 0.92, 1.0, 17, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "spin", "arg_names": [], "import_names": [], "rhs_call_name": "spin", "annotation": ""}, "snippet": " rospy.spin() "}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Return_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:If_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:If_L31_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L32_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Return_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:If_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Return_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Return_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Return_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Return_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:If_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Import_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:If_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:If_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:If_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99692:If_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99692:Expr_L105_C4"}]
import numpy as np camera_t = np.matrix([1299102299.98, 1299102300.04, 1299102300.09, 1299102300.11, 1299102300.16, 1299102300.21, 1299102300.26, 1299102300.28, 1299102300.33, 1299102300.38, 1299102300.43, 1299102300.45, 1299102300.5, 1299102300.55, 1299102300.6, 1299102300.63, 1299102300.73, 1299102300.79, 1299102300.81, 1299102300.86, 1299102300.92, 1299102300.98, 1299102301.0, 1299102301.06, 1299102301.12, 1299102301.18, 1299102301.2, 1299102301.26, 1299102301.34, 1299102301.42, 1299102301.43, 1299102301.51, 1299102301.58, 1299102301.64, 1299102301.67, 1299102301.73, 1299102301.79, 1299102301.83, 1299102301.86, 1299102301.93, 1299102301.98, 1299102302.02, 1299102302.05, 1299102302.09, 1299102302.13, 1299102302.17, 1299102302.21, 1299102302.27, 1299102302.31, 1299102302.34, 1299102302.38, 1299102302.43, 1299102302.46, 1299102302.48, 1299102302.51, 1299102302.57, 1299102302.6]) fpfh_t = 1299102299.87
ajibawa-2023/Python-Code-Large/train/row_99693
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_99693:Import_L1_C0", "label": "numpy import np", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99693:Assign_L2_C0", "label": "camera_t = matrix()", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.6667, 0.3333, 0, 0.66, 0.5, 509, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "camera_t", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": "camera_t = np.matrix([1299102299.98, 1299102300.04, 1299102300.09, 1299102300.11, 1299102300.16, 1299102300.21, 1299102300.26, 1299102300.28, 1299102300.33, 1299102300.38, 1299102300.43, 1299102300.45, 1299102300.5, 1299102300.55, 1299102300.6, 1299102300.63, 1299102300.73, 1299102300.79, 1299102300.81, 1299102300.86, 1299102300.92, 1299102300.98, 1299102301.0, 1299102301.06, 1299102301.12, 1299102301.18, 1299102301.2, 1299102301.26, 1299102301.34, 1299102301.42, 1299102301.43, 1299102301.51, 1299102301.58, 1299102301.64, 1299102301.67, 1299102301.73, 1299102301.79, 1299102301.83, 1299102301.86, 1299102301.93, 1299102301.98, 1299102302.02, 1299102302.05, 1299102302.09, 1299102302.13, 1299102302.17, 1299102302.21, 1299102302.27, 1299102302.31, 1299102302.34, 1299102302.38, 1299102302.43, 1299102302.46, 1299102302.48, 1299102302.51, 1299102302.57, 1299102302.6])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99693:Assign_L3_C0", "label": "fpfh_t =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.3333, 0, 0.66, 1.0, 243, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "fpfh_t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "fpfh_t = 1299102299.87"}]
[]
import roslib; roslib.load_manifest('hai_sandbox') import rospy import hrl_camera.ros_camera as rc import cv import hai_sandbox.features as fea import sys import threading as thr import scipy.spatial as sp import numpy as np import pdb class ShowImage(thr.Thread): def __init__(self, name): thr.Thread.__init__(self) self.image = None self.name = name def run(self): while not rospy.is_shutdown(): if self.image != None: cv.ShowImage(self.name, self.image) cv.WaitKey(33) def concat_images(a, b): img_height = max(a.height, b.height) c = cv.CreateImage((a.width+b.width, img_height), a.depth, a.channels) a_area = cv.GetSubRect(c, (0,0, a.width, a.height)) b_area = cv.GetSubRect(c, (a.width, 0, b.width, b.height)) cv.Add(a, a_area, a_area) cv.Add(b, b_area, b_area) return c #class SURFMatcher: # def __init__(self): # self.model_images = {} # self.model_fea = {} # # def add_file(self, model_name, label): # model_img = cv.LoadImage(model_name) # self.add_model(model_img, label) # # def add_model(self, model_img, label): # mgray = fea.grayscale(model_img) # m_loc, m_desc = fea.surf(mgray) # self.model_images[label] = model_img # self.model_fea[label] = {'loc': m_loc, 'desc': m_desc} # # def build_db(self): # fea_l = [] # labels_l = [] # locs_l = [] # for k in self.model_fea: # fea_l.append(np.array(self.model_fea[k]['desc'])) # locs_l.append(np.array(self.model_fea[k]['loc'])) # labels_l.append(np.array([k for i in range(len(self.model_fea[k]['desc']))])) # # self.labels = np.row_stack(labels_l) # self.locs = np.row_stack(locs_l) # self.tree = sp.KDTree(np.row_stack(fea_l)) # # def match(self, desc, thres=.6): # dists, idxs = self.tree.query(np.array(desc), 2) # ratio = dists[0] / dists[1] # if ratio < threshold: # desc = self.tree.data[idxs[0]] # loc = self.locs[idxs[0]] # return desc, loc # else: # return None def match_images(model_img, cand_img, threshold=.8): #pdb.set_trace() mgray = fea.grayscale(model_img) cgray = fea.grayscale(cand_img) m_loc, m_desc = fea.surf(mgray) dirs = [direction for loc, lap, size, direction, hess in m_loc] print 'max min dirs', np.min(dirs), np.max(dirs) c_loc, c_desc = fea.surf(cgray) features_db = sp.KDTree(np.array(m_desc)) matched = [] for i, desc in enumerate(c_desc): dists, idxs = features_db.query(np.array(desc), 2) ratio = dists[0] / dists[1] #print "%d %.4f" % (i, ratio), if ratio < threshold: matched.append((i, idxs[0])) #print 'matched!', idxs[0] #else: # print 'X|' c_loc_moved = [] for loc, lap, size, d, hess in c_loc: x, y = loc nloc = (x + model_img.width, y) c_loc_moved.append((nloc, lap, size, d, hess)) c_loc_matched, m_loc_matched = zip(*[[c_loc_moved[i], m_loc[j]] for i, j in matched]) joint = concat_images(model_img, cand_img) joint_viz = joint #joint_viz = fea.draw_surf(joint, c_loc_moved, (255,0,0)) #joint_viz = fea.draw_surf(joint_viz, c_loc_matched, (0,255,0)) #joint_viz = fea.draw_surf(joint_viz, m_loc, (255,0,0)) #joint_viz = fea.draw_surf(joint_viz, m_loc_matched, (0,255,0)) for cloc, mloc in zip(c_loc_matched, m_loc_matched): cloc2d, _, _, _, _ = cloc mloc2d, _, _, _, _ = mloc cv.Line(joint_viz, cloc2d, mloc2d, (0,255,0), 1, cv.CV_AA) print '%d matches found' % len(matched) return joint_viz def test_thresholds(): model_name = sys.argv[1] candidate = sys.argv[2] model_img = cv.LoadImage(model_name) cand_img = cv.LoadImage(candidate) for i in range(5): thres = .8 - (i * .1) print 'thres %.2f' % thres joint_viz = match_images(model_img, cand_img, thres) win_name = 'surf%.2f' % thres cv.NamedWindow(win_name, 0) cv.ShowImage(win_name, joint_viz) while not rospy.is_shutdown(): cv.WaitKey(10) ############### ############## if __name__ == '__main__': mode = 'image' #if mode = 'image': # find pose of model # find normal of model # record angles of features. if mode=='image': test_thresholds() if mode=='live': model_name = sys.argv[1] model_img = cv.LoadImage(model_name) model_gray = fea.grayscale(model_img) msurf_loc, msurf_desc = fea.surf(model_gray) prosilica = rc.Prosilica('prosilica', 'streaming') cv.NamedWindow('surf', 1) si = ShowImage('surf') si.start() #Each feature is a row in db features_db = sp.KDTree(np.array(msurf_desc)) #pdb.set_trace() while not rospy.is_shutdown(): print '..' image = prosilica.get_frame() print 'saving image' cv.SaveImage('frame.png', image) print '>' img_gray = fea.grayscale(image) locs, descs = fea.surf(img_gray) match_idxs = [] for i, desc in enumerate(descs): dists, idxs = features_db.query(np.array(desc), 2) ratio = dists[0] / dists[1] if ratio < .49: match_idxs.append(i) img_viz = fea.draw_surf(image, locs, (255,0,0)) img_viz = fea.draw_surf(img_viz, [locs[i] for i in match_idxs], (0,0,255)) si.image = img_viz print '%d matches found' % len(match_idxs) #print len(desc), desc.__class__, len(descs[0]), descs[0].__class__ #si.image = image
ajibawa-2023/Python-Code-Large/train/row_99694
103
199
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.005, 0.005, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.005, 0.005, 0, 0.66, 0.0667, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0101, 0.005, 0, 0.66, 0.1333, 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_99694:Import_L3_C0", "label": "hrl_camera.ros_camera import rc", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0151, 0.005, 0, 0.66, 0.2, 798, 0, 1, 0, 0, 798, 0, 0], "semantic": {"name": "hrl_camera.ros_camera", "arg_names": [], "import_names": ["rc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_camera.ros_camera as rc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Import_L4_C0", "label": "cv import cv", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0201, 0.005, 0, 0.66, 0.2667, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Import_L5_C0", "label": "hai_sandbox.features import fea", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0251, 0.005, 0, 0.66, 0.3333, 673, 0, 1, 0, 0, 673, 0, 0], "semantic": {"name": "hai_sandbox.features", "arg_names": [], "import_names": ["fea"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hai_sandbox.features as fea"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Import_L6_C0", "label": "sys import sys", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0302, 0.005, 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_99694:Import_L7_C0", "label": "threading import thr", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0352, 0.005, 0, 0.66, 0.4667, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["thr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import threading as thr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Import_L8_C0", "label": "scipy.spatial import sp", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0402, 0.005, 0, 0.66, 0.5333, 384, 0, 1, 0, 0, 384, 0, 0], "semantic": {"name": "scipy.spatial", "arg_names": [], "import_names": ["sp"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.spatial as sp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Import_L9_C0", "label": "numpy import np", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0452, 0.005, 0, 0.66, 0.6, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Import_L10_C0", "label": "pdb import pdb", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0503, 0.005, 0, 0.66, 0.6667, 91, 0, 1, 0, 0, 91, 0, 0], "semantic": {"name": "pdb", "arg_names": [], "import_names": ["pdb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pdb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:ClassDef_L12_C0", "label": "ShowImage", "type": "class", "loc": [12, 22], "level": 0, "parent": null, "vector": [3, 0, 0.0854, 0.0553, 0, 0.66, 0.7333, 896, 0, 2, 0, 0, 804, 0, 4], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ShowImage(thr.Thread):\n def __init__(self, name):\n thr.Thread.__init__(self)\n self.image = None\n self.name = name\n\n def run(self):\n while not rospy.is_shutdown():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L13_C4", "label": "__init__", "type": "function", "loc": [13, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:ClassDef_L12_C0", "vector": [2, 1, 0.0729, 0.0201, 1, 0.21, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name):\n thr.Thread.__init__(self)\n self.image = None\n self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L14_C8", "label": "__init__()", "type": "expression", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L13_C4", "vector": [8, 2, 0.0704, 0.005, 2, 0.12, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " thr.Thread.__init__(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L15_C8", "label": "self.image =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L13_C4", "vector": [14, 2, 0.0754, 0.005, 2, 0.12, 0.5, 219, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.image", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.image = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L16_C8", "label": "self.name =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L13_C4", "vector": [14, 2, 0.0804, 0.005, 2, 0.12, 1.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_99694:FunctionDef_L18_C4", "label": "run", "type": "function", "loc": [18, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:ClassDef_L12_C0", "vector": [2, 1, 0.1005, 0.0251, 1, 0.21, 1.0, 679, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run(self):\n while not rospy.is_shutdown():\n if self.image != None:\n cv.ShowImage(self.name, self.image)\n cv.WaitKey(33)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L19_C8", "label": "while", "type": "while", "loc": [19, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L18_C4", "vector": [5, 2, 0.103, 0.0201, 2, 0.81, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n if self.image != None:\n cv.ShowImage(self.name, self.image)\n cv.WaitKey(33)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L20_C12", "label": "if", "type": "if", "loc": [20, 22], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L19_C8", "vector": [4, 3, 0.1055, 0.0151, 3, 0.41, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.image != None:\n cv.ShowImage(self.name, self.image)\n cv.WaitKey(33)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L21_C16", "label": "ShowImage()", "type": "expression", "loc": [21, 21], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L20_C12", "vector": [8, 4, 0.1055, 0.005, 4, 0.52, 0.0, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage(self.name, self.image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L22_C16", "label": "WaitKey()", "type": "expression", "loc": [22, 22], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L20_C12", "vector": [8, 4, 0.1106, 0.005, 4, 0.52, 1.0, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "WaitKey", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " cv.WaitKey(33)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L24_C0", "label": "concat_images", "type": "function", "loc": [24, 31], "level": 0, "parent": null, "vector": [2, 0, 0.1382, 0.0402, 0, 0.66, 0.8, 854, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "concat_images", "arg_names": ["a", "b"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def concat_images(a, b):\n img_height = max(a.height, b.height)\n c = cv.CreateImage((a.width+b.width, img_height), a.depth, a.channels)\n a_area = cv.GetSubRect(c, (0,0, a.width, a.height))\n b_area = cv.GetSubRect(c, (a.width, 0, b.width, b.height))\n cv.Add(a, a_area, a_area)\n cv.Add(b, b_area, b_area)\n return c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L25_C4", "label": "img_height = max()", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L24_C0", "vector": [14, 1, 0.1256, 0.005, 1, 0.31, 0.0, 53, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "img_height", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " img_height = max(a.height, b.height)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L26_C4", "label": "c = CreateImage()", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L24_C0", "vector": [14, 1, 0.1307, 0.005, 1, 0.31, 0.1667, 411, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " c = cv.CreateImage((a.width+b.width, img_height), a.depth, a.channels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L27_C4", "label": "a_area = GetSubRect()", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L24_C0", "vector": [14, 1, 0.1357, 0.005, 1, 0.31, 0.3333, 720, 3, 2, 0, 0, 469, 10, 1], "semantic": {"name": "a_area", "arg_names": [], "import_names": [], "rhs_call_name": "GetSubRect", "annotation": ""}, "snippet": " a_area = cv.GetSubRect(c, (0,0, a.width, a.height))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L28_C4", "label": "b_area = GetSubRect()", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L24_C0", "vector": [14, 1, 0.1407, 0.005, 1, 0.31, 0.5, 142, 3, 2, 0, 0, 469, 10, 1], "semantic": {"name": "b_area", "arg_names": [], "import_names": [], "rhs_call_name": "GetSubRect", "annotation": ""}, "snippet": " b_area = cv.GetSubRect(c, (a.width, 0, b.width, b.height))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L29_C4", "label": "Add()", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L24_C0", "vector": [8, 1, 0.1457, 0.005, 1, 0.31, 0.6667, 241, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Add", "arg_names": [], "import_names": [], "rhs_call_name": "Add", "annotation": ""}, "snippet": " cv.Add(a, a_area, a_area)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L30_C4", "label": "Add()", "type": "expression", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L24_C0", "vector": [8, 1, 0.1508, 0.005, 1, 0.31, 0.8333, 241, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Add", "arg_names": [], "import_names": [], "rhs_call_name": "Add", "annotation": ""}, "snippet": " cv.Add(b, b_area, b_area)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Return_L31_C4", "label": "return", "type": "return", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L24_C0", "vector": [13, 1, 0.1558, 0.005, 1, 0.31, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "label": "match_images", "type": "function", "loc": [73, 116], "level": 0, "parent": null, "vector": [2, 0, 0.4749, 0.2211, 0, 0.66, 0.8667, 679, 0, 3, 1, 0, 0, 0, 20], "semantic": {"name": "match_images", "arg_names": ["model_img", "cand_img", "threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def match_images(model_img, cand_img, threshold=.8):\n #pdb.set_trace()\n mgray = fea.grayscale(model_img)\n cgray = fea.grayscale(cand_img)\n \n m_loc, m_desc = fea.surf(mgray)\n dirs = [direction for loc, lap, size, direction, hess in m_loc]\n print('max min dirs', np.min(dirs), np.max(dirs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L75_C4", "label": "mgray = grayscale()", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "vector": [14, 1, 0.3769, 0.005, 1, 0.02, 0.0, 405, 3, 1, 0, 0, 530, 10, 1], "semantic": {"name": "mgray", "arg_names": [], "import_names": [], "rhs_call_name": "grayscale", "annotation": ""}, "snippet": " mgray = fea.grayscale(model_img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L76_C4", "label": "cgray = grayscale()", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "vector": [14, 1, 0.3819, 0.005, 1, 0.02, 0.0625, 77, 3, 1, 0, 0, 530, 10, 1], "semantic": {"name": "cgray", "arg_names": [], "import_names": [], "rhs_call_name": "grayscale", "annotation": ""}, "snippet": " cgray = fea.grayscale(cand_img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L78_C4", "label": "m_loc, m_desc = surf()", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "vector": [14, 1, 0.392, 0.005, 1, 0.02, 0.125, 265, 3, 1, 0, 0, 181, 10, 1], "semantic": {"name": "m_loc, m_desc", "arg_names": [], "import_names": [], "rhs_call_name": "surf", "annotation": ""}, "snippet": " m_loc, m_desc = fea.surf(mgray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L79_C4", "label": "dirs =", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "vector": [14, 1, 0.397, 0.005, 1, 0.02, 0.1875, 109, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dirs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dirs = [direction for loc, lap, size, direction, hess in m_loc]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L80_C4", "label": "print()", "type": "expression", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "vector": [8, 1, 0.402, 0.005, 1, 0.02, 0.25, 535, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('max min dirs', np.min(dirs), np.max(dirs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L82_C4", "label": "c_loc, c_desc = surf()", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "vector": [14, 1, 0.4121, 0.005, 1, 0.02, 0.3125, 752, 3, 1, 0, 0, 181, 10, 1], "semantic": {"name": "c_loc, c_desc", "arg_names": [], "import_names": [], "rhs_call_name": "surf", "annotation": ""}, "snippet": " c_loc, c_desc = fea.surf(cgray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L84_C4", "label": "features_db = KDTree()", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "vector": [14, 1, 0.4221, 0.005, 1, 0.02, 0.375, 214, 3, 1, 0, 0, 940, 10, 2], "semantic": {"name": "features_db", "arg_names": [], "import_names": [], "rhs_call_name": "KDTree", "annotation": ""}, "snippet": " features_db = sp.KDTree(np.array(m_desc))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L85_C4", "label": "matched =", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "vector": [14, 1, 0.4271, 0.005, 1, 0.02, 0.4375, 962, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "matched", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " matched = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L86_C4", "label": "for i, desc", "type": "for", "loc": [86, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "vector": [6, 1, 0.4447, 0.0302, 1, 0.02, 0.5, 659, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i, desc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, desc in enumerate(c_desc):\n dists, idxs = features_db.query(np.array(desc), 2)\n ratio = dists[0] / dists[1]\n #print \"%d %.4f\" % (i, ratio),\n if ratio < threshold:\n matched.append((i, idxs[0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L87_C8", "label": "dists, idxs = query()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L86_C4", "vector": [14, 2, 0.4372, 0.005, 2, 0.05, 0.0, 956, 3, 2, 0, 0, 546, 10, 2], "semantic": {"name": "dists, idxs", "arg_names": [], "import_names": [], "rhs_call_name": "query", "annotation": ""}, "snippet": " dists, idxs = features_db.query(np.array(desc), 2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L88_C8", "label": "ratio =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L86_C4", "vector": [14, 2, 0.4422, 0.005, 2, 0.05, 0.5, 188, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ratio", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ratio = dists[0] / dists[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L90_C8", "label": "if", "type": "if", "loc": [90, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L86_C4", "vector": [4, 2, 0.4548, 0.0101, 2, 0.05, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ratio < threshold:\n matched.append((i, idxs[0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L91_C12", "label": "append()", "type": "expression", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L90_C8", "vector": [8, 3, 0.4573, 0.005, 3, 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": " matched.append((i, idxs[0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L96_C4", "label": "c_loc_moved =", "type": "assigned_variable", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "vector": [14, 1, 0.4824, 0.005, 1, 0.02, 0.5625, 646, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "c_loc_moved", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c_loc_moved = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L97_C4", "label": "for loc, lap, size, d, hess", "type": "for", "loc": [97, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "vector": [6, 1, 0.495, 0.0201, 1, 0.02, 0.625, 813, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "loc, lap, size, d, hess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for loc, lap, size, d, hess in c_loc:\n x, y = loc\n nloc = (x + model_img.width, y)\n c_loc_moved.append((nloc, lap, size, d, hess))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L98_C8", "label": "x, y =", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L97_C4", "vector": [14, 2, 0.4925, 0.005, 2, 0.58, 0.0, 855, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x, y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x, y = loc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L99_C8", "label": "nloc =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L97_C4", "vector": [14, 2, 0.4975, 0.005, 2, 0.58, 0.5, 190, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "nloc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nloc = (x + model_img.width, y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L100_C8", "label": "append()", "type": "expression", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L97_C4", "vector": [8, 2, 0.5025, 0.005, 2, 0.58, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " c_loc_moved.append((nloc, lap, size, d, hess))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L102_C4", "label": "c_loc_matched, m_loc_matched = zip()", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "vector": [14, 1, 0.5126, 0.005, 1, 0.02, 0.6875, 208, 3, 1, 0, 0, 814, 10, 1], "semantic": {"name": "c_loc_matched, m_loc_matched", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " c_loc_matched, m_loc_matched = zip(*[[c_loc_moved[i], m_loc[j]] for i, j in matched])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L103_C4", "label": "joint = concat_images()", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "vector": [14, 1, 0.5176, 0.005, 1, 0.02, 0.75, 668, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "joint", "arg_names": [], "import_names": [], "rhs_call_name": "concat_images", "annotation": ""}, "snippet": " joint = concat_images(model_img, cand_img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L105_C4", "label": "joint_viz =", "type": "assigned_variable", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "vector": [14, 1, 0.5276, 0.005, 1, 0.02, 0.8125, 272, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "joint_viz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joint_viz = joint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L110_C4", "label": "for cloc, mloc", "type": "for", "loc": [110, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "vector": [6, 1, 0.5603, 0.0201, 1, 0.02, 0.875, 397, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "cloc, mloc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for cloc, mloc in zip(c_loc_matched, m_loc_matched):\n cloc2d, _, _, _, _ = cloc\n mloc2d, _, _, _, _ = mloc\n cv.Line(joint_viz, cloc2d, mloc2d, (0,255,0), 1, cv.CV_AA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L111_C8", "label": "cloc2d, _, _, _, _ =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L110_C4", "vector": [14, 2, 0.5578, 0.005, 2, 0.27, 0.0, 204, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cloc2d, _, _, _, _", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cloc2d, _, _, _, _ = cloc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L112_C8", "label": "mloc2d, _, _, _, _ =", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L110_C4", "vector": [14, 2, 0.5628, 0.005, 2, 0.27, 0.5, 720, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mloc2d, _, _, _, _", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mloc2d, _, _, _, _ = mloc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L113_C8", "label": "Line()", "type": "expression", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L110_C4", "vector": [8, 2, 0.5678, 0.005, 2, 0.27, 1.0, 650, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "Line", "arg_names": [], "import_names": [], "rhs_call_name": "Line", "annotation": ""}, "snippet": " cv.Line(joint_viz, cloc2d, mloc2d, (0,255,0), 1, cv.CV_AA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L114_C4", "label": "print()", "type": "expression", "loc": [114, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "vector": [8, 1, 0.5729, 0.005, 1, 0.02, 0.9375, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('%d matches found' % len(matched))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Return_L116_C4", "label": "return", "type": "return", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "vector": [13, 1, 0.5829, 0.005, 1, 0.02, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return joint_viz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L118_C0", "label": "test_thresholds", "type": "function", "loc": [118, 134], "level": 0, "parent": null, "vector": [2, 0, 0.6332, 0.0854, 0, 0.66, 0.9333, 499, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "test_thresholds", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_thresholds():\n model_name = sys.argv[1]\n candidate = sys.argv[2]\n \n model_img = cv.LoadImage(model_name)\n cand_img = cv.LoadImage(candidate)\n \n for i in range(5):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L119_C4", "label": "model_name =", "type": "assigned_variable", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L118_C0", "vector": [14, 1, 0.598, 0.005, 1, 0.24, 0.0, 131, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "model_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " model_name = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L120_C4", "label": "candidate =", "type": "assigned_variable", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L118_C0", "vector": [14, 1, 0.603, 0.005, 1, 0.24, 0.2, 416, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "candidate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " candidate = sys.argv[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L122_C4", "label": "model_img = LoadImage()", "type": "assigned_variable", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L118_C0", "vector": [14, 1, 0.6131, 0.005, 1, 0.24, 0.4, 618, 3, 1, 0, 0, 512, 10, 1], "semantic": {"name": "model_img", "arg_names": [], "import_names": [], "rhs_call_name": "LoadImage", "annotation": ""}, "snippet": " model_img = cv.LoadImage(model_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L123_C4", "label": "cand_img = LoadImage()", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L118_C0", "vector": [14, 1, 0.6181, 0.005, 1, 0.24, 0.6, 555, 3, 1, 0, 0, 512, 10, 1], "semantic": {"name": "cand_img", "arg_names": [], "import_names": [], "rhs_call_name": "LoadImage", "annotation": ""}, "snippet": " cand_img = cv.LoadImage(candidate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L125_C4", "label": "for i", "type": "for", "loc": [125, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L118_C0", "vector": [6, 1, 0.6432, 0.0352, 1, 0.24, 0.8, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(5):\n thres = .8 - (i * .1)\n print('thres %.2f' % thres)\n joint_viz = match_images(model_img, cand_img, thres)\n win_name = 'surf%.2f' % thres\n cv.NamedWindow(win_name, 0)\n cv.ShowImage(win_name, joint_viz)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L126_C8", "label": "thres =", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L125_C4", "vector": [14, 2, 0.6332, 0.005, 2, 0.82, 0.0, 289, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "thres", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " thres = .8 - (i * .1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L127_C8", "label": "print()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L125_C4", "vector": [8, 2, 0.6382, 0.005, 2, 0.82, 0.2, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('thres %.2f' % thres)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L128_C8", "label": "joint_viz = match_images()", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L125_C4", "vector": [14, 2, 0.6432, 0.005, 2, 0.82, 0.4, 272, 3, 3, 0, 0, 679, 10, 1], "semantic": {"name": "joint_viz", "arg_names": [], "import_names": [], "rhs_call_name": "match_images", "annotation": ""}, "snippet": " joint_viz = match_images(model_img, cand_img, thres)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L129_C8", "label": "win_name =", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L125_C4", "vector": [14, 2, 0.6482, 0.005, 2, 0.82, 0.6, 435, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "win_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " win_name = 'surf%.2f' % thres"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L130_C8", "label": "NamedWindow()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L125_C4", "vector": [8, 2, 0.6533, 0.005, 2, 0.82, 0.8, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow(win_name, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L131_C8", "label": "ShowImage()", "type": "expression", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L125_C4", "vector": [8, 2, 0.6583, 0.005, 2, 0.82, 1.0, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage(win_name, joint_viz)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L133_C4", "label": "while", "type": "while", "loc": [133, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L118_C0", "vector": [5, 1, 0.6709, 0.0101, 1, 0.24, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n cv.WaitKey(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L134_C8", "label": "WaitKey()", "type": "expression", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L133_C4", "vector": [8, 2, 0.6734, 0.005, 2, 0.88, 0.0, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "WaitKey", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " cv.WaitKey(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L139_C0", "label": "if", "type": "if", "loc": [139, 180], "level": 0, "parent": null, "vector": [4, 0, 0.8015, 0.2111, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 26], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n mode = 'image'\n #if mode = 'image':\n # find pose of model\n # find normal of model\n # record angles of features.\n\n if mode=='image':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L140_C4", "label": "mode =", "type": "assigned_variable", "loc": [140, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L139_C0", "vector": [14, 1, 0.7035, 0.005, 1, 0.38, 0.0, 991, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "mode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mode = 'image'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L146_C4", "label": "if", "type": "if", "loc": [146, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L139_C0", "vector": [4, 1, 0.7362, 0.0101, 1, 0.38, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mode=='image':\n test_thresholds()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L147_C8", "label": "test_thresholds()", "type": "expression", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L146_C4", "vector": [8, 2, 0.7387, 0.005, 2, 0.17, 0.0, 499, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "test_thresholds", "arg_names": [], "import_names": [], "rhs_call_name": "test_thresholds", "annotation": ""}, "snippet": " test_thresholds()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4", "label": "if", "type": "if", "loc": [149, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L139_C0", "vector": [4, 1, 0.8266, 0.1608, 1, 0.38, 1.0, 0, 0, 0, 0, 0, 0, 0, 25], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mode=='live':\n model_name = sys.argv[1]\n model_img = cv.LoadImage(model_name)\n model_gray = fea.grayscale(model_img)\n msurf_loc, msurf_desc = fea.surf(model_gray)\n prosilica = rc.Prosilica('prosilica', 'streaming')\n cv.NamedWindow('surf', 1)\n si = ShowImage('surf')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L150_C8", "label": "model_name =", "type": "assigned_variable", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4", "vector": [14, 2, 0.7538, 0.005, 2, 0.63, 0.0, 131, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "model_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " model_name = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L151_C8", "label": "model_img = LoadImage()", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4", "vector": [14, 2, 0.7588, 0.005, 2, 0.63, 0.1111, 618, 3, 1, 0, 0, 512, 10, 1], "semantic": {"name": "model_img", "arg_names": [], "import_names": [], "rhs_call_name": "LoadImage", "annotation": ""}, "snippet": " model_img = cv.LoadImage(model_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L152_C8", "label": "model_gray = grayscale()", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4", "vector": [14, 2, 0.7638, 0.005, 2, 0.63, 0.2222, 739, 3, 1, 0, 0, 530, 10, 1], "semantic": {"name": "model_gray", "arg_names": [], "import_names": [], "rhs_call_name": "grayscale", "annotation": ""}, "snippet": " model_gray = fea.grayscale(model_img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L153_C8", "label": "msurf_loc, msurf_desc = surf()", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4", "vector": [14, 2, 0.7688, 0.005, 2, 0.63, 0.3333, 47, 3, 1, 0, 0, 181, 10, 1], "semantic": {"name": "msurf_loc, msurf_desc", "arg_names": [], "import_names": [], "rhs_call_name": "surf", "annotation": ""}, "snippet": " msurf_loc, msurf_desc = fea.surf(model_gray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L154_C8", "label": "prosilica = Prosilica()", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4", "vector": [14, 2, 0.7739, 0.005, 2, 0.63, 0.4444, 501, 3, 2, 0, 0, 878, 10, 1], "semantic": {"name": "prosilica", "arg_names": [], "import_names": [], "rhs_call_name": "Prosilica", "annotation": ""}, "snippet": " prosilica = rc.Prosilica('prosilica', 'streaming')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L155_C8", "label": "NamedWindow()", "type": "expression", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4", "vector": [8, 2, 0.7789, 0.005, 2, 0.63, 0.5556, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow('surf', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L156_C8", "label": "si = ShowImage()", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4", "vector": [14, 2, 0.7839, 0.005, 2, 0.63, 0.6667, 476, 3, 1, 0, 0, 896, 10, 1], "semantic": {"name": "si", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " si = ShowImage('surf')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L157_C8", "label": "start()", "type": "expression", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4", "vector": [8, 2, 0.7889, 0.005, 2, 0.63, 0.7778, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " si.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L160_C8", "label": "features_db = KDTree()", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4", "vector": [14, 2, 0.804, 0.005, 2, 0.63, 0.8889, 214, 3, 1, 0, 0, 940, 10, 2], "semantic": {"name": "features_db", "arg_names": [], "import_names": [], "rhs_call_name": "KDTree", "annotation": ""}, "snippet": " features_db = sp.KDTree(np.array(msurf_desc))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "label": "while", "type": "while", "loc": [163, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4", "vector": [5, 2, 0.8618, 0.0905, 2, 0.63, 1.0, 0, 0, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n print('..')\n image = prosilica.get_frame()\n print('saving image')\n cv.SaveImage('frame.png', image)\n print('>')\n img_gray = fea.grayscale(image)\n locs, descs = fea.surf(img_gray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L164_C12", "label": "print()", "type": "expression", "loc": [164, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "vector": [8, 3, 0.8241, 0.005, 3, 0.61, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('..')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L165_C12", "label": "image = get_frame()", "type": "assigned_variable", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "vector": [14, 3, 0.8291, 0.005, 3, 0.61, 0.0833, 505, 3, 0, 0, 0, 489, 10, 1], "semantic": {"name": "image", "arg_names": [], "import_names": [], "rhs_call_name": "get_frame", "annotation": ""}, "snippet": " image = prosilica.get_frame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L166_C12", "label": "print()", "type": "expression", "loc": [166, 166], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "vector": [8, 3, 0.8342, 0.005, 3, 0.61, 0.1667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('saving image')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L167_C12", "label": "SaveImage()", "type": "expression", "loc": [167, 167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "vector": [8, 3, 0.8392, 0.005, 3, 0.61, 0.25, 91, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "SaveImage", "arg_names": [], "import_names": [], "rhs_call_name": "SaveImage", "annotation": ""}, "snippet": " cv.SaveImage('frame.png', image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L168_C12", "label": "print()", "type": "expression", "loc": [168, 168], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "vector": [8, 3, 0.8442, 0.005, 3, 0.61, 0.3333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('>')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L169_C12", "label": "img_gray = grayscale()", "type": "assigned_variable", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "vector": [14, 3, 0.8492, 0.005, 3, 0.61, 0.4167, 988, 3, 1, 0, 0, 530, 10, 1], "semantic": {"name": "img_gray", "arg_names": [], "import_names": [], "rhs_call_name": "grayscale", "annotation": ""}, "snippet": " img_gray = fea.grayscale(image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L170_C12", "label": "locs, descs = surf()", "type": "assigned_variable", "loc": [170, 170], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "vector": [14, 3, 0.8543, 0.005, 3, 0.61, 0.5, 563, 3, 1, 0, 0, 181, 10, 1], "semantic": {"name": "locs, descs", "arg_names": [], "import_names": [], "rhs_call_name": "surf", "annotation": ""}, "snippet": " locs, descs = fea.surf(img_gray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L171_C12", "label": "match_idxs =", "type": "assigned_variable", "loc": [171, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "vector": [14, 3, 0.8593, 0.005, 3, 0.61, 0.5833, 86, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "match_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " match_idxs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L172_C12", "label": "for i, desc", "type": "for", "loc": [172, 176], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "vector": [6, 3, 0.8744, 0.0251, 3, 0.61, 0.6667, 659, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i, desc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, desc in enumerate(descs):\n dists, idxs = features_db.query(np.array(desc), 2)\n ratio = dists[0] / dists[1]\n if ratio < .49:\n match_idxs.append(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L173_C16", "label": "dists, idxs = query()", "type": "assigned_variable", "loc": [173, 173], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L172_C12", "vector": [14, 4, 0.8693, 0.005, 4, 0.98, 0.0, 956, 3, 2, 0, 0, 546, 10, 2], "semantic": {"name": "dists, idxs", "arg_names": [], "import_names": [], "rhs_call_name": "query", "annotation": ""}, "snippet": " dists, idxs = features_db.query(np.array(desc), 2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L174_C16", "label": "ratio =", "type": "assigned_variable", "loc": [174, 174], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L172_C12", "vector": [14, 4, 0.8744, 0.005, 4, 0.98, 0.5, 188, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ratio", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ratio = dists[0] / dists[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L175_C16", "label": "if", "type": "if", "loc": [175, 176], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L172_C12", "vector": [4, 4, 0.8819, 0.0101, 4, 0.98, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ratio < .49:\n match_idxs.append(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L176_C20", "label": "append()", "type": "expression", "loc": [176, 176], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L175_C16", "vector": [8, 5, 0.8844, 0.005, 5, 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": " match_idxs.append(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L177_C12", "label": "img_viz = draw_surf()", "type": "assigned_variable", "loc": [177, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "vector": [14, 3, 0.8894, 0.005, 3, 0.61, 0.75, 780, 3, 3, 0, 0, 124, 10, 1], "semantic": {"name": "img_viz", "arg_names": [], "import_names": [], "rhs_call_name": "draw_surf", "annotation": ""}, "snippet": " img_viz = fea.draw_surf(image, locs, (255,0,0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L178_C12", "label": "img_viz = draw_surf()", "type": "assigned_variable", "loc": [178, 178], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "vector": [14, 3, 0.8945, 0.005, 3, 0.61, 0.8333, 780, 3, 3, 0, 0, 124, 10, 1], "semantic": {"name": "img_viz", "arg_names": [], "import_names": [], "rhs_call_name": "draw_surf", "annotation": ""}, "snippet": " img_viz = fea.draw_surf(img_viz, [locs[i] for i in match_idxs], (0,0,255))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L179_C12", "label": "si.image =", "type": "assigned_variable", "loc": [179, 179], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "vector": [14, 3, 0.8995, 0.005, 3, 0.61, 0.9167, 477, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "si.image", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " si.image = img_viz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L180_C12", "label": "print()", "type": "expression", "loc": [180, 180], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "vector": [8, 3, 0.9045, 0.005, 3, 0.61, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('%d matches found' % len(match_idxs))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99694:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L19_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L20_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L20_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L21_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L20_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L22_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Return_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Return_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:FunctionDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L164_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L166_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L167_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L168_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L170_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L172_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L173_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L172_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L174_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:For_L172_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L175_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:If_L175_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L176_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L177_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L178_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Assign_L179_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99694:While_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99694:Expr_L180_C12"}]
import csv import roslib; roslib.load_manifest('hai_sandbox') from cv_bridge.cv_bridge import CvBridge, CvBridgeError import rospy import cv import sys import hrl_lib.rutils as ru import hrl_lib.tf_utils as tfu import tf.transformations as tr import tf import hrl_camera.ros_camera as cam from sensor_msgs.msg import CameraInfo import numpy as np import hai_sandbox.features as fea import os.path as pt import hrl_lib.util as ut import itertools as it #Load original pickle orig_bag = sys.argv[1] topic = '/l_forearm_cam/image_rect_color' #Load surf pickle print 'loading pickle', sys.argv[2] surf_pkl = ut.load_pickle(sys.argv[2]) new_surf_data = [] print 'replacing time field' for tmt, surf_record in it.izip(ru.bag_iter(orig_bag, [topic]), surf_pkl) : topic, msg, t = tmt surf_t, surf_data = surf_record new_surf_data.append((msg.header.stamp.to_time(), surf_data)) print 'saving pickle with new time', sys.argv[2] ut.save_pickle(new_surf_data, sys.argv[2])
ajibawa-2023/Python-Code-Large/train/row_99695
30
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_99695:Import_L1_C0", "label": "csv import csv", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.027, 0, 0.66, 0.0, 312, 0, 1, 0, 0, 312, 0, 0], "semantic": {"name": "csv", "arg_names": [], "import_names": ["csv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import csv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0541, 0.027, 0, 0.66, 0.0385, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Expr_L2_C15", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0541, 0.027, 0, 0.66, 0.0769, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:ImportFrom_L3_C0", "label": "from cv_bridge.cv_bridge import CvBridge, CvBridgeError", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0811, 0.027, 0, 0.66, 0.1154, 356, 0, 2, 0, 0, 356, 0, 0], "semantic": {"name": "cv_bridge.cv_bridge", "arg_names": [], "import_names": ["CvBridge", "CvBridgeError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from cv_bridge.cv_bridge import CvBridge, CvBridgeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1081, 0.027, 0, 0.66, 0.1538, 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_99695:Import_L5_C0", "label": "cv import cv", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1351, 0.027, 0, 0.66, 0.1923, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Import_L6_C0", "label": "sys import sys", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1622, 0.027, 0, 0.66, 0.2308, 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_99695:Import_L8_C0", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.2162, 0.027, 0, 0.66, 0.2692, 847, 0, 1, 0, 0, 847, 0, 0], "semantic": {"name": "hrl_lib.rutils", "arg_names": [], "import_names": ["ru"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.rutils as ru"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Import_L9_C0", "label": "hrl_lib.tf_utils import tfu", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.2432, 0.027, 0, 0.66, 0.3077, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "hrl_lib.tf_utils", "arg_names": [], "import_names": ["tfu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.tf_utils as tfu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Import_L10_C0", "label": "tf.transformations import tr", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.2703, 0.027, 0, 0.66, 0.3462, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Import_L11_C0", "label": "tf import tf", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.2973, 0.027, 0, 0.66, 0.3846, 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_99695:Import_L12_C0", "label": "hrl_camera.ros_camera import cam", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.3243, 0.027, 0, 0.66, 0.4231, 798, 0, 1, 0, 0, 798, 0, 0], "semantic": {"name": "hrl_camera.ros_camera", "arg_names": [], "import_names": ["cam"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_camera.ros_camera as cam"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:ImportFrom_L13_C0", "label": "from sensor_msgs.msg import CameraInfo", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.3514, 0.027, 0, 0.66, 0.4615, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["CameraInfo"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import CameraInfo"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Import_L14_C0", "label": "numpy import np", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.3784, 0.027, 0, 0.66, 0.5, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Import_L15_C0", "label": "hai_sandbox.features import fea", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.4054, 0.027, 0, 0.66, 0.5385, 673, 0, 1, 0, 0, 673, 0, 0], "semantic": {"name": "hai_sandbox.features", "arg_names": [], "import_names": ["fea"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hai_sandbox.features as fea"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Import_L16_C0", "label": "os.path import pt", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.4324, 0.027, 0, 0.66, 0.5769, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["pt"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os.path as pt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Import_L17_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.4595, 0.027, 0, 0.66, 0.6154, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Import_L18_C0", "label": "itertools import it", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.4865, 0.027, 0, 0.66, 0.6538, 808, 0, 1, 0, 0, 808, 0, 0], "semantic": {"name": "itertools", "arg_names": [], "import_names": ["it"], "rhs_call_name": "", "annotation": ""}, "snippet": "import itertools as it"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Assign_L21_C0", "label": "orig_bag =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.5676, 0.027, 0, 0.66, 0.6923, 961, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "orig_bag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "orig_bag = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Assign_L22_C0", "label": "topic =", "type": "assigned_variable", "loc": [22, 22], "level": 0, "parent": null, "vector": [14, 0, 0.5946, 0.027, 0, 0.66, 0.7308, 225, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "topic = '/l_forearm_cam/image_rect_color'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Expr_L25_C0", "label": "print()", "type": "expression", "loc": [25, 25], "level": 0, "parent": null, "vector": [8, 0, 0.6757, 0.027, 0, 0.66, 0.7692, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('loading pickle', sys.argv[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Assign_L26_C0", "label": "surf_pkl = load_pickle()", "type": "assigned_variable", "loc": [26, 26], "level": 0, "parent": null, "vector": [14, 0, 0.7027, 0.027, 0, 0.66, 0.8077, 305, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "surf_pkl", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": "surf_pkl = ut.load_pickle(sys.argv[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Assign_L28_C0", "label": "new_surf_data =", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.7568, 0.027, 0, 0.66, 0.8462, 929, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "new_surf_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "new_surf_data = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Expr_L30_C0", "label": "print()", "type": "expression", "loc": [30, 30], "level": 0, "parent": null, "vector": [8, 0, 0.8108, 0.027, 0, 0.66, 0.8846, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('replacing time field')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:For_L31_C0", "label": "for tmt, surf_record", "type": "for", "loc": [31, 34], "level": 0, "parent": null, "vector": [6, 0, 0.8784, 0.1081, 0, 0.66, 0.9231, 444, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "tmt, surf_record", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for tmt, surf_record in it.izip(ru.bag_iter(orig_bag, [topic]), surf_pkl) :\n topic, msg, t = tmt\n surf_t, surf_data = surf_record \n new_surf_data.append((msg.header.stamp.to_time(), surf_data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Assign_L32_C4", "label": "topic, msg, t =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99695:For_L31_C0", "vector": [14, 1, 0.8649, 0.027, 1, 0.72, 0.0, 35, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "topic, msg, t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " topic, msg, t = tmt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Assign_L33_C4", "label": "surf_t, surf_data =", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99695:For_L31_C0", "vector": [14, 1, 0.8919, 0.027, 1, 0.72, 0.5, 946, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "surf_t, surf_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " surf_t, surf_data = surf_record "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Expr_L34_C4", "label": "append()", "type": "expression", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99695:For_L31_C0", "vector": [8, 1, 0.9189, 0.027, 1, 0.72, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " new_surf_data.append((msg.header.stamp.to_time(), surf_data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Expr_L36_C0", "label": "print()", "type": "expression", "loc": [36, 36], "level": 0, "parent": null, "vector": [8, 0, 0.973, 0.027, 0, 0.66, 0.9615, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('saving pickle with new time', sys.argv[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99695:Expr_L37_C0", "label": "save_pickle()", "type": "expression", "loc": [37, 37], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.027, 0, 0.66, 1.0, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": "ut.save_pickle(new_surf_data, sys.argv[2])"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99695:For_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99695:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99695:For_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99695:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99695:For_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99695:Expr_L34_C4"}]
import roslib; roslib.load_manifest('hai_sandbox') import rospy import cv import numpy as np import feature_extractor_fpfh.srv as fsrv import hrl_lib.image3d as i3d import hrl_lib.rutils as ru import hrl_lib.prob as pr import hrl_lib.tf_utils as tfu import pdb ## # Generalized from Probabilistic robotics for N != weights.shape[0] def sample_points(weights, N): assert(weights.shape[0] >= N) M = weights.shape[0] weights = weights / np.sum(weights) r = np.random.rand() * (1.0/M) c = weights[0,0] i = 0 Xt = [] indices = np.sort(np.random.permutation(np.arange(1, M+1))[0:N]).tolist() for m in indices: U = r + (m - 1) * (1.0/M) while U > c: i = i + 1 c = c + weights[i,0] Xt.append(i) return Xt def test_sample_points(): w = np.matrix([.1,.4,.5]).T count = [0., 0., 0.] for i in range(6000.): idx = sample_points(w, 2) for x in idx: count[x] += 1 print np.matrix(count) / np.sum(count) def intensity_pyramid_feature(point2d_image, np_image_arr, win_size, multipliers, flatten=True): invalid_location = False local_intensity = [] for multiplier in multipliers: if multiplier == 1: features = i3d.local_window(point2d_image, np_image_arr, win_size, flatten=flatten) else: features = i3d.local_window(point2d_image, np_image_arr, win_size*multiplier, resize_to=win_size, flatten=flatten) if features == None: invalid_location = True break else: local_intensity.append(features) if invalid_location: return None else: if flatten: return np.row_stack(local_intensity) else: return local_intensity class Subsampler: def __init__(self): self.proxy = rospy.ServiceProxy('subsample', fsrv.SubsampleCalc) def subsample(self, points3d, frame='base_link'): req = fsrv.SubsampleCalcRequest() req.input = ru.np_to_pointcloud(points3d, frame) res = self.proxy(req) return ru.pointcloud_to_np(res.output) class IntensityCloudFeatureExtractor: def __init__(self, pointcloud_bl, cvimage_mat, expected_loc_bl, distance_feature_points, image_T_bl, camera_calibration, params): self.pointcloud_bl = pointcloud_bl self.cvimage_mat = cvimage_mat self.expected_loc_bl = expected_loc_bl self.distance_feature_points = distance_feature_points self.image_T_bl = image_T_bl self.camera_calibration = camera_calibration self.params = params self.subsampler_service = Subsampler() self.sizes = None #Important but access should be limited to decouple code def get_sizes(self): return self.sizes def _subsample(self): rospy.loginfo('Subsampling using PCL') rospy.loginfo('before %s' % str(self.pointcloud_bl.shape)) self.pc_sub_samp_bl = self.subsampler_service.subsample(self.pointcloud_bl) rospy.loginfo('after %s' % str(self.pc_sub_samp_bl.shape)) def _sample_points(self): rospy.loginfo('Sampling points') #evaluate all points gaussian = pr.Gaussian(self.expected_loc_bl, \ np.matrix([[self.params.uncertainty_x**2, 0, 0], \ [0, self.params.uncertainty_y**2, 0], \ [0, 0, self.params.uncertainty_z**2]])) pdf = gaussian.pdf_mat() probs = np.matrix(pdf(self.pc_sub_samp_bl)) #sample unique points n_samples = min(self.params.n_samples, self.pc_sub_samp_bl.shape[1]) pt_indices = list(set(sample_points(probs.T, n_samples))) #only keep those that are in bound of points sampled_pts3d_bl = self.pc_sub_samp_bl[:, pt_indices] sampled_pts3d_image = tfu.transform_points(self.image_T_bl, sampled_pts3d_bl) sampled_pts2d = self.camera_calibration.project(sampled_pts3d_image) sampled_pix2d = np.matrix(np.round(sampled_pts2d)) #throw away points that are outside of bounds x = sampled_pix2d[0,:] y = sampled_pix2d[1,:] good_pts = np.where((x >= 0) + (x < self.camera_calibration.w) \ + (y >= 0) + (y < self.camera_calibration.h))[1].A1 sampled_pts3d_bl = sampled_pts3d_bl[:, good_pts] sampled_pix2d = sampled_pix2d[:, good_pts] rospy.loginfo('got %s good points' % str(sampled_pix2d.shape[1])) return sampled_pts3d_bl, sampled_pix2d def feature_vec_at(self, point3d_bl, point2d_image): fea_calculated = [] #Get synthetic distance points distance_feas = None if self.distance_feature_points != None: distance_feas = np.power(np.sum(np.power(self.distance_feature_points - point3d_bl, 2), 0), .5).T fea_calculated.append(distance_feas) #Get intensity features intensity = intensity_pyramid_feature(point2d_image, np.asarray(self.cvimage_mat), self.params.win_size, self.params.win_multipliers, True) #pdb.set_trace() if intensity == None: return None else: fea_calculated.append(intensity) if self.sizes == None: self.sizes = {} if distance_feas != None: self.sizes['distance'] = distance_feas.shape[0] self.sizes['intensity'] = intensity.shape[0] return fea_calculated def extract_features(self): self._subsample() sampled_pts3d_bl, sampled_pix2d = self._sample_points() features_l = [] pts_with_features = [] rospy.loginfo('Extracting features') for i in range(sampled_pts3d_bl.shape[1]): features = self.feature_vec_at(sampled_pts3d_bl[:,i], sampled_pix2d[:,i]) if features != None: features_l.append(features) pts_with_features.append(i) if i % 500 == 0: rospy.loginfo(i) features_by_type = zip(*features_l) xs = np.row_stack([np.column_stack(f) for f in features_by_type]) rospy.loginfo('Finished feature extraction.') return xs, sampled_pix2d[:, pts_with_features], sampled_pts3d_bl[:, pts_with_features]
ajibawa-2023/Python-Code-Large/train/row_99696
125
183
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0055, 0.0055, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0055, 0.0055, 0, 0.66, 0.0667, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0109, 0.0055, 0, 0.66, 0.1333, 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_99696:Import_L3_C0", "label": "cv import cv", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0164, 0.0055, 0, 0.66, 0.2, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Import_L4_C0", "label": "numpy import np", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0219, 0.0055, 0, 0.66, 0.2667, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Import_L5_C0", "label": "feature_extractor_fpfh.srv import fsrv", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0273, 0.0055, 0, 0.66, 0.3333, 300, 0, 1, 0, 0, 300, 0, 0], "semantic": {"name": "feature_extractor_fpfh.srv", "arg_names": [], "import_names": ["fsrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import feature_extractor_fpfh.srv as fsrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Import_L6_C0", "label": "hrl_lib.image3d import i3d", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0328, 0.0055, 0, 0.66, 0.4, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "hrl_lib.image3d", "arg_names": [], "import_names": ["i3d"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.image3d as i3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Import_L7_C0", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0383, 0.0055, 0, 0.66, 0.4667, 847, 0, 1, 0, 0, 847, 0, 0], "semantic": {"name": "hrl_lib.rutils", "arg_names": [], "import_names": ["ru"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.rutils as ru"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Import_L8_C0", "label": "hrl_lib.prob import pr", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0437, 0.0055, 0, 0.66, 0.5333, 779, 0, 1, 0, 0, 779, 0, 0], "semantic": {"name": "hrl_lib.prob", "arg_names": [], "import_names": ["pr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.prob as pr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Import_L9_C0", "label": "hrl_lib.tf_utils import tfu", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0492, 0.0055, 0, 0.66, 0.6, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "hrl_lib.tf_utils", "arg_names": [], "import_names": ["tfu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.tf_utils as tfu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Import_L10_C0", "label": "pdb import pdb", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0546, 0.0055, 0, 0.66, 0.6667, 91, 0, 1, 0, 0, 91, 0, 0], "semantic": {"name": "pdb", "arg_names": [], "import_names": ["pdb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pdb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L15_C0", "label": "sample_points", "type": "function", "loc": [15, 32], "level": 0, "parent": null, "vector": [2, 0, 0.1284, 0.0984, 0, 0.66, 0.7333, 500, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "sample_points", "arg_names": ["weights", "N"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def sample_points(weights, N):\n assert(weights.shape[0] >= N)\n\n M = weights.shape[0]\n weights = weights / np.sum(weights)\n r = np.random.rand() * (1.0/M)\n c = weights[0,0]\n i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L18_C4", "label": "M =", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L15_C0", "vector": [14, 1, 0.0984, 0.0055, 1, 0.62, 0.0, 727, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "M", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " M = weights.shape[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L19_C4", "label": "weights =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L15_C0", "vector": [14, 1, 0.1038, 0.0055, 1, 0.62, 0.125, 362, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "weights", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " weights = weights / np.sum(weights)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L20_C4", "label": "r =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L15_C0", "vector": [14, 1, 0.1093, 0.0055, 1, 0.62, 0.25, 436, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = np.random.rand() * (1.0/M)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L21_C4", "label": "c =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L15_C0", "vector": [14, 1, 0.1148, 0.0055, 1, 0.62, 0.375, 411, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c = weights[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L22_C4", "label": "i =", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L15_C0", "vector": [14, 1, 0.1202, 0.0055, 1, 0.62, 0.5, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L23_C4", "label": "Xt =", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L15_C0", "vector": [14, 1, 0.1257, 0.0055, 1, 0.62, 0.625, 150, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "Xt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " Xt = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L25_C4", "label": "indices = tolist()", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L15_C0", "vector": [14, 1, 0.1366, 0.0055, 1, 0.62, 0.75, 478, 3, 0, 0, 0, 185, 10, 4], "semantic": {"name": "indices", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " indices = np.sort(np.random.permutation(np.arange(1, M+1))[0:N]).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L26_C4", "label": "for m", "type": "for", "loc": [26, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L15_C0", "vector": [6, 1, 0.1557, 0.0328, 1, 0.62, 0.875, 711, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for m in indices:\n U = r + (m - 1) * (1.0/M)\n while U > c:\n i = i + 1\n c = c + weights[i,0]\n Xt.append(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L27_C8", "label": "U =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L26_C4", "vector": [14, 2, 0.1475, 0.0055, 2, 0.0, 0.0, 643, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "U", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " U = r + (m - 1) * (1.0/M)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:While_L28_C8", "label": "while", "type": "while", "loc": [28, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L26_C4", "vector": [5, 2, 0.1585, 0.0164, 2, 0.0, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while U > c:\n i = i + 1\n c = c + weights[i,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L29_C12", "label": "i =", "type": "assigned_variable", "loc": [29, 29], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:While_L28_C8", "vector": [14, 3, 0.1585, 0.0055, 3, 0.05, 0.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L30_C12", "label": "c =", "type": "assigned_variable", "loc": [30, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:While_L28_C8", "vector": [14, 3, 0.1639, 0.0055, 3, 0.05, 1.0, 411, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c = c + weights[i,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L31_C8", "label": "append()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L26_C4", "vector": [8, 2, 0.1694, 0.0055, 2, 0.0, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " Xt.append(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Return_L32_C4", "label": "return", "type": "return", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L15_C0", "vector": [13, 1, 0.1749, 0.0055, 1, 0.62, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Xt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L35_C0", "label": "test_sample_points", "type": "function", "loc": [35, 43], "level": 0, "parent": null, "vector": [2, 0, 0.2131, 0.0492, 0, 0.66, 0.8, 160, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "test_sample_points", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_sample_points():\n w = np.matrix([.1,.4,.5]).T\n count = [0., 0., 0.]\n\n for i in range(6000.):\n idx = sample_points(w, 2)\n for x in idx:\n count[x] += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L36_C4", "label": "w =", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L35_C0", "vector": [14, 1, 0.1967, 0.0055, 1, 0.42, 0.0, 549, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " w = np.matrix([.1,.4,.5]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L37_C4", "label": "count =", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L35_C0", "vector": [14, 1, 0.2022, 0.0055, 1, 0.42, 0.3333, 778, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count = [0., 0., 0.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L39_C4", "label": "for i", "type": "for", "loc": [39, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L35_C0", "vector": [6, 1, 0.2213, 0.0219, 1, 0.42, 0.6667, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(6000.):\n idx = sample_points(w, 2)\n for x in idx:\n count[x] += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L40_C8", "label": "idx = sample_points()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L39_C4", "vector": [14, 2, 0.2186, 0.0055, 2, 0.38, 0.0, 187, 3, 2, 0, 0, 500, 10, 1], "semantic": {"name": "idx", "arg_names": [], "import_names": [], "rhs_call_name": "sample_points", "annotation": ""}, "snippet": " idx = sample_points(w, 2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L41_C8", "label": "for x", "type": "for", "loc": [41, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L39_C4", "vector": [6, 2, 0.2268, 0.0109, 2, 0.38, 1.0, 190, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in idx:\n count[x] += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L43_C4", "label": "print()", "type": "expression", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L35_C0", "vector": [8, 1, 0.235, 0.0055, 1, 0.42, 1.0, 535, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(np.matrix(count) / np.sum(count))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L46_C0", "label": "intensity_pyramid_feature", "type": "function", "loc": [46, 66], "level": 0, "parent": null, "vector": [2, 0, 0.306, 0.1148, 0, 0.66, 0.8667, 258, 0, 5, 1, 0, 0, 0, 4], "semantic": {"name": "intensity_pyramid_feature", "arg_names": ["point2d_image", "np_image_arr", "win_size", "multipliers", "flatten"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def intensity_pyramid_feature(point2d_image, np_image_arr, win_size, multipliers, flatten=True):\n invalid_location = False\n local_intensity = []\n for multiplier in multipliers:\n if multiplier == 1:\n features = i3d.local_window(point2d_image, np_image_arr, win_size, flatten=flatten)\n else:\n features = i3d.local_window(point2d_image, np_image_arr, win_size*multiplier, "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L47_C4", "label": "invalid_location =", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L46_C0", "vector": [14, 1, 0.2568, 0.0055, 1, 0.24, 0.0, 325, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "invalid_location", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " invalid_location = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L48_C4", "label": "local_intensity =", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L46_C0", "vector": [14, 1, 0.2623, 0.0055, 1, 0.24, 0.3333, 891, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "local_intensity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " local_intensity = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L49_C4", "label": "for multiplier", "type": "for", "loc": [49, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L46_C0", "vector": [6, 1, 0.2951, 0.0601, 1, 0.24, 0.6667, 108, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "multiplier", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for multiplier in multipliers:\n if multiplier == 1:\n features = i3d.local_window(point2d_image, np_image_arr, win_size, flatten=flatten)\n else:\n features = i3d.local_window(point2d_image, np_image_arr, win_size*multiplier, \n resize_to=win_size, flatten=flatten)\n if features == None:\n invalid_location = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L50_C8", "label": "if", "type": "if", "loc": [50, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L49_C4", "vector": [4, 2, 0.2842, 0.0273, 2, 0.84, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if multiplier == 1:\n features = i3d.local_window(point2d_image, np_image_arr, win_size, flatten=flatten)\n else:\n features = i3d.local_window(point2d_image, np_image_arr, win_size*multiplier, \n resize_to=win_size, flatten=flatten)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L51_C12", "label": "features = local_window()", "type": "assigned_variable", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L50_C8", "vector": [14, 3, 0.2787, 0.0055, 3, 0.0, 0.0, 479, 3, 4, 0, 0, 354, 10, 1], "semantic": {"name": "features", "arg_names": [], "import_names": [], "rhs_call_name": "local_window", "annotation": ""}, "snippet": " features = i3d.local_window(point2d_image, np_image_arr, win_size, flatten=flatten)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L53_C12", "label": "features = local_window()", "type": "assigned_variable", "loc": [53, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L50_C8", "vector": [14, 3, 0.2923, 0.0109, 3, 0.0, 1.0, 479, 3, 5, 0, 0, 354, 10, 1], "semantic": {"name": "features", "arg_names": [], "import_names": [], "rhs_call_name": "local_window", "annotation": ""}, "snippet": " features = i3d.local_window(point2d_image, np_image_arr, win_size*multiplier, \n resize_to=win_size, flatten=flatten)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L55_C8", "label": "if", "type": "if", "loc": [55, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L49_C4", "vector": [4, 2, 0.3115, 0.0273, 2, 0.84, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if features == None:\n invalid_location = True\n break\n else:\n local_intensity.append(features)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L56_C12", "label": "invalid_location =", "type": "assigned_variable", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L55_C8", "vector": [14, 3, 0.306, 0.0055, 3, 0.99, 0.0, 325, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "invalid_location", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " invalid_location = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L59_C12", "label": "append()", "type": "expression", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L55_C8", "vector": [8, 3, 0.3224, 0.0055, 3, 0.99, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " local_intensity.append(features)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L60_C4", "label": "if", "type": "if", "loc": [60, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L46_C0", "vector": [4, 1, 0.3443, 0.0383, 1, 0.24, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if invalid_location:\n return None\n else:\n if flatten:\n return np.row_stack(local_intensity)\n else:\n return local_intensity"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Return_L61_C8", "label": "return", "type": "return", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L60_C4", "vector": [13, 2, 0.3333, 0.0055, 2, 0.12, 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_99696:If_L63_C8", "label": "if", "type": "if", "loc": [63, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L60_C4", "vector": [4, 2, 0.3525, 0.0219, 2, 0.12, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if flatten:\n return np.row_stack(local_intensity)\n else:\n return local_intensity"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Return_L64_C12", "label": "return", "type": "return", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L63_C8", "vector": [13, 3, 0.3497, 0.0055, 3, 0.77, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.row_stack(local_intensity)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Return_L66_C12", "label": "return", "type": "return", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L63_C8", "vector": [13, 3, 0.3607, 0.0055, 3, 0.77, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return local_intensity"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:ClassDef_L68_C0", "label": "Subsampler", "type": "class", "loc": [68, 76], "level": 0, "parent": null, "vector": [3, 0, 0.3934, 0.0492, 0, 0.66, 0.9333, 139, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "Subsampler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Subsampler:\n def __init__(self):\n self.proxy = rospy.ServiceProxy('subsample', fsrv.SubsampleCalc)\n\n def subsample(self, points3d, frame='base_link'):\n req = fsrv.SubsampleCalcRequest()\n req.input = ru.np_to_pointcloud(points3d, frame)\n res = self.proxy(req)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L69_C4", "label": "__init__", "type": "function", "loc": [69, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:ClassDef_L68_C0", "vector": [2, 1, 0.3798, 0.0109, 1, 0.77, 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.proxy = rospy.ServiceProxy('subsample', fsrv.SubsampleCalc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L70_C8", "label": "self.proxy = ServiceProxy()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L69_C4", "vector": [14, 2, 0.3825, 0.0055, 2, 0.77, 0.0, 837, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.proxy", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.proxy = rospy.ServiceProxy('subsample', fsrv.SubsampleCalc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L72_C4", "label": "subsample", "type": "function", "loc": [72, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:ClassDef_L68_C0", "vector": [2, 1, 0.4044, 0.0273, 1, 0.77, 1.0, 938, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "subsample", "arg_names": ["self", "points3d", "frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def subsample(self, points3d, frame='base_link'):\n req = fsrv.SubsampleCalcRequest()\n req.input = ru.np_to_pointcloud(points3d, frame)\n res = self.proxy(req)\n return ru.pointcloud_to_np(res.output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L73_C8", "label": "req = SubsampleCalcRequest()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L72_C4", "vector": [14, 2, 0.3989, 0.0055, 2, 0.79, 0.0, 233, 3, 0, 0, 0, 913, 10, 1], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "SubsampleCalcRequest", "annotation": ""}, "snippet": " req = fsrv.SubsampleCalcRequest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L74_C8", "label": "req.input = np_to_pointcloud()", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L72_C4", "vector": [14, 2, 0.4044, 0.0055, 2, 0.79, 0.3333, 699, 3, 2, 0, 0, 712, 10, 1], "semantic": {"name": "req.input", "arg_names": [], "import_names": [], "rhs_call_name": "np_to_pointcloud", "annotation": ""}, "snippet": " req.input = ru.np_to_pointcloud(points3d, frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L75_C8", "label": "res = proxy()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L72_C4", "vector": [14, 2, 0.4098, 0.0055, 2, 0.79, 0.6667, 413, 3, 1, 0, 0, 916, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "proxy", "annotation": ""}, "snippet": " res = self.proxy(req)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Return_L76_C8", "label": "return", "type": "return", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L72_C4", "vector": [13, 2, 0.4153, 0.0055, 2, 0.79, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ru.pointcloud_to_np(res.output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:ClassDef_L79_C0", "label": "IntensityCloudFeatureExtractor", "type": "class", "loc": [79, 181], "level": 0, "parent": null, "vector": [3, 0, 0.7104, 0.5628, 0, 0.66, 1.0, 142, 0, 6, 0, 0, 0, 0, 43], "semantic": {"name": "IntensityCloudFeatureExtractor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class IntensityCloudFeatureExtractor:\n\n def __init__(self, pointcloud_bl, cvimage_mat, expected_loc_bl, distance_feature_points, \n image_T_bl, camera_calibration, params):\n\n self.pointcloud_bl = pointcloud_bl\n self.cvimage_mat = cvimage_mat\n self.expected_loc_bl = expected_loc_bl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L81_C4", "label": "__init__", "type": "function", "loc": [81, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:ClassDef_L79_C0", "vector": [2, 1, 0.4754, 0.071, 1, 0.79, 0.0, 555, 0, 8, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "pointcloud_bl", "cvimage_mat", "expected_loc_bl", "distance_feature_points", "image_T_bl", "camera_calibration", "params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, pointcloud_bl, cvimage_mat, expected_loc_bl, distance_feature_points, \n image_T_bl, camera_calibration, params):\n\n self.pointcloud_bl = pointcloud_bl\n self.cvimage_mat = cvimage_mat\n self.expected_loc_bl = expected_loc_bl\n self.distance_feature_points = distance_feature_points\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L84_C8", "label": "self.pointcloud_bl =", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L81_C4", "vector": [14, 2, 0.459, 0.0055, 2, 0.55, 0.0, 304, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.pointcloud_bl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pointcloud_bl = pointcloud_bl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L85_C8", "label": "self.cvimage_mat =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L81_C4", "vector": [14, 2, 0.4645, 0.0055, 2, 0.55, 0.125, 335, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cvimage_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cvimage_mat = cvimage_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L86_C8", "label": "self.expected_loc_bl =", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L81_C4", "vector": [14, 2, 0.4699, 0.0055, 2, 0.55, 0.25, 86, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.expected_loc_bl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.expected_loc_bl = expected_loc_bl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L87_C8", "label": "self.distance_feature_points =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L81_C4", "vector": [14, 2, 0.4754, 0.0055, 2, 0.55, 0.375, 341, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.distance_feature_points", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.distance_feature_points = distance_feature_points"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L89_C8", "label": "self.image_T_bl =", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L81_C4", "vector": [14, 2, 0.4863, 0.0055, 2, 0.55, 0.5, 834, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.image_T_bl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.image_T_bl = image_T_bl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L90_C8", "label": "self.camera_calibration =", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L81_C4", "vector": [14, 2, 0.4918, 0.0055, 2, 0.55, 0.625, 552, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.camera_calibration", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.camera_calibration = camera_calibration"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L91_C8", "label": "self.params =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L81_C4", "vector": [14, 2, 0.4973, 0.0055, 2, 0.55, 0.75, 402, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.params = params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L92_C8", "label": "self.subsampler_service = Subsampler()", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L81_C4", "vector": [14, 2, 0.5027, 0.0055, 2, 0.55, 0.875, 404, 3, 0, 0, 0, 139, 10, 1], "semantic": {"name": "self.subsampler_service", "arg_names": [], "import_names": [], "rhs_call_name": "Subsampler", "annotation": ""}, "snippet": " self.subsampler_service = Subsampler()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L93_C8", "label": "self.sizes =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L81_C4", "vector": [14, 2, 0.5082, 0.0055, 2, 0.55, 1.0, 719, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.sizes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.sizes = None #Important but access should be limited to decouple code"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L95_C4", "label": "get_sizes", "type": "function", "loc": [95, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:ClassDef_L79_C0", "vector": [2, 1, 0.5219, 0.0109, 1, 0.79, 0.2, 378, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_sizes", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_sizes(self):\n return self.sizes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Return_L96_C8", "label": "return", "type": "return", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L95_C4", "vector": [13, 2, 0.5246, 0.0055, 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.sizes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L98_C4", "label": "_subsample", "type": "function", "loc": [98, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:ClassDef_L79_C0", "vector": [2, 1, 0.5464, 0.0273, 1, 0.79, 0.4, 110, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "_subsample", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _subsample(self):\n rospy.loginfo('Subsampling using PCL')\n rospy.loginfo('before %s' % str(self.pointcloud_bl.shape))\n self.pc_sub_samp_bl = self.subsampler_service.subsample(self.pointcloud_bl)\n rospy.loginfo('after %s' % str(self.pc_sub_samp_bl.shape))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L99_C8", "label": "loginfo()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L98_C4", "vector": [8, 2, 0.541, 0.0055, 2, 0.91, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Subsampling using PCL')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L100_C8", "label": "loginfo()", "type": "expression", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L98_C4", "vector": [8, 2, 0.5464, 0.0055, 2, 0.91, 0.3333, 607, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('before %s' % str(self.pointcloud_bl.shape))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L101_C8", "label": "self.pc_sub_samp_bl = subsample()", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L98_C4", "vector": [14, 2, 0.5519, 0.0055, 2, 0.91, 0.6667, 305, 3, 1, 0, 0, 938, 10, 1], "semantic": {"name": "self.pc_sub_samp_bl", "arg_names": [], "import_names": [], "rhs_call_name": "subsample", "annotation": ""}, "snippet": " self.pc_sub_samp_bl = self.subsampler_service.subsample(self.pointcloud_bl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L102_C8", "label": "loginfo()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L98_C4", "vector": [8, 2, 0.5574, 0.0055, 2, 0.91, 1.0, 607, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('after %s' % str(self.pc_sub_samp_bl.shape))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "label": "_sample_points", "type": "function", "loc": [104, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:ClassDef_L79_C0", "vector": [2, 1, 0.653, 0.1749, 1, 0.79, 0.6, 874, 0, 1, 1, 0, 0, 0, 17], "semantic": {"name": "_sample_points", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _sample_points(self):\n rospy.loginfo('Sampling points')\n #evaluate all points\n gaussian = pr.Gaussian(self.expected_loc_bl, \\\n np.matrix([[self.params.uncertainty_x**2, 0, 0], \\\n [0, self.params.uncertainty_y**2, 0], \\\n [0, 0, self.params.uncertainty_z**2]]))\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L105_C8", "label": "loginfo()", "type": "expression", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "vector": [8, 2, 0.5738, 0.0055, 2, 0.46, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Sampling points')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L107_C8", "label": "gaussian = Gaussian()", "type": "assigned_variable", "loc": [107, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "vector": [14, 2, 0.5929, 0.0219, 2, 0.46, 0.0625, 78, 3, 2, 0, 0, 408, 10, 2], "semantic": {"name": "gaussian", "arg_names": [], "import_names": [], "rhs_call_name": "Gaussian", "annotation": ""}, "snippet": " gaussian = pr.Gaussian(self.expected_loc_bl, \\\n np.matrix([[self.params.uncertainty_x**2, 0, 0], \\\n [0, self.params.uncertainty_y**2, 0], \\\n [0, 0, self.params.uncertainty_z**2]]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L112_C8", "label": "pdf = pdf_mat()", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "vector": [14, 2, 0.612, 0.0055, 2, 0.46, 0.125, 298, 3, 0, 0, 0, 929, 10, 1], "semantic": {"name": "pdf", "arg_names": [], "import_names": [], "rhs_call_name": "pdf_mat", "annotation": ""}, "snippet": " pdf = gaussian.pdf_mat()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L113_C8", "label": "probs = matrix()", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "vector": [14, 2, 0.6175, 0.0055, 2, 0.46, 0.1875, 0, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "probs", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " probs = np.matrix(pdf(self.pc_sub_samp_bl))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L116_C8", "label": "n_samples = min()", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "vector": [14, 2, 0.6339, 0.0055, 2, 0.46, 0.25, 812, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "n_samples", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " n_samples = min(self.params.n_samples, self.pc_sub_samp_bl.shape[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L117_C8", "label": "pt_indices = list()", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "vector": [14, 2, 0.6393, 0.0055, 2, 0.46, 0.3125, 435, 3, 1, 0, 0, 430, 10, 3], "semantic": {"name": "pt_indices", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " pt_indices = list(set(sample_points(probs.T, n_samples)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L120_C8", "label": "sampled_pts3d_bl =", "type": "assigned_variable", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "vector": [14, 2, 0.6557, 0.0055, 2, 0.46, 0.375, 726, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sampled_pts3d_bl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sampled_pts3d_bl = self.pc_sub_samp_bl[:, pt_indices]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L121_C8", "label": "sampled_pts3d_image = transform_points()", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "vector": [14, 2, 0.6612, 0.0055, 2, 0.46, 0.4375, 542, 3, 2, 0, 0, 725, 10, 1], "semantic": {"name": "sampled_pts3d_image", "arg_names": [], "import_names": [], "rhs_call_name": "transform_points", "annotation": ""}, "snippet": " sampled_pts3d_image = tfu.transform_points(self.image_T_bl, sampled_pts3d_bl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L122_C8", "label": "sampled_pts2d = project()", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "vector": [14, 2, 0.6667, 0.0055, 2, 0.46, 0.5, 303, 3, 1, 0, 0, 841, 10, 1], "semantic": {"name": "sampled_pts2d", "arg_names": [], "import_names": [], "rhs_call_name": "project", "annotation": ""}, "snippet": " sampled_pts2d = self.camera_calibration.project(sampled_pts3d_image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L123_C8", "label": "sampled_pix2d = matrix()", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "vector": [14, 2, 0.6721, 0.0055, 2, 0.46, 0.5625, 771, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "sampled_pix2d", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " sampled_pix2d = np.matrix(np.round(sampled_pts2d))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L126_C8", "label": "x =", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "vector": [14, 2, 0.6885, 0.0055, 2, 0.46, 0.625, 190, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = sampled_pix2d[0,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L127_C8", "label": "y =", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "vector": [14, 2, 0.694, 0.0055, 2, 0.46, 0.6875, 304, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = sampled_pix2d[1,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L128_C8", "label": "good_pts =", "type": "assigned_variable", "loc": [128, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "vector": [14, 2, 0.7022, 0.0109, 2, 0.46, 0.75, 54, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "good_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " good_pts = np.where((x >= 0) + (x < self.camera_calibration.w) \\\n + (y >= 0) + (y < self.camera_calibration.h))[1].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L131_C8", "label": "sampled_pts3d_bl =", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "vector": [14, 2, 0.7158, 0.0055, 2, 0.46, 0.8125, 726, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sampled_pts3d_bl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sampled_pts3d_bl = sampled_pts3d_bl[:, good_pts]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L132_C8", "label": "sampled_pix2d =", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "vector": [14, 2, 0.7213, 0.0055, 2, 0.46, 0.875, 771, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sampled_pix2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sampled_pix2d = sampled_pix2d[:, good_pts]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L134_C8", "label": "loginfo()", "type": "expression", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "vector": [8, 2, 0.7322, 0.0055, 2, 0.46, 0.9375, 607, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('got %s good points' % str(sampled_pix2d.shape[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Return_L135_C8", "label": "return", "type": "return", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "vector": [13, 2, 0.7377, 0.0055, 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 sampled_pts3d_bl, sampled_pix2d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L137_C4", "label": "feature_vec_at", "type": "function", "loc": [137, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:ClassDef_L79_C0", "vector": [2, 1, 0.8142, 0.1366, 1, 0.79, 0.8, 453, 0, 3, 1, 0, 0, 0, 7], "semantic": {"name": "feature_vec_at", "arg_names": ["self", "point3d_bl", "point2d_image"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def feature_vec_at(self, point3d_bl, point2d_image):\n fea_calculated = []\n\n #Get synthetic distance points\n distance_feas = None\n if self.distance_feature_points != None:\n distance_feas = np.power(np.sum(np.power(self.distance_feature_points - point3d_bl, 2), 0), .5).T\n fea_calculated.append(distance_feas)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L138_C8", "label": "fea_calculated =", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L137_C4", "vector": [14, 2, 0.7541, 0.0055, 2, 0.81, 0.0, 667, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "fea_calculated", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fea_calculated = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L141_C8", "label": "distance_feas =", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L137_C4", "vector": [14, 2, 0.7705, 0.0055, 2, 0.81, 0.1667, 931, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "distance_feas", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " distance_feas = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L142_C8", "label": "if", "type": "if", "loc": [142, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L137_C4", "vector": [4, 2, 0.7814, 0.0164, 2, 0.81, 0.3333, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.distance_feature_points != None:\n distance_feas = np.power(np.sum(np.power(self.distance_feature_points - point3d_bl, 2), 0), .5).T\n fea_calculated.append(distance_feas)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L143_C12", "label": "distance_feas =", "type": "assigned_variable", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L142_C8", "vector": [14, 3, 0.7814, 0.0055, 3, 0.39, 0.0, 931, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "distance_feas", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " distance_feas = np.power(np.sum(np.power(self.distance_feature_points - point3d_bl, 2), 0), .5).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L144_C12", "label": "append()", "type": "expression", "loc": [144, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L142_C8", "vector": [8, 3, 0.7869, 0.0055, 3, 0.39, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " fea_calculated.append(distance_feas)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L147_C8", "label": "intensity = intensity_pyramid_feature()", "type": "assigned_variable", "loc": [147, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L137_C4", "vector": [14, 2, 0.806, 0.0109, 2, 0.81, 0.5, 845, 3, 5, 0, 0, 258, 10, 2], "semantic": {"name": "intensity", "arg_names": [], "import_names": [], "rhs_call_name": "intensity_pyramid_feature", "annotation": ""}, "snippet": " intensity = intensity_pyramid_feature(point2d_image, np.asarray(self.cvimage_mat), \n self.params.win_size, self.params.win_multipliers, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L150_C8", "label": "if", "type": "if", "loc": [150, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L137_C4", "vector": [4, 2, 0.8279, 0.0219, 2, 0.81, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if intensity == None:\n return None\n else:\n fea_calculated.append(intensity)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Return_L151_C12", "label": "return", "type": "return", "loc": [151, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L150_C8", "vector": [13, 3, 0.8251, 0.0055, 3, 0.46, 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_99696:Expr_L153_C12", "label": "append()", "type": "expression", "loc": [153, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L150_C8", "vector": [8, 3, 0.8361, 0.0055, 3, 0.46, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " fea_calculated.append(intensity)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L155_C8", "label": "if", "type": "if", "loc": [155, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L137_C4", "vector": [4, 2, 0.8579, 0.0273, 2, 0.81, 0.8333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.sizes == None:\n self.sizes = {}\n if distance_feas != None:\n self.sizes['distance'] = distance_feas.shape[0]\n self.sizes['intensity'] = intensity.shape[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L156_C12", "label": "self.sizes =", "type": "assigned_variable", "loc": [156, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L155_C8", "vector": [14, 3, 0.8525, 0.0055, 3, 0.72, 0.0, 719, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.sizes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.sizes = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L157_C12", "label": "if", "type": "if", "loc": [157, 158], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L155_C8", "vector": [4, 3, 0.8607, 0.0109, 3, 0.72, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if distance_feas != None:\n self.sizes['distance'] = distance_feas.shape[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L158_C16", "label": "assign", "type": "assigned_variable", "loc": [158, 158], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L157_C12", "vector": [14, 4, 0.8634, 0.0055, 4, 0.54, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.sizes['distance'] = distance_feas.shape[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L159_C12", "label": "assign", "type": "assigned_variable", "loc": [159, 159], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L155_C8", "vector": [14, 3, 0.8689, 0.0055, 3, 0.72, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.sizes['intensity'] = intensity.shape[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Return_L161_C8", "label": "return", "type": "return", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L137_C4", "vector": [13, 2, 0.8798, 0.0055, 2, 0.81, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return fea_calculated"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4", "label": "extract_features", "type": "function", "loc": [163, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:ClassDef_L79_C0", "vector": [2, 1, 0.9399, 0.1038, 1, 0.79, 1.0, 763, 0, 1, 1, 0, 0, 0, 12], "semantic": {"name": "extract_features", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def extract_features(self):\n self._subsample()\n sampled_pts3d_bl, sampled_pix2d = self._sample_points()\n features_l = []\n pts_with_features = []\n\n rospy.loginfo('Extracting features')\n for i in range(sampled_pts3d_bl.shape[1]):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L164_C8", "label": "_subsample()", "type": "expression", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4", "vector": [8, 2, 0.8962, 0.0055, 2, 0.49, 0.0, 110, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_subsample", "arg_names": [], "import_names": [], "rhs_call_name": "_subsample", "annotation": ""}, "snippet": " self._subsample()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L165_C8", "label": "sampled_pts3d_bl, sampled_pix2d = _sample_points()", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4", "vector": [14, 2, 0.9016, 0.0055, 2, 0.49, 0.1111, 320, 3, 0, 0, 0, 874, 10, 1], "semantic": {"name": "sampled_pts3d_bl, sampled_pix2d", "arg_names": [], "import_names": [], "rhs_call_name": "_sample_points", "annotation": ""}, "snippet": " sampled_pts3d_bl, sampled_pix2d = self._sample_points()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L166_C8", "label": "features_l =", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4", "vector": [14, 2, 0.9071, 0.0055, 2, 0.49, 0.2222, 288, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "features_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " features_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L167_C8", "label": "pts_with_features =", "type": "assigned_variable", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4", "vector": [14, 2, 0.9126, 0.0055, 2, 0.49, 0.3333, 635, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pts_with_features", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_with_features = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L169_C8", "label": "loginfo()", "type": "expression", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4", "vector": [8, 2, 0.9235, 0.0055, 2, 0.49, 0.4444, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Extracting features')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L170_C8", "label": "for i", "type": "for", "loc": [170, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4", "vector": [6, 2, 0.9454, 0.0383, 2, 0.49, 0.5556, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(sampled_pts3d_bl.shape[1]):\n features = self.feature_vec_at(sampled_pts3d_bl[:,i], sampled_pix2d[:,i])\n if features != None:\n features_l.append(features)\n pts_with_features.append(i)\n if i % 500 == 0:\n rospy.loginfo(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L171_C12", "label": "features = feature_vec_at()", "type": "assigned_variable", "loc": [171, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L170_C8", "vector": [14, 3, 0.9344, 0.0055, 3, 0.34, 0.0, 479, 3, 2, 0, 0, 453, 10, 1], "semantic": {"name": "features", "arg_names": [], "import_names": [], "rhs_call_name": "feature_vec_at", "annotation": ""}, "snippet": " features = self.feature_vec_at(sampled_pts3d_bl[:,i], sampled_pix2d[:,i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L172_C12", "label": "if", "type": "if", "loc": [172, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L170_C8", "vector": [4, 3, 0.9454, 0.0164, 3, 0.34, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if features != None:\n features_l.append(features)\n pts_with_features.append(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L173_C16", "label": "append()", "type": "expression", "loc": [173, 173], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L172_C12", "vector": [8, 4, 0.9454, 0.0055, 4, 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": " features_l.append(features)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L174_C16", "label": "append()", "type": "expression", "loc": [174, 174], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L172_C12", "vector": [8, 4, 0.9508, 0.0055, 4, 0.44, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " pts_with_features.append(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L175_C12", "label": "if", "type": "if", "loc": [175, 176], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L170_C8", "vector": [4, 3, 0.959, 0.0109, 3, 0.34, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i % 500 == 0:\n rospy.loginfo(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L176_C16", "label": "loginfo()", "type": "expression", "loc": [176, 176], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L175_C12", "vector": [8, 4, 0.9617, 0.0055, 4, 0.99, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L178_C8", "label": "features_by_type = zip()", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4", "vector": [14, 2, 0.9727, 0.0055, 2, 0.49, 0.6667, 677, 3, 1, 0, 0, 814, 10, 1], "semantic": {"name": "features_by_type", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " features_by_type = zip(*features_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L179_C8", "label": "xs = row_stack()", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4", "vector": [14, 2, 0.9781, 0.0055, 2, 0.49, 0.7778, 928, 3, 1, 0, 0, 612, 10, 2], "semantic": {"name": "xs", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " xs = np.row_stack([np.column_stack(f) for f in features_by_type])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L180_C8", "label": "loginfo()", "type": "expression", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4", "vector": [8, 2, 0.9836, 0.0055, 2, 0.49, 0.8889, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Finished feature extraction.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99696:Return_L181_C8", "label": "return", "type": "return", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4", "vector": [13, 2, 0.9891, 0.0055, 2, 0.49, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return xs, sampled_pix2d[:, pts_with_features], sampled_pts3d_bl[:, pts_with_features]"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:While_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:While_L28_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L29_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:While_L28_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Return_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Return_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Return_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Return_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Return_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:ClassDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:ClassDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Return_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:ClassDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:ClassDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Return_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:ClassDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L142_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L142_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L150_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Return_L151_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L150_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L153_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L157_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L158_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L159_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Return_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:ClassDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L170_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L170_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L172_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L173_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L172_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L174_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:For_L170_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L175_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:If_L175_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L176_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Assign_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Expr_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99696:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99696:Return_L181_C8"}]
import csv import roslib; roslib.load_manifest('hai_sandbox') from cv_bridge.cv_bridge import CvBridge, CvBridgeError import rospy import cv import sys import hrl_lib.rutils as ru import hrl_lib.tf_utils as tfu import tf.transformations as tr import tf import hrl_camera.ros_camera as cam from sensor_msgs.msg import CameraInfo import numpy as np import hai_sandbox.features as fea import os.path as pt import hrl_lib.util as ut ## # @param bagname # @param topic # @return features_list list of tuples [(float time, (list surf_keypoints, list surf_descriptors))...] def find_image_features(bagname, topic): features_list = [] bridge = CvBridge() i = 0 for topic, msg, t in ru.bag_iter(bagname, [topic]): t = msg.header.stamp.to_time() image = bridge.imgmsg_to_cv(msg, 'bgr8') image_gray = fea.grayscale(image) surf_keypoints, surf_descriptors = fea.surf(image_gray) features_list.append((t, (surf_keypoints, surf_descriptors))) rospy.loginfo("%.3f frame %d found %d points" % (t, i, len(surf_keypoints))) i = i + 1 return features_list def csv_bag_names(fname): csv_file = open(fname) for bag_name in csv.reader(csv_file): yield bag_name csv_file.close() if __name__ == '__main__': forearm_cam_l = '/l_forearm_cam/image_rect_color' ws_l = '/wide_stereo/left/image_rect_color' ws_r = '/wide_stereo/right/image_rect_color' #features_list = find_image_features(sys.argv[1], forearm_cam_l) #Find all features in all videos that we have fname = sys.argv[1] for path_complete in csv_bag_names(fname): path_complete = path_complete[0] rospy.loginfo('processing %s'% path_complete) features_list = find_image_features(path_complete, forearm_cam_l) path_bag, name_bag = pt.split(path_complete) root_name, _ = pt.splitext(name_bag) surf_path_complete = pt.join(path_bag, root_name + '.surf_pkl') #pickle features list rospy.loginfo('saving feature extraction results to %s' % surf_path_complete) ut.save_pickle(features_list, surf_path_complete)
ajibawa-2023/Python-Code-Large/train/row_99697
49
75
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Import_L1_C0", "label": "csv import csv", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0133, 0.0133, 0, 0.66, 0.0, 312, 0, 1, 0, 0, 312, 0, 0], "semantic": {"name": "csv", "arg_names": [], "import_names": ["csv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import csv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0267, 0.0133, 0, 0.66, 0.0526, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Expr_L2_C15", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0267, 0.0133, 0, 0.66, 0.1053, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:ImportFrom_L3_C0", "label": "from cv_bridge.cv_bridge import CvBridge, CvBridgeError", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.04, 0.0133, 0, 0.66, 0.1579, 356, 0, 2, 0, 0, 356, 0, 0], "semantic": {"name": "cv_bridge.cv_bridge", "arg_names": [], "import_names": ["CvBridge", "CvBridgeError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from cv_bridge.cv_bridge import CvBridge, CvBridgeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0533, 0.0133, 0, 0.66, 0.2105, 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_99697:Import_L5_C0", "label": "cv import cv", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0133, 0, 0.66, 0.2632, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Import_L6_C0", "label": "sys import sys", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.08, 0.0133, 0, 0.66, 0.3158, 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_99697:Import_L8_C0", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1067, 0.0133, 0, 0.66, 0.3684, 847, 0, 1, 0, 0, 847, 0, 0], "semantic": {"name": "hrl_lib.rutils", "arg_names": [], "import_names": ["ru"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.rutils as ru"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Import_L9_C0", "label": "hrl_lib.tf_utils import tfu", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.12, 0.0133, 0, 0.66, 0.4211, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "hrl_lib.tf_utils", "arg_names": [], "import_names": ["tfu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.tf_utils as tfu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Import_L10_C0", "label": "tf.transformations import tr", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1333, 0.0133, 0, 0.66, 0.4737, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Import_L11_C0", "label": "tf import tf", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1467, 0.0133, 0, 0.66, 0.5263, 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_99697:Import_L12_C0", "label": "hrl_camera.ros_camera import cam", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.16, 0.0133, 0, 0.66, 0.5789, 798, 0, 1, 0, 0, 798, 0, 0], "semantic": {"name": "hrl_camera.ros_camera", "arg_names": [], "import_names": ["cam"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_camera.ros_camera as cam"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:ImportFrom_L13_C0", "label": "from sensor_msgs.msg import CameraInfo", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1733, 0.0133, 0, 0.66, 0.6316, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["CameraInfo"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import CameraInfo"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Import_L14_C0", "label": "numpy import np", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1867, 0.0133, 0, 0.66, 0.6842, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Import_L15_C0", "label": "hai_sandbox.features import fea", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.0133, 0, 0.66, 0.7368, 673, 0, 1, 0, 0, 673, 0, 0], "semantic": {"name": "hai_sandbox.features", "arg_names": [], "import_names": ["fea"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hai_sandbox.features as fea"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Import_L16_C0", "label": "os.path import pt", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.2133, 0.0133, 0, 0.66, 0.7895, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["pt"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os.path as pt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Import_L17_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.2267, 0.0133, 0, 0.66, 0.8421, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:FunctionDef_L24_C0", "label": "find_image_features", "type": "function", "loc": [24, 36], "level": 0, "parent": null, "vector": [2, 0, 0.4, 0.1733, 0, 0.66, 0.8947, 468, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "find_image_features", "arg_names": ["bagname", "topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def find_image_features(bagname, topic):\n features_list = []\n bridge = CvBridge()\n i = 0\n for topic, msg, t in ru.bag_iter(bagname, [topic]):\n t = msg.header.stamp.to_time()\n image = bridge.imgmsg_to_cv(msg, 'bgr8')\n image_gray = fea.grayscale(image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L25_C4", "label": "features_list =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:FunctionDef_L24_C0", "vector": [14, 1, 0.3333, 0.0133, 1, 0.59, 0.0, 485, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "features_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " features_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L26_C4", "label": "bridge = CvBridge()", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:FunctionDef_L24_C0", "vector": [14, 1, 0.3467, 0.0133, 1, 0.59, 0.25, 658, 3, 0, 0, 0, 439, 10, 1], "semantic": {"name": "bridge", "arg_names": [], "import_names": [], "rhs_call_name": "CvBridge", "annotation": ""}, "snippet": " bridge = CvBridge()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L27_C4", "label": "i =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:FunctionDef_L24_C0", "vector": [14, 1, 0.36, 0.0133, 1, 0.59, 0.5, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L28_C4", "label": "for topic, msg, t", "type": "for", "loc": [28, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:FunctionDef_L24_C0", "vector": [6, 1, 0.42, 0.1067, 1, 0.59, 0.75, 35, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "topic, msg, t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for topic, msg, t in ru.bag_iter(bagname, [topic]):\n t = msg.header.stamp.to_time()\n image = bridge.imgmsg_to_cv(msg, 'bgr8')\n image_gray = fea.grayscale(image)\n surf_keypoints, surf_descriptors = fea.surf(image_gray)\n features_list.append((t, (surf_keypoints, surf_descriptors)))\n rospy.loginfo(\"%.3f frame %d found %d points\" % (t, i, len(surf_keypoints)))\n i = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L29_C8", "label": "t = to_time()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L28_C4", "vector": [14, 2, 0.3867, 0.0133, 2, 0.24, 0.0, 15, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "to_time", "annotation": ""}, "snippet": " t = msg.header.stamp.to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L30_C8", "label": "image = imgmsg_to_cv()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L28_C4", "vector": [14, 2, 0.4, 0.0133, 2, 0.24, 0.1667, 505, 3, 2, 0, 0, 181, 10, 1], "semantic": {"name": "image", "arg_names": [], "import_names": [], "rhs_call_name": "imgmsg_to_cv", "annotation": ""}, "snippet": " image = bridge.imgmsg_to_cv(msg, 'bgr8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L31_C8", "label": "image_gray = grayscale()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L28_C4", "vector": [14, 2, 0.4133, 0.0133, 2, 0.24, 0.3333, 411, 3, 1, 0, 0, 530, 10, 1], "semantic": {"name": "image_gray", "arg_names": [], "import_names": [], "rhs_call_name": "grayscale", "annotation": ""}, "snippet": " image_gray = fea.grayscale(image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L32_C8", "label": "surf_keypoints, surf_descriptors = surf()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L28_C4", "vector": [14, 2, 0.4267, 0.0133, 2, 0.24, 0.5, 490, 3, 1, 0, 0, 181, 10, 1], "semantic": {"name": "surf_keypoints, surf_descriptors", "arg_names": [], "import_names": [], "rhs_call_name": "surf", "annotation": ""}, "snippet": " surf_keypoints, surf_descriptors = fea.surf(image_gray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Expr_L33_C8", "label": "append()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L28_C4", "vector": [8, 2, 0.44, 0.0133, 2, 0.24, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " features_list.append((t, (surf_keypoints, surf_descriptors)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Expr_L34_C8", "label": "loginfo()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L28_C4", "vector": [8, 2, 0.4533, 0.0133, 2, 0.24, 0.8333, 607, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"%.3f frame %d found %d points\" % (t, i, len(surf_keypoints)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L35_C8", "label": "i =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L28_C4", "vector": [14, 2, 0.4667, 0.0133, 2, 0.24, 1.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Return_L36_C4", "label": "return", "type": "return", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:FunctionDef_L24_C0", "vector": [13, 1, 0.48, 0.0133, 1, 0.59, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return features_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:FunctionDef_L38_C0", "label": "csv_bag_names", "type": "function", "loc": [38, 42], "level": 0, "parent": null, "vector": [2, 0, 0.5333, 0.0667, 0, 0.66, 0.9474, 898, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "csv_bag_names", "arg_names": ["fname"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def csv_bag_names(fname):\n csv_file = open(fname)\n for bag_name in csv.reader(csv_file):\n yield bag_name\n csv_file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L39_C4", "label": "csv_file = open()", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:FunctionDef_L38_C0", "vector": [14, 1, 0.52, 0.0133, 1, 0.66, 0.0, 661, 3, 1, 0, 0, 693, 10, 1], "semantic": {"name": "csv_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " csv_file = open(fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L40_C4", "label": "for bag_name", "type": "for", "loc": [40, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:FunctionDef_L38_C0", "vector": [6, 1, 0.54, 0.0267, 1, 0.66, 0.5, 985, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bag_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for bag_name in csv.reader(csv_file):\n yield bag_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Expr_L41_C8", "label": "expression", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L40_C4", "vector": [8, 2, 0.5467, 0.0133, 2, 0.4, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield bag_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Expr_L42_C4", "label": "close()", "type": "expression", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:FunctionDef_L38_C0", "vector": [8, 1, 0.56, 0.0133, 1, 0.66, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " csv_file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:If_L44_C0", "label": "if", "type": "if", "loc": [44, 63], "level": 0, "parent": null, "vector": [4, 0, 0.7133, 0.2667, 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 forearm_cam_l = '/l_forearm_cam/image_rect_color'\n ws_l = '/wide_stereo/left/image_rect_color'\n ws_r = '/wide_stereo/right/image_rect_color'\n\n #features_list = find_image_features(sys.argv[1], forearm_cam_l)\n #Find all features in all videos that we have\n fname = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L45_C4", "label": "forearm_cam_l =", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:If_L44_C0", "vector": [14, 1, 0.6, 0.0133, 1, 0.73, 0.0, 246, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "forearm_cam_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forearm_cam_l = '/l_forearm_cam/image_rect_color'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L46_C4", "label": "ws_l =", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:If_L44_C0", "vector": [14, 1, 0.6133, 0.0133, 1, 0.73, 0.25, 657, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ws_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ws_l = '/wide_stereo/left/image_rect_color'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L47_C4", "label": "ws_r =", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:If_L44_C0", "vector": [14, 1, 0.6267, 0.0133, 1, 0.73, 0.5, 524, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ws_r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ws_r = '/wide_stereo/right/image_rect_color'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L51_C4", "label": "fname =", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:If_L44_C0", "vector": [14, 1, 0.68, 0.0133, 1, 0.73, 0.75, 190, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fname = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L52_C4", "label": "for path_complete", "type": "for", "loc": [52, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:If_L44_C0", "vector": [6, 1, 0.7667, 0.16, 1, 0.73, 1.0, 98, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "path_complete", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for path_complete in csv_bag_names(fname):\n path_complete = path_complete[0]\n rospy.loginfo('processing %s'% path_complete)\n features_list = find_image_features(path_complete, forearm_cam_l)\n\n path_bag, name_bag = pt.split(path_complete)\n root_name, _ = pt.splitext(name_bag)\n surf_path_complete = pt.join(path_bag, root_name + '.surf_pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L53_C8", "label": "path_complete =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L52_C4", "vector": [14, 2, 0.7067, 0.0133, 2, 0.69, 0.0, 98, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "path_complete", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " path_complete = path_complete[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Expr_L54_C8", "label": "loginfo()", "type": "expression", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L52_C4", "vector": [8, 2, 0.72, 0.0133, 2, 0.69, 0.1429, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('processing %s'% path_complete)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L55_C8", "label": "features_list = find_image_features()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L52_C4", "vector": [14, 2, 0.7333, 0.0133, 2, 0.69, 0.2857, 485, 3, 2, 0, 0, 468, 10, 1], "semantic": {"name": "features_list", "arg_names": [], "import_names": [], "rhs_call_name": "find_image_features", "annotation": ""}, "snippet": " features_list = find_image_features(path_complete, forearm_cam_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L57_C8", "label": "path_bag, name_bag = split()", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L52_C4", "vector": [14, 2, 0.76, 0.0133, 2, 0.69, 0.4286, 666, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "path_bag, name_bag", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " path_bag, name_bag = pt.split(path_complete)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L58_C8", "label": "root_name, _ = splitext()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L52_C4", "vector": [14, 2, 0.7733, 0.0133, 2, 0.69, 0.5714, 746, 3, 1, 0, 0, 622, 10, 1], "semantic": {"name": "root_name, _", "arg_names": [], "import_names": [], "rhs_call_name": "splitext", "annotation": ""}, "snippet": " root_name, _ = pt.splitext(name_bag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L59_C8", "label": "surf_path_complete = join()", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L52_C4", "vector": [14, 2, 0.7867, 0.0133, 2, 0.69, 0.7143, 96, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "surf_path_complete", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " surf_path_complete = pt.join(path_bag, root_name + '.surf_pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Expr_L62_C8", "label": "loginfo()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L52_C4", "vector": [8, 2, 0.8267, 0.0133, 2, 0.69, 0.8571, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('saving feature extraction results to %s' % surf_path_complete)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99697:Expr_L63_C8", "label": "save_pickle()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L52_C4", "vector": [8, 2, 0.84, 0.0133, 2, 0.69, 1.0, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(features_list, surf_path_complete)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99697:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Return_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Expr_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99697:For_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99697:Expr_L63_C8"}]
import roslib; roslib.load_manifest('hai_sandbox') import rospy import sys import hrl_lib.util as ut import hrl_lib.rutils as ru import tf import hrl_lib.transforms as htf import hrl_lib.tf_utils as tfu import tf.transformations as tr import pr2_msgs.msg as pm import scipy.spatial as sp from multiprocessing import Process import time import os import numpy as np import math import cv import hai_sandbox.features as fea import hrl_pr2_lib.pr2_kinematics as pr2k import pdb import sensor_msgs.msg as sm import hrl_pr2_lib.devices as hpr2 #import perception3d.gaussian_curvature as gc def segment_msgs(time_segments, msgs): segs = [] for segment in time_segments: start = segment[0] endt = segment[1] sx = 0 ex = len(msgs) if start != 'start': for i, m in enumerate(msgs): if m.header.stamp.to_time() < start: sx = i else: break if endt != 'end': for i, m in enumerate(msgs[sx:]): if m.header.stamp.to_time() > endt: ex = i + sx break #pdb.set_trace() seg = msgs[sx:ex] segs.append(msgs[sx: ex]) return segs ## # Find times where contact has been made # # @return array of locations where contact has been made, array of times for each location where contact has been made (can be duplicated) def find_contact_times(left_mat, right_mat, times, thres): left_mat = left_mat - left_mat[:, 0] right_mat = right_mat - right_mat[:,0] #When/where did contact happen? #TODO: we are assuming just one finger of one arm here! #pdb.set_trace() loc_r, time_c = np.where(np.abs(left_mat) > thres) times_contact = times[time_c.A1] unique_times = np.array(np.sort(list(set(times_contact.tolist())))) #return (loc_r, times_contact) return unique_times def playback_bag(bag_name): cmd = 'rosbag play %s --clock' % bag_name print cmd os.system(cmd) class SimpleJointStateMsg: def __init__(self, header, transforms_dict): self.header = header self.transforms_dict = transforms_dict # Find contact points & transform gripper tip to base_frame class ExtractTFData: def __init__(self, listener=None):#, pointcloud_msg): rospy.Subscriber('/pressure/l_gripper_motor', pm.PressureState, self.lpress_cb) rospy.Subscriber('/joint_states', sm.JointState, self.joint_state_cb) self.ftip_frames = ['r_gripper_tool_frame', 'l_gripper_tool_frame'] if listener != None: self.tflistener = listener else: self.tflistener = tf.TransformListener() self.lmat0 = None self.rmat0 = None self.contact_locs = [] self.base_frame = '/base_footprint' self.contact = False self.contact_stopped = False self.pointcloud_transform = None self.jstate_msgs = [] self.last_jstate_time = time.time() + 999999999. def joint_state_cb(self, jmsg): tdict = {} # good for display purposes (independent of torso link etc) tdict['bf_T_rtip'] = tfu.transform('/base_footprint', self.ftip_frames[0], self.tflistener) tdict['bf_T_ltip'] = tfu.transform('/base_footprint', self.ftip_frames[1], self.tflistener) # want FK from torso tdict['torso_T_rtip'] = tfu.transform('/torso_lift_link', self.ftip_frames[0], self.tflistener) tdict['torso_T_ltip'] = tfu.transform('/torso_lift_link', self.ftip_frames[1], self.tflistener) #self.jstate_msgs.append(SimpleJointStateMsg(jmsg.header, tdict)) self.last_jstate_time = time.time() def lpress_cb(self, pmsg): lmat = np.matrix((pmsg.l_finger_tip)).T rmat = np.matrix((pmsg.r_finger_tip)).T if self.lmat0 == None: self.lmat0 = lmat self.rmat0 = rmat return #zero lmat = lmat - self.lmat0 rmat = rmat - self.rmat0 ## # extract data during contact events #touch detected if np.any(np.abs(lmat) > 250) or np.any(np.abs(rmat) > 250): #TODO: replace this with something more sound #Contact has been made!! look up gripper tip location def frame_loc(from_frame): p_base = tfu.transform(self.base_frame, from_frame, self.tflistener) \ * tfu.tf_as_matrix(([0., 0., 0., 1.], tr.quaternion_from_euler(0,0,0))) return tfu.matrix_as_tf(p_base) tip_locs = [frame_loc(n)[0] for n in self.ftip_frames] t = pmsg.header.stamp.to_time() rospy.loginfo("contact detected at %.3f" % t) self.contact_locs.append([t, tip_locs]) self.contact = True else: if self.contact == True: rospy.loginfo('contact stopped') self.contact_stopped = True self.contact = False #Only get this transform after we've stopped making contact. #self.pointcloud_transform = tfu.transform(self.base_frame, self.pointcloud_msg.header.frame_id, self.tflistener) class JointMsgConverter: def __init__(self): self.name_dict = None self.joint_groups = ut.load_pickle('link_names.pkl') #self.joint_groups['rarm'] = rospy.get_param('/r_arm_controller/joints') #self.joint_groups['larm'] = rospy.get_param('/l_arm_controller/joints') #self.joint_groups['head_traj'] = rospy.get_param('/head_traj_controller/joints') #self.joint_groups['torso'] = rospy.get_param('/torso_controller/joints') def msgs_to_dict(self, msgs): converted = [] for i in range(len(msgs)): msg = msgs[i] if self.name_dict == None: self.name_dict = {} for i, n in enumerate(msg.name): self.name_dict[n] = i self.joint_idx = {} for group in self.joint_groups.keys(): self.joint_idx[group] = [self.name_dict[name] for name in self.joint_groups[group]] joint_poses = {} joint_vel = {} joint_eff = {} #extract data for pose, vel, eff for d, data in zip([joint_poses, joint_vel, joint_eff], [msg.position, msg.velocity, msg.effort]): #look up values for each joint group dmat = np.matrix(data).T for group in self.joint_groups.keys(): d[group] = dmat[self.joint_idx[group], 0] converted.append({'poses': joint_poses, 'vels': joint_vel, 'efforts': joint_eff, 'time': msg.header.stamp.to_time()}) #Take out wrapping of forearm & wrist for group in ['rarm', 'larm']: for i in range(len(self.joint_groups[group])): joint = self.joint_groups[group][i] if 'forearm_roll' in joint or 'wrist_roll' in joint: delta = msgs[1].position[i] - msgs[0].position[i] realdelta = delta % (2 * math.pi) if realdelta >= math.pi: realdelta -= 2 * math.pi correction = delta - realdelta for j in range(1, len(msgs)): converted[j]['poses'][group][i,0] -= correction #msgs[j].positions[i] -= correction return converted ## # @param surf_locs list of ((x,y), lap, size, dir, hess) # @param point_cloud_3d 3xn matrix # @param point_cloud_2d 2xn matrix def assign_3d_to_surf(surf_locs, point_cloud_3d, point_cloud_2d): point_cloud_2d_tree = sp.KDTree(np.array(point_cloud_2d.T)) #print '>> shape of point_cloud_3d', point_cloud_3d.shape surf_loc3d = [] for s in surf_locs: loc = s[0] idx = point_cloud_2d_tree.query(np.array(loc))[1] surf_loc3d.append(point_cloud_3d[:, idx]) #print ' %s matched to %s 3d %s' % (str(loc), str(point_cloud_2d[:,idx].T), str(point_cloud_3d[:, idx].T)) surf_loc3d = np.column_stack(surf_loc3d) return surf_loc3d def find_contacts_and_fk(tflistener, arm): find_contact_locs = ExtractTFData(tflistener) while not rospy.is_shutdown() \ and (not find_contact_locs.contact_stopped) \ and ((time.time() - find_contact_locs.last_jstate_time) < 1.): print 'waiting for ExtractTFData to finish.' time.sleep(.5) print 'got %d joint state messages' % len(find_contact_locs.jstate_msgs) contact_locs = find_contact_locs.contact_locs if arm == 'right': contact_tips = [np.matrix(r[1][0]).T for r in contact_locs] else: contact_tips = [np.matrix(r[1][1]).T for r in contact_locs] contact_tips = np.column_stack(contact_tips) return contact_tips[:,0], find_contact_locs.jstate_msgs def project_2d_bounded(cam_info, point_cloud_cam): point_cloud_2d_cam = cam_info.project(point_cloud_cam) # only count points in image bounds (should be in cam info) _, in_bounds = np.where(np.invert((point_cloud_2d_cam[0,:] >= (cam_info.w-.6)) + (point_cloud_2d_cam[0,:] < 0) \ + (point_cloud_2d_cam[1,:] >= (cam_info.h-.6)) + (point_cloud_2d_cam[1,:] < 0))) point_cloud_2d_cam = point_cloud_2d_cam[:, in_bounds.A1] point_cloud_reduced_cam = point_cloud_cam[:, in_bounds.A1] return point_cloud_2d_cam, point_cloud_reduced_cam def find3d_surf(start_conditions): ## Project pointcloud into 2d point_cloud_bf = ru.pointcloud_to_np(start_conditions['points']) # from base_frame to prosilica frame point_cloud_pro = tfu.transform_points(start_conditions['pro_T_bf'], point_cloud_bf) point_cloud_2d_pro, point_cloud_reduced_pro = project_2d_bounded(start_conditions['camera_info'], point_cloud_pro) #point_cloud_2d_pro = .project(point_cloud_pro) ## only count points in image bounds (should be in cam info) #cam_info = start_conditions['camera_info'] #_, in_bounds = np.where(np.invert((point_cloud_2d_pro[0,:] >= (cam_info.w-.6)) + (point_cloud_2d_pro[0,:] < 0) \ # + (point_cloud_2d_pro[1,:] >= (cam_info.h-.6)) + (point_cloud_2d_pro[1,:] < 0))) #point_cloud_2d_pro = point_cloud_2d_pro[:, in_bounds.A1] #point_cloud_reduced_pro = point_cloud_pro[:, in_bounds.A1] ## Find 3D SURF features model_file_name = start_conditions['model_image'] model_surf_loc, model_surf_descriptors = fea.surf_color(cv.LoadImage(model_file_name)) surf_loc3d_pro = np.matrix(assign_3d_to_surf(model_surf_loc, point_cloud_reduced_pro, point_cloud_2d_pro)) return model_surf_loc, model_surf_descriptors, surf_loc3d_pro, point_cloud_2d_pro ########################################################################## # TODO: need some parameters for processing 'model_image', maybe circles # of different sizes. def extract_object_localization_features2(start_conditions, tflistener, arm_used, p_base_map): mid_contact_bf, jstate_msgs = find_contacts_and_fk(tflistener, arm_used) model_surf_loc, model_surf_descriptors, surf_loc3d_pro, point_cloud_2d_pro = find3d_surf(start_conditions) #Find frame surf_loc3d_bf = (np.linalg.inv(start_conditions['pro_T_bf']) \ * np.row_stack((surf_loc3d_pro, 1+np.zeros((1,surf_loc3d_pro.shape[1])))))[0:3,:] frame_bf = create_frame(surf_loc3d_bf, p=np.matrix([-1, 0, 0.]).T) center_bf = np.mean(surf_loc3d_bf, 1) #Find out what the SURF features point to in this new frame bf_R_pro = (start_conditions['pro_T_bf'][0:3, 0:3]).T bf_R_obj = frame_bf x_bf = frame_bf[:,0] x_pro = bf_R_pro.T * x_bf x_ang_pro = math.atan2(x_pro[1,0], x_pro[0,0]) center_pro = tfu.transform_points(start_conditions['pro_T_bf'], center_bf) center2d_pro = start_conditions['camera_info'].project(center_pro) surf_directions = [] surf_dir_center = [] for loc, lap, size, direction, hess in model_surf_loc: surf_directions.append(ut.standard_rad(np.radians(direction) - x_ang_pro)) direction_to_center = center2d_pro - np.matrix(loc).T surf_dir_center.append(direction_to_center) surf_dir_center = np.column_stack(surf_dir_center) return { 'contact_bf': mid_contact_bf, 'surf_loc3d_pro': surf_loc3d_pro, 'surf_loc2d_pro': model_surf_loc, 'point_cloud_2d_pro': point_cloud_2d_pro, 'surf_directions': surf_directions, #Orientation 'surf_pose_dir2d': surf_dir_center, #Position 'descriptors': model_surf_descriptors, 'jtransforms': jstate_msgs, 'frame_bf': frame_bf, 'center_bf': center_bf } ########################################################################## # TODO: need some parameters for processing 'model_image', maybe circles # of different sizes. def extract_object_localization_features(start_conditions, tflistener): ## Find contacts find_contact_locs = ExtractTFData(tflistener) r = rospy.Rate(10) while not rospy.is_shutdown() and not find_contact_locs.contact_stopped: r.sleep() contact_locs = find_contact_locs.contact_locs ## Detect features, get 3d location for each feature model_file_name = start_conditions['model_image'] model_surf_loc, model_surf_descriptors = fea.surf_color(cv.LoadImage(model_file_name)) ## Assign 3d location to surf features point_cloud_bf = ru.pointcloud_to_np(start_conditions['points']) point_cloud_pro = start_conditions['pro_T_bf'] * np.row_stack((point_cloud_bf, 1+np.zeros((1, point_cloud_bf.shape[1])))) point_cloud_2d_pro = start_conditions['camera_info'].project(point_cloud_pro[0:3,:]) surf_loc3d_arr_bf = np.array(assign_3d_to_surf(model_surf_loc, point_cloud_bf, point_cloud_2d_pro)) surf_loc_tree_bf = sp.KDTree(surf_loc3d_arr_bf.T) ################################################# # not needed right now but can be useful later.. ################################################# # Get SURF features closest to contact locs left_contact, right_contact = zip(*[(np.matrix(r[1][2]).T, np.matrix(r[1][3]).T) for r in contact_locs]) left_contact = np.column_stack(left_contact) right_contact = np.column_stack(right_contact) mid_contact_bf = (left_contact[:,0] + right_contact[:,0]) / 2. #data_dict['pro_T_bf'] * np.row_stack((mid_contact_bf, np surf_closest_idx = surf_loc_tree_bf.query(np.array(mid_contact_bf.T))[1] #Get surf feature at mid point surf_closest3d = surf_loc3d_arr_bf[:, surf_closest_idx] surf_closest_fea = model_surf_loc[surf_closest_idx] #Create a frame for this group of features surf_loc_3d_pro = (start_conditions['pro_T_bf'] * np.row_stack([surf_loc3d_arr_bf, 1 + np.zeros((1, surf_loc3d_arr_bf.shape[1]))]))[0:3,:] object_frame_pro = create_frame(np.matrix(surf_loc_3d_pro)) #Find out what the SURF features point to in this new frame surf_directions = [] for loc, lap, size, direction, hess in model_surf_loc: drad = np.radians(direction) #project direction into the cannonical object frame surf_dir_obj = object_frame_pro * np.matrix([np.cos(drad), np.sin(drad), 0.]).T #measure angle between SURF feature and x axis of object frame, store this as delta theta delta_theta = math.atan2(surf_dir_obj[1,0], surf_dir_obj[0,0]) surf_directions.append(delta_theta) return { 'descriptors': model_surf_descriptors, 'directions': surf_directions, 'contact_bf': mid_contact_bf, 'closest_feature': surf_closest_fea[0], #'object_frame_bf': [np.mean(np.matrix(surf_loc3d_arr_bf), 1), create_frame(surf_loc3d_arr_bf)], 'object_frame_pro': [np.mean(np.matrix(surf_loc_3d_pro), 1), object_frame_pro, surf_loc_3d_pro] } #surf_dir_obj => obj_dir #project all points ontocz #draw this surf feature in image #proc_surfed = fea.draw_surf(proc_img, model_surf_loc, (200, 0, 0)) #proc_surfed = fea.draw_surf(proc_surfed, [surf_closest_fea], (0,0,255)) ######################################################### # Pose estimation # # for each SURF direction, subtract delta_theta from it to get a vote for the direction of the object frame's # x axis # # average all the predictions to get object's x direction def create_frame(points3d, p=np.matrix([-1,0,0.]).T): #pdb.set_trace() u, s, vh = np.linalg.svd(np.cov(points3d)) u = np.matrix(u) # Pick normal if (u[:,2].T * p)[0,0] < 0: normal = -u[:,2] else: normal = u[:,2] # pick the next direction as the one closest to to +z or +x z_plus = np.matrix([0, 0, 1.0]).T x_plus = np.matrix([1, 0, 0.0]).T u0 = u[:,0] u1 = u[:,1] mags = [] pos_dirs = [] for udir in [u0, u1, -u0, -u1]: for can_dir in [z_plus, x_plus]: mags.append((udir.T * can_dir)[0,0]) pos_dirs.append(udir) x_dir = pos_dirs[np.argmax(mags)] # Cross product for the final (is this the same as the final vector?) y_dir = np.cross(normal.T, x_dir.T).T return np.matrix(np.column_stack([x_dir, y_dir, normal])) def process_bag(full_bag_name, prosilica_image_file, model_image_file, experiment_start_condition_pkl, arm_used='left'): bag_path, bag_name_ext = os.path.split(full_bag_name) filename, ext = os.path.splitext(bag_name_ext) ############################################################################### # Playback the bag bag_playback = Process(target=playback_bag, args=(full_bag_name,)) bag_playback.start() ############################################################################### ## Listen for transforms using rosbag rospy.init_node('bag_proceessor') tl = tf.TransformListener() print 'waiting for transform' tl.waitForTransform('map', 'base_footprint', rospy.Time(), rospy.Duration(20)) # Extract the starting location map_T_bf p_base = tfu.transform('map', 'base_footprint', tl) \ * tfu.tf_as_matrix(([0., 0., 0., 1.], tr.quaternion_from_euler(0,0,0))) t, r = tfu.matrix_as_tf(p_base) pose_base = (t, r) print 'done with tf' ########################################################## ## Find contact locations start_conditions = ut.load_pickle(experiment_start_condition_pkl) start_conditions['highdef_image'] = prosilica_image_file start_conditions['model_image'] = model_image_file rospy.loginfo('extracting object localization features') start_conditions['pose_parameters'] = extract_object_localization_features2(start_conditions, tl, arm_used, p_base) if bag_playback.is_alive(): rospy.loginfo('Terminating playback process') bag_playback.terminate() time.sleep(1) bag_playback.terminate() time.sleep(1) rospy.loginfo('Playback process terminated? %s' % str(not bag_playback.is_alive())) ############################################################################### #Read bag using programmatic API pr2_kinematics = pr2k.PR2Kinematics(tl) converter = JointMsgConverter() rospy.loginfo('opening bag, reading state topics') topics_dict = ru.bag_sel(full_bag_name, ['/joint_states', '/l_cart/command_pose', '/r_cart/command_pose', '/torso_controller/state', '/pressure/l_gripper_motor', '/pressure/r_gripper_motor']) ## Select the arm that has been moving, segment joint states based on contact states. if arm_used == 'left': pressures = topics_dict['/pressure/l_gripper_motor'] elif arm_used == 'right': pressures = topics_dict['/pressure/r_gripper_motor'] else: raise RuntimeError('arm_used invalid') ## find contact times rospy.loginfo('Finding contact times') left_f, right_f, ptimes = hpr2.pressure_state_to_mat(pressures['msg']) ## create segments based on contacts # TODO: make this accept more contact stages contact_times = find_contact_times(left_f, right_f, ptimes, 250) if len(contact_times) > 2: time_segments = [['start', contact_times[0]], [contact_times[0], contact_times[-1]], [contact_times[-1], 'end']] else: time_segments = [['start', 'end']] rospy.loginfo('Splitting messages based on contact times') ## split pressure readings based on contact times pressure_lseg = segment_msgs(time_segments, topics_dict['/pressure/l_gripper_motor']['msg']) pressure_rseg = segment_msgs(time_segments, topics_dict['/pressure/r_gripper_motor']['msg']) ## split cartesian commands based on contact times lcart_seg = segment_msgs(time_segments, topics_dict['/l_cart/command_pose']['msg']) rcart_seg = segment_msgs(time_segments, topics_dict['/r_cart/command_pose']['msg']) ## split joint states joint_states = topics_dict['/joint_states']['msg'] print 'there are %d joint state messages in bag' % len(joint_states) j_segs = segment_msgs(time_segments, topics_dict['/joint_states']['msg']) jseg_dicts = [converter.msgs_to_dict(seg) for seg in j_segs] # find the first set of joint states j0_dict = jseg_dicts[0][0] ## perform FK rospy.loginfo('Performing FK to find tip locations') bf_T_obj = htf.composeHomogeneousTransform(start_conditions['pose_parameters']['frame_bf'], start_conditions['pose_parameters']['center_bf']) obj_T_bf = np.linalg.inv(bf_T_obj) for jseg_dict in jseg_dicts: for d in jseg_dict: rtip_bf = pr2_kinematics.right.fk('base_footprint', 'r_wrist_roll_link', 'r_gripper_tool_frame', d['poses']['rarm'].A1.tolist()) ltip_bf = pr2_kinematics.left.fk('base_footprint', 'l_wrist_roll_link', 'l_gripper_tool_frame', d['poses']['larm'].A1.tolist()) rtip_obj = obj_T_bf * rtip_bf ltip_obj = obj_T_bf * ltip_bf d['rtip_obj'] = tfu.matrix_as_tf(rtip_obj) d['ltip_obj'] = tfu.matrix_as_tf(ltip_obj) d['rtip_bf'] = tfu.matrix_as_tf(rtip_bf) d['ltip_bf'] = tfu.matrix_as_tf(ltip_bf) ############################################################################### # make movement state dictionaries, one for each state movement_states = [] for i, seg in enumerate(time_segments): name = "state_%d" % i start_times = [lcart_seg[i][0].header.stamp.to_time(), rcart_seg[i][0].header.stamp.to_time(), jseg_dicts[i][0]['time'], pressure_lseg[i][0].header.stamp.to_time(), pressure_rseg[i][0].header.stamp.to_time()] sdict = {'name': name, 'start_time': np.min(start_times), 'cartesian': [[ru.ros_to_dict(ps) for ps in lcart_seg[i]], [ru.ros_to_dict(ps) for ps in rcart_seg[i]]], 'joint_states': jseg_dicts[i] #'pressure': [pressure_lseg[i], pressure_rseg[i]] } movement_states.append(sdict) # store in a dict data = {'start_conditions': start_conditions, # ['camera_info', 'map_T_bf', 'pro_T_bf', 'points' (in base_frame), # 'highdef_image', 'model_image', ## 'pose_parameters' ## 'descriptors' ## 'directions' (wrt to cannonical orientation) ## 'closest_feature' 'base_pose': pose_base, 'robot_pose': j0_dict, 'arm': arm_used, 'movement_states': movement_states} # save dicts to pickles processed_bag_name = '%s_processed.pkl' % os.path.join(bag_path, filename) rospy.loginfo('saving to %s' % processed_bag_name) ut.save_pickle(data, processed_bag_name) bag_playback.join() rospy.loginfo('finished!') #python bag_processor.py 08_06/light/off/_2010-08-06-13-35-04.bag 08_06/light/off/off_start.png light_switch_model.png 08_06/light/off/off_start.pkl if __name__ == '__main__': arm_used = 'left' full_bag_name = sys.argv[1] prosilica_image_file = sys.argv[2] model_image_file = sys.argv[3] experiment_start_condition_pkl = sys.argv[4] process_bag(full_bag_name, prosilica_image_file, model_image_file, experiment_start_condition_pkl) #def create_frame2(contact_point, points3d, p=np.matrix([1,0,0.]).T): ### contact point is the center, local plane from 3D points close to contact # u, s, vh = np.linalg.svd(points3d) # u = np.matrix(u) # #pdb.set_trace() # # # Pick normal # if (u[:,2].T * p)[0,0] < 0: # normal = -u[:,2] # else: # normal = u[:,2] # # # pick the next direction as the one closest to to +z or +x # z_plus = np.matrix([0,0,1.0]).T # x_plus = np.matrix([1,0,0.0]).T # # u0 = u[:,0] # u1 = u[:,1] # # mags = [] # pos_dirs = [] # for udir in [u0, u1, -u0, -u1]: # for can_dir in [z_plus, x_plus]: # mags.append((udir.T * can_dir)[0,0]) # pos_dirs.append(udir) # x_dir = pos_dirs[np.argmax(mags)] # # # Cross product for the final (is this the same as the final vector?) # y_dir = np.cross(normal.T, x_dir.T).T # return np.column_stack([x_dir, y_dir, normal]) #for loc, lap, size, direction, hess in model_surf_loc: # drad = np.radians(direction) # #project direction into the cannonical object frame # #surf_dir_obj = object_frame_pro * np.matrix([np.cos(drad), np.sin(drad), 0.]).T # #obj_R_bf = frame_bf.T # bf_R_pro = (start_conditions['pro_T_bf'][0:3,0:3]).T # surf_dir_obj = frame_bf.T * bf_R_pro * np.matrix([np.cos(drad), np.sin(drad), 0.]).T # #measure angle between SURF feature and x axis of object frame, store this as delta theta # delta_theta = math.atan2(surf_dir_obj[1,0], surf_dir_obj[0,0]) # surf_directions.append(delta_theta) ##print 'frame_bf.T', frame_bf.T ##print 'bf_R_pro', (start_conditions['pro_T_bf'][0:3,0:3]).T #r = rospy.Rate(10) #while not rospy.is_shutdown() and not find_contact_locs.contact_stopped: # r.sleep() #contact_locs = find_contact_locs.contact_locs #et = ExtractTFData() # ['camera_info', 'map_T_bf', 'pro_T_bf', 'points'] #print 'got loc %.2f %.2f %.2f'% (t[0], t[1], t[2]) #loc_fname = '%s_loc.pkl' % os.path.join(bag_path, filename) #print 'saving to %s' % loc_fname #ut.save_pickle((t,r), loc_fname) #print contact_times - contact_times[0] #print contact_times[1:] - contact_times[:-1] #pb.plot(contact_times-contact_times[0], 'g.') #pb.show() # pose_base = [t, r], t is len3, r is len4 # j0_dict {'poses': joint_poses, 'vels': joint_vel, 'efforts': joint_eff, 'time': msg.header.stamp.to_time()} # with each entry having keys: ['rarm'] ['larm'] ['head_traj'] ['torso'] # arm is a string {'left', 'right'} # movement_states # 'name' # 'start_time' # 'cartesian' # 'joint_states' # 'pressure' #'movement_states': [{'name': #, # 'cartesian':#, # 'joint_states': # j_dicts, j_times # 'pressure': #, # }] # #} ##ut.save_pickle(data, extracted_name) #if len(joint_states) <= 1: # raise RuntimeError('Not enough joint state messages. Got %d messages.' % len(joint_states)) #joint_states)
ajibawa-2023/Python-Code-Large/train/row_99698
320
797
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0013, 0.0013, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0013, 0.0013, 0, 0.66, 0.027, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0025, 0.0013, 0, 0.66, 0.0541, 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_99698:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0038, 0.0013, 0, 0.66, 0.0811, 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_99698:Import_L4_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.005, 0.0013, 0, 0.66, 0.1081, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Import_L5_C0", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0063, 0.0013, 0, 0.66, 0.1351, 847, 0, 1, 0, 0, 847, 0, 0], "semantic": {"name": "hrl_lib.rutils", "arg_names": [], "import_names": ["ru"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.rutils as ru"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Import_L7_C0", "label": "tf import tf", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0088, 0.0013, 0, 0.66, 0.1622, 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_99698:Import_L8_C0", "label": "hrl_lib.transforms import htf", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.01, 0.0013, 0, 0.66, 0.1892, 82, 0, 1, 0, 0, 82, 0, 0], "semantic": {"name": "hrl_lib.transforms", "arg_names": [], "import_names": ["htf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.transforms as htf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Import_L9_C0", "label": "hrl_lib.tf_utils import tfu", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0113, 0.0013, 0, 0.66, 0.2162, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "hrl_lib.tf_utils", "arg_names": [], "import_names": ["tfu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.tf_utils as tfu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Import_L10_C0", "label": "tf.transformations import tr", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0125, 0.0013, 0, 0.66, 0.2432, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Import_L11_C0", "label": "pr2_msgs.msg import pm", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0138, 0.0013, 0, 0.66, 0.2703, 797, 0, 1, 0, 0, 797, 0, 0], "semantic": {"name": "pr2_msgs.msg", "arg_names": [], "import_names": ["pm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pr2_msgs.msg as pm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Import_L13_C0", "label": "scipy.spatial import sp", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0163, 0.0013, 0, 0.66, 0.2973, 384, 0, 1, 0, 0, 384, 0, 0], "semantic": {"name": "scipy.spatial", "arg_names": [], "import_names": ["sp"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.spatial as sp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:ImportFrom_L14_C0", "label": "from multiprocessing import Process", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0176, 0.0013, 0, 0.66, 0.3243, 901, 0, 1, 0, 0, 901, 0, 0], "semantic": {"name": "multiprocessing", "arg_names": [], "import_names": ["Process"], "rhs_call_name": "", "annotation": ""}, "snippet": "from multiprocessing import Process"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Import_L15_C0", "label": "time import time", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0188, 0.0013, 0, 0.66, 0.3514, 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_99698:Import_L16_C0", "label": "os import os", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0201, 0.0013, 0, 0.66, 0.3784, 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_99698:Import_L17_C0", "label": "numpy import np", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0213, 0.0013, 0, 0.66, 0.4054, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Import_L18_C0", "label": "math import math", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0226, 0.0013, 0, 0.66, 0.4324, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Import_L19_C0", "label": "cv import cv", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0238, 0.0013, 0, 0.66, 0.4595, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Import_L20_C0", "label": "hai_sandbox.features import fea", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0251, 0.0013, 0, 0.66, 0.4865, 673, 0, 1, 0, 0, 673, 0, 0], "semantic": {"name": "hai_sandbox.features", "arg_names": [], "import_names": ["fea"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hai_sandbox.features as fea"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Import_L21_C0", "label": "hrl_pr2_lib.pr2_kinematics import pr2k", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0013, 0, 0.66, 0.5135, 728, 0, 1, 0, 0, 728, 0, 0], "semantic": {"name": "hrl_pr2_lib.pr2_kinematics", "arg_names": [], "import_names": ["pr2k"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_pr2_lib.pr2_kinematics as pr2k"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Import_L22_C0", "label": "pdb import pdb", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0276, 0.0013, 0, 0.66, 0.5405, 91, 0, 1, 0, 0, 91, 0, 0], "semantic": {"name": "pdb", "arg_names": [], "import_names": ["pdb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pdb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Import_L23_C0", "label": "sensor_msgs.msg import sm", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.0289, 0.0013, 0, 0.66, 0.5676, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["sm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sensor_msgs.msg as sm "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Import_L24_C0", "label": "hrl_pr2_lib.devices import hpr2", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0301, 0.0013, 0, 0.66, 0.5946, 854, 0, 1, 0, 0, 854, 0, 0], "semantic": {"name": "hrl_pr2_lib.devices", "arg_names": [], "import_names": ["hpr2"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_pr2_lib.devices as hpr2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L28_C0", "label": "segment_msgs", "type": "function", "loc": [28, 52], "level": 0, "parent": null, "vector": [2, 0, 0.0502, 0.0314, 0, 0.66, 0.6216, 465, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "segment_msgs", "arg_names": ["time_segments", "msgs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def segment_msgs(time_segments, msgs):\n segs = []\n for segment in time_segments:\n start = segment[0]\n endt = segment[1]\n sx = 0\n ex = len(msgs)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L29_C4", "label": "segs =", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L28_C0", "vector": [14, 1, 0.0364, 0.0013, 1, 0.09, 0.0, 69, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "segs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " segs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L30_C4", "label": "for segment", "type": "for", "loc": [30, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L28_C0", "vector": [6, 1, 0.0508, 0.0276, 1, 0.09, 0.5, 100, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "segment", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for segment in time_segments:\n start = segment[0]\n endt = segment[1]\n sx = 0\n ex = len(msgs)\n\n if start != 'start':\n for i, m in enumerate(msgs):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L31_C8", "label": "start =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L30_C4", "vector": [14, 2, 0.0389, 0.0013, 2, 0.88, 0.0, 511, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start = segment[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L32_C8", "label": "endt =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L30_C4", "vector": [14, 2, 0.0402, 0.0013, 2, 0.88, 0.1429, 857, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "endt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " endt = segment[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L33_C8", "label": "sx =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L30_C4", "vector": [14, 2, 0.0414, 0.0013, 2, 0.88, 0.2857, 533, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "sx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sx = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L34_C8", "label": "ex = len()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L30_C4", "vector": [14, 2, 0.0427, 0.0013, 2, 0.88, 0.4286, 212, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "ex", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " ex = len(msgs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L36_C8", "label": "if", "type": "if", "loc": [36, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L30_C4", "vector": [4, 2, 0.0483, 0.0075, 2, 0.88, 0.5714, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if start != 'start':\n for i, m in enumerate(msgs):\n if m.header.stamp.to_time() < start:\n sx = i\n else:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L37_C12", "label": "for i, m", "type": "for", "loc": [37, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L36_C8", "vector": [6, 3, 0.0489, 0.0063, 3, 0.23, 0.0, 489, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i, m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, m in enumerate(msgs):\n if m.header.stamp.to_time() < start:\n sx = i\n else:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L38_C16", "label": "if", "type": "if", "loc": [38, 41], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L37_C12", "vector": [4, 4, 0.0496, 0.005, 4, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if m.header.stamp.to_time() < start:\n sx = i\n else:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L39_C20", "label": "sx =", "type": "assigned_variable", "loc": [39, 39], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L38_C16", "vector": [14, 5, 0.0489, 0.0013, 5, 0.14, 0.0, 533, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sx = i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L43_C8", "label": "if", "type": "if", "loc": [43, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L30_C4", "vector": [4, 2, 0.0565, 0.0063, 2, 0.88, 0.7143, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if endt != 'end':\n for i, m in enumerate(msgs[sx:]):\n if m.header.stamp.to_time() > endt:\n ex = i + sx\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L44_C12", "label": "for i, m", "type": "for", "loc": [44, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L43_C8", "vector": [6, 3, 0.0571, 0.005, 3, 0.73, 0.0, 489, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i, m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, m in enumerate(msgs[sx:]):\n if m.header.stamp.to_time() > endt:\n ex = i + sx\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L45_C16", "label": "if", "type": "if", "loc": [45, 47], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L44_C12", "vector": [4, 4, 0.0577, 0.0038, 4, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if m.header.stamp.to_time() > endt:\n ex = i + sx\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L46_C20", "label": "ex =", "type": "assigned_variable", "loc": [46, 46], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L45_C16", "vector": [14, 5, 0.0577, 0.0013, 5, 0.77, 0.0, 212, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ex", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ex = i + sx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L50_C8", "label": "seg =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L30_C4", "vector": [14, 2, 0.0627, 0.0013, 2, 0.88, 0.8571, 921, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "seg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " seg = msgs[sx:ex]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L51_C8", "label": "append()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L30_C4", "vector": [8, 2, 0.064, 0.0013, 2, 0.88, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " segs.append(msgs[sx: ex])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L52_C4", "label": "return", "type": "return", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L28_C0", "vector": [13, 1, 0.0652, 0.0013, 1, 0.09, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return segs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L58_C0", "label": "find_contact_times", "type": "function", "loc": [58, 70], "level": 0, "parent": null, "vector": [2, 0, 0.0803, 0.0163, 0, 0.66, 0.6486, 852, 0, 4, 1, 0, 0, 0, 7], "semantic": {"name": "find_contact_times", "arg_names": ["left_mat", "right_mat", "times", "thres"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def find_contact_times(left_mat, right_mat, times, thres):\n left_mat = left_mat - left_mat[:, 0] \n right_mat = right_mat - right_mat[:,0]\n \n #When/where did contact happen? \n #TODO: we are assuming just one finger of one arm here!\n #pdb.set_trace()\n loc_r, time_c = np.where(np.abs(left_mat) > thres)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L59_C4", "label": "left_mat =", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L58_C0", "vector": [14, 1, 0.074, 0.0013, 1, 0.5, 0.0, 524, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "left_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left_mat = left_mat - left_mat[:, 0] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L60_C4", "label": "right_mat =", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L58_C0", "vector": [14, 1, 0.0753, 0.0013, 1, 0.5, 0.2, 957, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "right_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " right_mat = right_mat - right_mat[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L65_C4", "label": "loc_r, time_c = where()", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L58_C0", "vector": [14, 1, 0.0816, 0.0013, 1, 0.5, 0.4, 412, 3, 1, 0, 0, 169, 10, 2], "semantic": {"name": "loc_r, time_c", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " loc_r, time_c = np.where(np.abs(left_mat) > thres)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L66_C4", "label": "times_contact =", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L58_C0", "vector": [14, 1, 0.0828, 0.0013, 1, 0.5, 0.6, 266, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "times_contact", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " times_contact = times[time_c.A1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L67_C4", "label": "unique_times = array()", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L58_C0", "vector": [14, 1, 0.0841, 0.0013, 1, 0.5, 0.8, 767, 3, 1, 0, 0, 80, 10, 5], "semantic": {"name": "unique_times", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " unique_times = np.array(np.sort(list(set(times_contact.tolist()))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L70_C4", "label": "return", "type": "return", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L58_C0", "vector": [13, 1, 0.0878, 0.0013, 1, 0.5, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return unique_times"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L72_C0", "label": "playback_bag", "type": "function", "loc": [72, 75], "level": 0, "parent": null, "vector": [2, 0, 0.0922, 0.005, 0, 0.66, 0.6757, 820, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "playback_bag", "arg_names": ["bag_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def playback_bag(bag_name):\n cmd = 'rosbag play %s --clock' % bag_name\n print(cmd)\n os.system(cmd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L73_C4", "label": "cmd =", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L72_C0", "vector": [14, 1, 0.0916, 0.0013, 1, 0.26, 0.0, 604, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cmd = 'rosbag play %s --clock' % bag_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L74_C4", "label": "print()", "type": "expression", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L72_C0", "vector": [8, 1, 0.0928, 0.0013, 1, 0.26, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(cmd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L75_C4", "label": "system()", "type": "expression", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L72_C0", "vector": [8, 1, 0.0941, 0.0013, 1, 0.26, 1.0, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " os.system(cmd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:ClassDef_L77_C0", "label": "SimpleJointStateMsg", "type": "class", "loc": [77, 80], "level": 0, "parent": null, "vector": [3, 0, 0.0985, 0.005, 0, 0.66, 0.7027, 270, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "SimpleJointStateMsg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SimpleJointStateMsg:\n def __init__(self, header, transforms_dict):\n self.header = header\n self.transforms_dict = transforms_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L78_C4", "label": "__init__", "type": "function", "loc": [78, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:ClassDef_L77_C0", "vector": [2, 1, 0.0991, 0.0038, 1, 0.3, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "header", "transforms_dict"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, header, transforms_dict):\n self.header = header\n self.transforms_dict = transforms_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L79_C8", "label": "self.header =", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L78_C4", "vector": [14, 2, 0.0991, 0.0013, 2, 0.69, 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_99698:Assign_L80_C8", "label": "self.transforms_dict =", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L78_C4", "vector": [14, 2, 0.1004, 0.0013, 2, 0.69, 1.0, 896, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.transforms_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.transforms_dict = transforms_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:ClassDef_L83_C0", "label": "ExtractTFData", "type": "class", "loc": [83, 151], "level": 0, "parent": null, "vector": [3, 0, 0.1468, 0.0866, 0, 0.66, 0.7297, 704, 0, 4, 0, 0, 0, 0, 24], "semantic": {"name": "ExtractTFData", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ExtractTFData:\n def __init__(self, listener=None):#, pointcloud_msg):\n rospy.Subscriber('/pressure/l_gripper_motor', pm.PressureState, self.lpress_cb)\n rospy.Subscriber('/joint_states', sm.JointState, self.joint_state_cb)\n self.ftip_frames = ['r_gripper_tool_frame',\n 'l_gripper_tool_frame']\n\n if listener != None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "label": "__init__", "type": "function", "loc": [84, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:ClassDef_L83_C0", "vector": [2, 1, 0.1186, 0.0276, 1, 0.34, 0.0, 555, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "listener"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, listener=None):#, pointcloud_msg):\n rospy.Subscriber('/pressure/l_gripper_motor', pm.PressureState, self.lpress_cb)\n rospy.Subscriber('/joint_states', sm.JointState, self.joint_state_cb)\n self.ftip_frames = ['r_gripper_tool_frame',\n 'l_gripper_tool_frame']\n\n if listener != None:\n self.tflistener = listener"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L85_C8", "label": "Subscriber()", "type": "expression", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "vector": [8, 2, 0.1066, 0.0013, 2, 0.38, 0.0, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/pressure/l_gripper_motor', pm.PressureState, self.lpress_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L86_C8", "label": "Subscriber()", "type": "expression", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "vector": [8, 2, 0.1079, 0.0013, 2, 0.38, 0.0833, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/joint_states', sm.JointState, self.joint_state_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L87_C8", "label": "self.ftip_frames =", "type": "assigned_variable", "loc": [87, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "vector": [14, 2, 0.1098, 0.0025, 2, 0.38, 0.1667, 946, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ftip_frames", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ftip_frames = ['r_gripper_tool_frame',\n 'l_gripper_tool_frame']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L90_C8", "label": "if", "type": "if", "loc": [90, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "vector": [4, 2, 0.1148, 0.005, 2, 0.38, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if listener != None:\n self.tflistener = listener\n else:\n self.tflistener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L91_C12", "label": "self.tflistener =", "type": "assigned_variable", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L90_C8", "vector": [14, 3, 0.1142, 0.0013, 3, 0.74, 0.0, 50, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tflistener", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tflistener = listener"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L93_C12", "label": "self.tflistener = TransformListener()", "type": "assigned_variable", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L90_C8", "vector": [14, 3, 0.1167, 0.0013, 3, 0.74, 1.0, 50, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tflistener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.tflistener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L95_C8", "label": "self.lmat0 =", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "vector": [14, 2, 0.1192, 0.0013, 2, 0.38, 0.3333, 529, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.lmat0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.lmat0 = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L96_C8", "label": "self.rmat0 =", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "vector": [14, 2, 0.1205, 0.0013, 2, 0.38, 0.4167, 344, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.rmat0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rmat0 = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L97_C8", "label": "self.contact_locs =", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "vector": [14, 2, 0.1217, 0.0013, 2, 0.38, 0.5, 853, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.contact_locs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.contact_locs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L98_C8", "label": "self.base_frame =", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "vector": [14, 2, 0.123, 0.0013, 2, 0.38, 0.5833, 200, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.base_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.base_frame = '/base_footprint'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L100_C8", "label": "self.contact =", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "vector": [14, 2, 0.1255, 0.0013, 2, 0.38, 0.6667, 295, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.contact", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.contact = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L101_C8", "label": "self.contact_stopped =", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "vector": [14, 2, 0.1267, 0.0013, 2, 0.38, 0.75, 698, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.contact_stopped", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.contact_stopped = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L102_C8", "label": "self.pointcloud_transform =", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "vector": [14, 2, 0.128, 0.0013, 2, 0.38, 0.8333, 610, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.pointcloud_transform", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pointcloud_transform = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L104_C8", "label": "self.jstate_msgs =", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "vector": [14, 2, 0.1305, 0.0013, 2, 0.38, 0.9167, 139, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.jstate_msgs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.jstate_msgs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L105_C8", "label": "self.last_jstate_time =", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "vector": [14, 2, 0.1317, 0.0013, 2, 0.38, 1.0, 646, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.last_jstate_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.last_jstate_time = time.time() + 999999999."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L107_C4", "label": "joint_state_cb", "type": "function", "loc": [107, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:ClassDef_L83_C0", "vector": [2, 1, 0.1418, 0.0163, 1, 0.34, 0.5, 340, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "joint_state_cb", "arg_names": ["self", "jmsg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def joint_state_cb(self, jmsg):\n tdict = {}\n\n # good for display purposes (independent of torso link etc)\n tdict['bf_T_rtip'] = tfu.transform('/base_footprint', self.ftip_frames[0], self.tflistener)\n tdict['bf_T_ltip'] = tfu.transform('/base_footprint', self.ftip_frames[1], self.tflistener)\n\n # want FK from torso"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L108_C8", "label": "tdict =", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L107_C4", "vector": [14, 2, 0.1355, 0.0013, 2, 0.73, 0.0, 460, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "tdict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tdict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L111_C8", "label": " = transform()", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L107_C4", "vector": [14, 2, 0.1393, 0.0013, 2, 0.73, 0.2, 0, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " tdict['bf_T_rtip'] = tfu.transform('/base_footprint', self.ftip_frames[0], self.tflistener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L112_C8", "label": " = transform()", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L107_C4", "vector": [14, 2, 0.1405, 0.0013, 2, 0.73, 0.4, 0, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " tdict['bf_T_ltip'] = tfu.transform('/base_footprint', self.ftip_frames[1], self.tflistener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L115_C8", "label": " = transform()", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L107_C4", "vector": [14, 2, 0.1443, 0.0013, 2, 0.73, 0.6, 0, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " tdict['torso_T_rtip'] = tfu.transform('/torso_lift_link', self.ftip_frames[0], self.tflistener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L116_C8", "label": " = transform()", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L107_C4", "vector": [14, 2, 0.1455, 0.0013, 2, 0.73, 0.8, 0, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " tdict['torso_T_ltip'] = tfu.transform('/torso_lift_link', self.ftip_frames[1], self.tflistener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L119_C8", "label": "self.last_jstate_time = time()", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L107_C4", "vector": [14, 2, 0.1493, 0.0013, 2, 0.73, 1.0, 646, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "self.last_jstate_time", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " self.last_jstate_time = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L121_C4", "label": "lpress_cb", "type": "function", "loc": [121, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:ClassDef_L83_C0", "vector": [2, 1, 0.1706, 0.0389, 1, 0.34, 1.0, 369, 0, 2, 1, 0, 0, 0, 15], "semantic": {"name": "lpress_cb", "arg_names": ["self", "pmsg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def lpress_cb(self, pmsg):\n lmat = np.matrix((pmsg.l_finger_tip)).T\n rmat = np.matrix((pmsg.r_finger_tip)).T\n if self.lmat0 == None:\n self.lmat0 = lmat\n self.rmat0 = rmat\n return\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L122_C8", "label": "lmat =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L121_C4", "vector": [14, 2, 0.1531, 0.0013, 2, 0.32, 0.0, 697, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "lmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lmat = np.matrix((pmsg.l_finger_tip)).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L123_C8", "label": "rmat =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L121_C4", "vector": [14, 2, 0.1543, 0.0013, 2, 0.32, 0.2, 674, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rmat = np.matrix((pmsg.r_finger_tip)).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L124_C8", "label": "if", "type": "if", "loc": [124, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L121_C4", "vector": [4, 2, 0.1575, 0.005, 2, 0.32, 0.4, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.lmat0 == None:\n self.lmat0 = lmat\n self.rmat0 = rmat\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L125_C12", "label": "self.lmat0 =", "type": "assigned_variable", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L124_C8", "vector": [14, 3, 0.1568, 0.0013, 3, 0.87, 0.0, 529, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.lmat0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.lmat0 = lmat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L126_C12", "label": "self.rmat0 =", "type": "assigned_variable", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L124_C8", "vector": [14, 3, 0.1581, 0.0013, 3, 0.87, 0.5, 344, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rmat0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rmat0 = rmat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L127_C12", "label": "return", "type": "return", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L124_C8", "vector": [13, 3, 0.1593, 0.0013, 3, 0.87, 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_99698:Assign_L130_C8", "label": "lmat =", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L121_C4", "vector": [14, 2, 0.1631, 0.0013, 2, 0.32, 0.6, 697, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lmat = lmat - self.lmat0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L131_C8", "label": "rmat =", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L121_C4", "vector": [14, 2, 0.1644, 0.0013, 2, 0.32, 0.8, 674, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rmat = rmat - self.rmat0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L136_C8", "label": "if", "type": "if", "loc": [136, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L121_C4", "vector": [4, 2, 0.1801, 0.0201, 2, 0.32, 1.0, 0, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.any(np.abs(lmat) > 250) or np.any(np.abs(rmat) > 250): #TODO: replace this with something more sound\n #Contact has been made!! look up gripper tip location\n def frame_loc(from_frame):\n p_base = tfu.transform(self.base_frame, from_frame, self.tflistener) \\\n * tfu.tf_as_matrix(([0., 0., 0., 1.], tr.quaternion_from_euler(0,0,0)))\n return tfu.matrix_as_tf(p_base)\n tip_locs = [frame_loc(n)[0] for n in self.ftip_frames]\n t = pmsg.header.stamp.to_time() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L138_C12", "label": "frame_loc", "type": "function", "loc": [138, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L136_C8", "vector": [2, 3, 0.175, 0.005, 3, 0.85, 0.0, 319, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "frame_loc", "arg_names": ["from_frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def frame_loc(from_frame):\n p_base = tfu.transform(self.base_frame, from_frame, self.tflistener) \\\n * tfu.tf_as_matrix(([0., 0., 0., 1.], tr.quaternion_from_euler(0,0,0)))\n return tfu.matrix_as_tf(p_base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L139_C16", "label": "p_base =", "type": "assigned_variable", "loc": [139, 140], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L138_C12", "vector": [14, 4, 0.175, 0.0025, 4, 0.08, 0.0, 544, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "p_base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_base = tfu.transform(self.base_frame, from_frame, self.tflistener) \\\n * tfu.tf_as_matrix(([0., 0., 0., 1.], tr.quaternion_from_euler(0,0,0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L141_C16", "label": "return", "type": "return", "loc": [141, 141], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L138_C12", "vector": [13, 4, 0.1769, 0.0013, 4, 0.08, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tfu.matrix_as_tf(p_base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L142_C12", "label": "tip_locs =", "type": "assigned_variable", "loc": [142, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L136_C8", "vector": [14, 3, 0.1782, 0.0013, 3, 0.85, 0.1429, 561, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tip_locs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tip_locs = [frame_loc(n)[0] for n in self.ftip_frames]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L143_C12", "label": "t = to_time()", "type": "assigned_variable", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L136_C8", "vector": [14, 3, 0.1794, 0.0013, 3, 0.85, 0.2857, 15, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "to_time", "annotation": ""}, "snippet": " t = pmsg.header.stamp.to_time() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L144_C12", "label": "loginfo()", "type": "expression", "loc": [144, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L136_C8", "vector": [8, 3, 0.1807, 0.0013, 3, 0.85, 0.4286, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"contact detected at %.3f\" % t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L145_C12", "label": "append()", "type": "expression", "loc": [145, 145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L136_C8", "vector": [8, 3, 0.1819, 0.0013, 3, 0.85, 0.5714, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.contact_locs.append([t, tip_locs])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L146_C12", "label": "self.contact =", "type": "assigned_variable", "loc": [146, 146], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L136_C8", "vector": [14, 3, 0.1832, 0.0013, 3, 0.85, 0.7143, 295, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.contact", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.contact = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L148_C12", "label": "if", "type": "if", "loc": [148, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L136_C8", "vector": [4, 3, 0.187, 0.0038, 3, 0.85, 0.8571, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.contact == True:\n rospy.loginfo('contact stopped')\n self.contact_stopped = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L149_C16", "label": "loginfo()", "type": "expression", "loc": [149, 149], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L148_C12", "vector": [8, 4, 0.187, 0.0013, 4, 0.81, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('contact stopped')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L150_C16", "label": "self.contact_stopped =", "type": "assigned_variable", "loc": [150, 150], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L148_C12", "vector": [14, 4, 0.1882, 0.0013, 4, 0.81, 1.0, 698, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.contact_stopped", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.contact_stopped = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L151_C12", "label": "self.contact =", "type": "assigned_variable", "loc": [151, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L136_C8", "vector": [14, 3, 0.1895, 0.0013, 3, 0.85, 1.0, 295, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.contact", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.contact = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:ClassDef_L157_C0", "label": "JointMsgConverter", "type": "class", "loc": [157, 203], "level": 0, "parent": null, "vector": [3, 0, 0.2258, 0.059, 0, 0.66, 0.7568, 728, 0, 2, 0, 0, 0, 0, 14], "semantic": {"name": "JointMsgConverter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class JointMsgConverter:\n def __init__(self):\n self.name_dict = None\n self.joint_groups = ut.load_pickle('link_names.pkl')\n #self.joint_groups['rarm'] = rospy.get_param('/r_arm_controller/joints')\n #self.joint_groups['larm'] = rospy.get_param('/l_arm_controller/joints')\n #self.joint_groups['head_traj'] = rospy.get_param('/head_traj_controller/joints')\n #self.joint_groups['torso'] = rospy.get_param('/torso_controller/joints')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L158_C4", "label": "__init__", "type": "function", "loc": [158, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:ClassDef_L157_C0", "vector": [2, 1, 0.1995, 0.0038, 1, 0.08, 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.name_dict = None\n self.joint_groups = ut.load_pickle('link_names.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L159_C8", "label": "self.name_dict =", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L158_C4", "vector": [14, 2, 0.1995, 0.0013, 2, 0.37, 0.0, 409, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.name_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name_dict = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L160_C8", "label": "self.joint_groups = load_pickle()", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L158_C4", "vector": [14, 2, 0.2008, 0.0013, 2, 0.37, 1.0, 452, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "self.joint_groups", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " self.joint_groups = ut.load_pickle('link_names.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L166_C4", "label": "msgs_to_dict", "type": "function", "loc": [166, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:ClassDef_L157_C0", "vector": [2, 1, 0.2315, 0.0477, 1, 0.08, 1.0, 750, 0, 2, 1, 0, 0, 0, 13], "semantic": {"name": "msgs_to_dict", "arg_names": ["self", "msgs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def msgs_to_dict(self, msgs):\n converted = []\n for i in range(len(msgs)):\n msg = msgs[i]\n if self.name_dict == None:\n self.name_dict = {}\n for i, n in enumerate(msg.name):\n self.name_dict[n] = i "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L167_C8", "label": "converted =", "type": "assigned_variable", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L166_C4", "vector": [14, 2, 0.2095, 0.0013, 2, 0.93, 0.0, 871, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "converted", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " converted = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L168_C8", "label": "for i", "type": "for", "loc": [168, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L166_C4", "vector": [6, 2, 0.2233, 0.0263, 2, 0.93, 0.3333, 826, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(msgs)):\n msg = msgs[i]\n if self.name_dict == None:\n self.name_dict = {}\n for i, n in enumerate(msg.name):\n self.name_dict[n] = i \n\n self.joint_idx = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L169_C12", "label": "msg =", "type": "assigned_variable", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L168_C8", "vector": [14, 3, 0.212, 0.0013, 3, 0.57, 0.0, 712, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = msgs[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L170_C12", "label": "if", "type": "if", "loc": [170, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L168_C8", "vector": [4, 3, 0.2177, 0.01, 3, 0.57, 0.1667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.name_dict == None:\n self.name_dict = {}\n for i, n in enumerate(msg.name):\n self.name_dict[n] = i \n\n self.joint_idx = {}\n for group in self.joint_groups.keys():\n self.joint_idx[group] = [self.name_dict[name] for name in self.joint_groups[group]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L171_C16", "label": "self.name_dict =", "type": "assigned_variable", "loc": [171, 171], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L170_C12", "vector": [14, 4, 0.2146, 0.0013, 4, 0.63, 0.0, 409, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.name_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L172_C16", "label": "for i, n", "type": "for", "loc": [172, 173], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L170_C12", "vector": [6, 4, 0.2164, 0.0025, 4, 0.63, 0.3333, 217, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i, n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, n in enumerate(msg.name):\n self.name_dict[n] = i "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L173_C20", "label": "assign", "type": "assigned_variable", "loc": [173, 173], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L172_C16", "vector": [14, 5, 0.2171, 0.0013, 5, 0.64, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name_dict[n] = i "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L175_C16", "label": "self.joint_idx =", "type": "assigned_variable", "loc": [175, 175], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L170_C12", "vector": [14, 4, 0.2196, 0.0013, 4, 0.63, 0.6667, 717, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.joint_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_idx = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L176_C16", "label": "for group", "type": "for", "loc": [176, 177], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L170_C12", "vector": [6, 4, 0.2215, 0.0025, 4, 0.63, 1.0, 43, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "group", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for group in self.joint_groups.keys():\n self.joint_idx[group] = [self.name_dict[name] for name in self.joint_groups[group]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L177_C20", "label": "assign", "type": "assigned_variable", "loc": [177, 177], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L176_C16", "vector": [14, 5, 0.2221, 0.0013, 5, 0.64, 0.0, 0, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_idx[group] = [self.name_dict[name] for name in self.joint_groups[group]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L179_C12", "label": "joint_poses =", "type": "assigned_variable", "loc": [179, 179], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L168_C8", "vector": [14, 3, 0.2246, 0.0013, 3, 0.57, 0.3333, 111, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "joint_poses", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joint_poses = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L180_C12", "label": "joint_vel =", "type": "assigned_variable", "loc": [180, 180], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L168_C8", "vector": [14, 3, 0.2258, 0.0013, 3, 0.57, 0.5, 761, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "joint_vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joint_vel = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L181_C12", "label": "joint_eff =", "type": "assigned_variable", "loc": [181, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L168_C8", "vector": [14, 3, 0.2271, 0.0013, 3, 0.57, 0.6667, 241, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "joint_eff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joint_eff = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L183_C12", "label": "for d, data", "type": "for", "loc": [183, 187], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L168_C8", "vector": [6, 3, 0.2321, 0.0063, 3, 0.57, 0.8333, 551, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "d, data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for d, data in zip([joint_poses, joint_vel, joint_eff], [msg.position, msg.velocity, msg.effort]):\n #look up values for each joint group\n dmat = np.matrix(data).T\n for group in self.joint_groups.keys():\n d[group] = dmat[self.joint_idx[group], 0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L185_C16", "label": "dmat =", "type": "assigned_variable", "loc": [185, 185], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L183_C12", "vector": [14, 4, 0.2321, 0.0013, 4, 0.8, 0.0, 447, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dmat = np.matrix(data).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L186_C16", "label": "for group", "type": "for", "loc": [186, 187], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L183_C12", "vector": [6, 4, 0.234, 0.0025, 4, 0.8, 1.0, 43, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "group", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for group in self.joint_groups.keys():\n d[group] = dmat[self.joint_idx[group], 0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L187_C20", "label": "assign", "type": "assigned_variable", "loc": [187, 187], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L186_C16", "vector": [14, 5, 0.2346, 0.0013, 5, 0.39, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d[group] = dmat[self.joint_idx[group], 0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L188_C12", "label": "append()", "type": "expression", "loc": [188, 188], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L168_C8", "vector": [8, 3, 0.2359, 0.0013, 3, 0.57, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " converted.append({'poses': joint_poses, 'vels': joint_vel, 'efforts': joint_eff, 'time': msg.header.stamp.to_time()})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L191_C8", "label": "for group", "type": "for", "loc": [191, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L166_C4", "vector": [6, 2, 0.2459, 0.0138, 2, 0.93, 0.6667, 43, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "group", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for group in ['rarm', 'larm']:\n for i in range(len(self.joint_groups[group])):\n joint = self.joint_groups[group][i]\n if 'forearm_roll' in joint or 'wrist_roll' in joint:\n delta = msgs[1].position[i] - msgs[0].position[i]\n realdelta = delta % (2 * math.pi)\n if realdelta >= math.pi:\n realdelta -= 2 * math.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L192_C12", "label": "for i", "type": "for", "loc": [192, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L191_C8", "vector": [6, 3, 0.2465, 0.0125, 3, 0.36, 0.0, 826, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(self.joint_groups[group])):\n joint = self.joint_groups[group][i]\n if 'forearm_roll' in joint or 'wrist_roll' in joint:\n delta = msgs[1].position[i] - msgs[0].position[i]\n realdelta = delta % (2 * math.pi)\n if realdelta >= math.pi:\n realdelta -= 2 * math.pi\n correction = delta - realdelta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L193_C16", "label": "joint =", "type": "assigned_variable", "loc": [193, 193], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L192_C12", "vector": [14, 4, 0.2422, 0.0013, 4, 0.4, 0.0, 668, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "joint", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joint = self.joint_groups[group][i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L194_C16", "label": "if", "type": "if", "loc": [194, 201], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L192_C12", "vector": [4, 4, 0.2478, 0.01, 4, 0.4, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'forearm_roll' in joint or 'wrist_roll' in joint:\n delta = msgs[1].position[i] - msgs[0].position[i]\n realdelta = delta % (2 * math.pi)\n if realdelta >= math.pi:\n realdelta -= 2 * math.pi\n correction = delta - realdelta\n for j in range(1, len(msgs)):\n converted[j]['poses'][group][i,0] -= correction"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L195_C20", "label": "delta =", "type": "assigned_variable", "loc": [195, 195], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L194_C16", "vector": [14, 5, 0.2447, 0.0013, 5, 0.86, 0.0, 593, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "delta", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " delta = msgs[1].position[i] - msgs[0].position[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L196_C20", "label": "realdelta =", "type": "assigned_variable", "loc": [196, 196], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L194_C16", "vector": [14, 5, 0.2459, 0.0013, 5, 0.86, 0.25, 486, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "realdelta", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " realdelta = delta % (2 * math.pi)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L197_C20", "label": "if", "type": "if", "loc": [197, 198], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L194_C16", "vector": [4, 5, 0.2478, 0.0025, 5, 0.86, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if realdelta >= math.pi:\n realdelta -= 2 * math.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L199_C20", "label": "correction =", "type": "assigned_variable", "loc": [199, 199], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L194_C16", "vector": [14, 5, 0.2497, 0.0013, 5, 0.86, 0.75, 996, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "correction", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " correction = delta - realdelta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L200_C20", "label": "for j", "type": "for", "loc": [200, 201], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L194_C16", "vector": [6, 5, 0.2516, 0.0025, 5, 0.86, 1.0, 100, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j in range(1, len(msgs)):\n converted[j]['poses'][group][i,0] -= correction"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L203_C8", "label": "return", "type": "return", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L166_C4", "vector": [13, 2, 0.2547, 0.0013, 2, 0.93, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return converted"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L209_C0", "label": "assign_3d_to_surf", "type": "function", "loc": [209, 221], "level": 0, "parent": null, "vector": [2, 0, 0.2698, 0.0163, 0, 0.66, 0.7838, 336, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "assign_3d_to_surf", "arg_names": ["surf_locs", "point_cloud_3d", "point_cloud_2d"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def assign_3d_to_surf(surf_locs, point_cloud_3d, point_cloud_2d):\n point_cloud_2d_tree = sp.KDTree(np.array(point_cloud_2d.T))\n #print '>> shape of point_cloud_3d', point_cloud_3d.shape\n\n surf_loc3d = []\n for s in surf_locs:\n loc = s[0]\n idx = point_cloud_2d_tree.query(np.array(loc))[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L210_C4", "label": "point_cloud_2d_tree = KDTree()", "type": "assigned_variable", "loc": [210, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L209_C0", "vector": [14, 1, 0.2635, 0.0013, 1, 0.02, 0.0, 856, 3, 1, 0, 0, 940, 10, 2], "semantic": {"name": "point_cloud_2d_tree", "arg_names": [], "import_names": [], "rhs_call_name": "KDTree", "annotation": ""}, "snippet": " point_cloud_2d_tree = sp.KDTree(np.array(point_cloud_2d.T))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L213_C4", "label": "surf_loc3d =", "type": "assigned_variable", "loc": [213, 213], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L209_C0", "vector": [14, 1, 0.2673, 0.0013, 1, 0.02, 0.25, 837, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "surf_loc3d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " surf_loc3d = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L214_C4", "label": "for s", "type": "for", "loc": [214, 217], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L209_C0", "vector": [6, 1, 0.2704, 0.005, 1, 0.02, 0.5, 553, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for s in surf_locs:\n loc = s[0]\n idx = point_cloud_2d_tree.query(np.array(loc))[1]\n surf_loc3d.append(point_cloud_3d[:, idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L215_C8", "label": "loc =", "type": "assigned_variable", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L214_C4", "vector": [14, 2, 0.2698, 0.0013, 2, 0.33, 0.0, 822, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "loc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " loc = s[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L216_C8", "label": "idx =", "type": "assigned_variable", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L214_C4", "vector": [14, 2, 0.271, 0.0013, 2, 0.33, 0.5, 187, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " idx = point_cloud_2d_tree.query(np.array(loc))[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L217_C8", "label": "append()", "type": "expression", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L214_C4", "vector": [8, 2, 0.2723, 0.0013, 2, 0.33, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " surf_loc3d.append(point_cloud_3d[:, idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L220_C4", "label": "surf_loc3d = column_stack()", "type": "assigned_variable", "loc": [220, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L209_C0", "vector": [14, 1, 0.276, 0.0013, 1, 0.02, 0.75, 837, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "surf_loc3d", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " surf_loc3d = np.column_stack(surf_loc3d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L221_C4", "label": "return", "type": "return", "loc": [221, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L209_C0", "vector": [13, 1, 0.2773, 0.0013, 1, 0.02, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return surf_loc3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L223_C0", "label": "find_contacts_and_fk", "type": "function", "loc": [223, 238], "level": 0, "parent": null, "vector": [2, 0, 0.2892, 0.0201, 0, 0.66, 0.8108, 583, 0, 2, 1, 0, 0, 0, 10], "semantic": {"name": "find_contacts_and_fk", "arg_names": ["tflistener", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def find_contacts_and_fk(tflistener, arm):\n find_contact_locs = ExtractTFData(tflistener)\n while not rospy.is_shutdown() \\\n and (not find_contact_locs.contact_stopped) \\\n and ((time.time() - find_contact_locs.last_jstate_time) < 1.):\n print('waiting for ExtractTFData to finish.')\n time.sleep(.5)\n print('got %d joint state messages' % len(find_contact_locs.jstate_msgs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L224_C4", "label": "find_contact_locs = ExtractTFData()", "type": "assigned_variable", "loc": [224, 224], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L223_C0", "vector": [14, 1, 0.2811, 0.0013, 1, 0.87, 0.0, 605, 3, 1, 0, 0, 704, 10, 1], "semantic": {"name": "find_contact_locs", "arg_names": [], "import_names": [], "rhs_call_name": "ExtractTFData", "annotation": ""}, "snippet": " find_contact_locs = ExtractTFData(tflistener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:While_L225_C4", "label": "while", "type": "while", "loc": [225, 229], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L223_C0", "vector": [5, 1, 0.2848, 0.0063, 1, 0.87, 0.1667, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown() \\\n and (not find_contact_locs.contact_stopped) \\\n and ((time.time() - find_contact_locs.last_jstate_time) < 1.):\n print('waiting for ExtractTFData to finish.')\n time.sleep(.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L228_C8", "label": "print()", "type": "expression", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:While_L225_C4", "vector": [8, 2, 0.2861, 0.0013, 2, 0.53, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('waiting for ExtractTFData to finish.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L229_C8", "label": "sleep()", "type": "expression", "loc": [229, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:While_L225_C4", "vector": [8, 2, 0.2873, 0.0013, 2, 0.53, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L230_C4", "label": "print()", "type": "expression", "loc": [230, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L223_C0", "vector": [8, 1, 0.2886, 0.0013, 1, 0.87, 0.3333, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('got %d joint state messages' % len(find_contact_locs.jstate_msgs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L232_C4", "label": "contact_locs =", "type": "assigned_variable", "loc": [232, 232], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L223_C0", "vector": [14, 1, 0.2911, 0.0013, 1, 0.87, 0.5, 710, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "contact_locs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " contact_locs = find_contact_locs.contact_locs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L233_C4", "label": "if", "type": "if", "loc": [233, 236], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L223_C0", "vector": [4, 1, 0.2942, 0.005, 1, 0.87, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'right':\n contact_tips = [np.matrix(r[1][0]).T for r in contact_locs]\n else:\n contact_tips = [np.matrix(r[1][1]).T for r in contact_locs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L234_C8", "label": "contact_tips =", "type": "assigned_variable", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L233_C4", "vector": [14, 2, 0.2936, 0.0013, 2, 0.2, 0.0, 899, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "contact_tips", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " contact_tips = [np.matrix(r[1][0]).T for r in contact_locs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L236_C8", "label": "contact_tips =", "type": "assigned_variable", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L233_C4", "vector": [14, 2, 0.2961, 0.0013, 2, 0.2, 1.0, 899, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "contact_tips", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " contact_tips = [np.matrix(r[1][1]).T for r in contact_locs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L237_C4", "label": "contact_tips = column_stack()", "type": "assigned_variable", "loc": [237, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L223_C0", "vector": [14, 1, 0.2974, 0.0013, 1, 0.87, 0.8333, 899, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "contact_tips", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " contact_tips = np.column_stack(contact_tips)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L238_C4", "label": "return", "type": "return", "loc": [238, 238], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L223_C0", "vector": [13, 1, 0.2986, 0.0013, 1, 0.87, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return contact_tips[:,0], find_contact_locs.jstate_msgs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L240_C0", "label": "project_2d_bounded", "type": "function", "loc": [240, 248], "level": 0, "parent": null, "vector": [2, 0, 0.3061, 0.0113, 0, 0.66, 0.8378, 587, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "project_2d_bounded", "arg_names": ["cam_info", "point_cloud_cam"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def project_2d_bounded(cam_info, point_cloud_cam):\n point_cloud_2d_cam = cam_info.project(point_cloud_cam) \n # only count points in image bounds (should be in cam info)\n _, in_bounds = np.where(np.invert((point_cloud_2d_cam[0,:] >= (cam_info.w-.6)) + (point_cloud_2d_cam[0,:] < 0) \\\n + (point_cloud_2d_cam[1,:] >= (cam_info.h-.6)) + (point_cloud_2d_cam[1,:] < 0)))\n point_cloud_2d_cam = point_cloud_2d_cam[:, in_bounds.A1]\n point_cloud_reduced_cam = point_cloud_cam[:, in_bounds.A1]\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L241_C4", "label": "point_cloud_2d_cam = project()", "type": "assigned_variable", "loc": [241, 241], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L240_C0", "vector": [14, 1, 0.3024, 0.0013, 1, 0.12, 0.0, 637, 3, 1, 0, 0, 841, 10, 1], "semantic": {"name": "point_cloud_2d_cam", "arg_names": [], "import_names": [], "rhs_call_name": "project", "annotation": ""}, "snippet": " point_cloud_2d_cam = cam_info.project(point_cloud_cam) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L243_C4", "label": "_, in_bounds = where()", "type": "assigned_variable", "loc": [243, 244], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L240_C0", "vector": [14, 1, 0.3055, 0.0025, 1, 0.12, 0.25, 660, 3, 1, 0, 0, 169, 10, 2], "semantic": {"name": "_, in_bounds", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " _, in_bounds = np.where(np.invert((point_cloud_2d_cam[0,:] >= (cam_info.w-.6)) + (point_cloud_2d_cam[0,:] < 0) \\\n + (point_cloud_2d_cam[1,:] >= (cam_info.h-.6)) + (point_cloud_2d_cam[1,:] < 0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L245_C4", "label": "point_cloud_2d_cam =", "type": "assigned_variable", "loc": [245, 245], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L240_C0", "vector": [14, 1, 0.3074, 0.0013, 1, 0.12, 0.5, 637, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "point_cloud_2d_cam", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point_cloud_2d_cam = point_cloud_2d_cam[:, in_bounds.A1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L246_C4", "label": "point_cloud_reduced_cam =", "type": "assigned_variable", "loc": [246, 246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L240_C0", "vector": [14, 1, 0.3087, 0.0013, 1, 0.12, 0.75, 187, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "point_cloud_reduced_cam", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point_cloud_reduced_cam = point_cloud_cam[:, in_bounds.A1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L248_C4", "label": "return", "type": "return", "loc": [248, 248], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L240_C0", "vector": [13, 1, 0.3112, 0.0013, 1, 0.12, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return point_cloud_2d_cam, point_cloud_reduced_cam"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L250_C0", "label": "find3d_surf", "type": "function", "loc": [250, 268], "level": 0, "parent": null, "vector": [2, 0, 0.325, 0.0238, 0, 0.66, 0.8649, 567, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "find3d_surf", "arg_names": ["start_conditions"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def find3d_surf(start_conditions):\n ## Project pointcloud into 2d\n point_cloud_bf = ru.pointcloud_to_np(start_conditions['points'])\n # from base_frame to prosilica frame\n point_cloud_pro = tfu.transform_points(start_conditions['pro_T_bf'], point_cloud_bf)\n point_cloud_2d_pro, point_cloud_reduced_pro = project_2d_bounded(start_conditions['camera_info'], point_cloud_pro)\n #point_cloud_2d_pro = .project(point_cloud_pro) \n ## only count points in image bounds (should be in cam info)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L252_C4", "label": "point_cloud_bf = pointcloud_to_np()", "type": "assigned_variable", "loc": [252, 252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L250_C0", "vector": [14, 1, 0.3162, 0.0013, 1, 0.52, 0.0, 552, 3, 1, 0, 0, 2, 10, 1], "semantic": {"name": "point_cloud_bf", "arg_names": [], "import_names": [], "rhs_call_name": "pointcloud_to_np", "annotation": ""}, "snippet": " point_cloud_bf = ru.pointcloud_to_np(start_conditions['points'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L254_C4", "label": "point_cloud_pro = transform_points()", "type": "assigned_variable", "loc": [254, 254], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L250_C0", "vector": [14, 1, 0.3187, 0.0013, 1, 0.52, 0.1667, 400, 3, 2, 0, 0, 725, 10, 1], "semantic": {"name": "point_cloud_pro", "arg_names": [], "import_names": [], "rhs_call_name": "transform_points", "annotation": ""}, "snippet": " point_cloud_pro = tfu.transform_points(start_conditions['pro_T_bf'], point_cloud_bf)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L255_C4", "label": "point_cloud_2d_pro, point_cloud_reduced_pro = project_2d_bounded()", "type": "assigned_variable", "loc": [255, 255], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L250_C0", "vector": [14, 1, 0.3199, 0.0013, 1, 0.52, 0.3333, 728, 3, 2, 0, 0, 587, 10, 1], "semantic": {"name": "point_cloud_2d_pro, point_cloud_reduced_pro", "arg_names": [], "import_names": [], "rhs_call_name": "project_2d_bounded", "annotation": ""}, "snippet": " point_cloud_2d_pro, point_cloud_reduced_pro = project_2d_bounded(start_conditions['camera_info'], point_cloud_pro)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L265_C4", "label": "model_file_name =", "type": "assigned_variable", "loc": [265, 265], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L250_C0", "vector": [14, 1, 0.3325, 0.0013, 1, 0.52, 0.5, 585, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "model_file_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " model_file_name = start_conditions['model_image']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L266_C4", "label": "model_surf_loc, model_surf_descriptors = surf_color()", "type": "assigned_variable", "loc": [266, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L250_C0", "vector": [14, 1, 0.3338, 0.0013, 1, 0.52, 0.6667, 530, 3, 1, 0, 0, 716, 10, 2], "semantic": {"name": "model_surf_loc, model_surf_descriptors", "arg_names": [], "import_names": [], "rhs_call_name": "surf_color", "annotation": ""}, "snippet": " model_surf_loc, model_surf_descriptors = fea.surf_color(cv.LoadImage(model_file_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L267_C4", "label": "surf_loc3d_pro = matrix()", "type": "assigned_variable", "loc": [267, 267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L250_C0", "vector": [14, 1, 0.335, 0.0013, 1, 0.52, 0.8333, 360, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "surf_loc3d_pro", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " surf_loc3d_pro = np.matrix(assign_3d_to_surf(model_surf_loc, point_cloud_reduced_pro, point_cloud_2d_pro))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L268_C4", "label": "return", "type": "return", "loc": [268, 268], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L250_C0", "vector": [13, 1, 0.3363, 0.0013, 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 model_surf_loc, model_surf_descriptors, surf_loc3d_pro, point_cloud_2d_pro"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "label": "extract_object_localization_features2", "type": "function", "loc": [273, 314], "level": 0, "parent": null, "vector": [2, 0, 0.3683, 0.0527, 0, 0.66, 0.8919, 701, 0, 4, 1, 0, 0, 0, 17], "semantic": {"name": "extract_object_localization_features2", "arg_names": ["start_conditions", "tflistener", "arm_used", "p_base_map"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def extract_object_localization_features2(start_conditions, tflistener, arm_used, p_base_map):\n mid_contact_bf, jstate_msgs = find_contacts_and_fk(tflistener, arm_used)\n model_surf_loc, model_surf_descriptors, surf_loc3d_pro, point_cloud_2d_pro = find3d_surf(start_conditions)\n\n #Find frame\n surf_loc3d_bf = (np.linalg.inv(start_conditions['pro_T_bf']) \\\n * np.row_stack((surf_loc3d_pro, 1+np.zeros((1,surf_loc3d_pro.shape[1])))))[0:3,:]\n frame_bf = create_frame(surf_loc3d_bf, p=np.matrix([-1, 0, 0.]).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L274_C4", "label": "mid_contact_bf, jstate_msgs = find_contacts_and_fk()", "type": "assigned_variable", "loc": [274, 274], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "vector": [14, 1, 0.3438, 0.0013, 1, 0.28, 0.0, 881, 3, 2, 0, 0, 583, 10, 1], "semantic": {"name": "mid_contact_bf, jstate_msgs", "arg_names": [], "import_names": [], "rhs_call_name": "find_contacts_and_fk", "annotation": ""}, "snippet": " mid_contact_bf, jstate_msgs = find_contacts_and_fk(tflistener, arm_used)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L275_C4", "label": "model_surf_loc, model_surf_descriptors, surf_loc3d_pro, point_cloud_2d_pro = find3d_surf()", "type": "assigned_variable", "loc": [275, 275], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "vector": [14, 1, 0.345, 0.0013, 1, 0.28, 0.0625, 225, 3, 1, 0, 0, 567, 10, 1], "semantic": {"name": "model_surf_loc, model_surf_descriptors, surf_loc3d_pro, point_cloud_2d_pro", "arg_names": [], "import_names": [], "rhs_call_name": "find3d_surf", "annotation": ""}, "snippet": " model_surf_loc, model_surf_descriptors, surf_loc3d_pro, point_cloud_2d_pro = find3d_surf(start_conditions)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L278_C4", "label": "surf_loc3d_bf =", "type": "assigned_variable", "loc": [278, 279], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "vector": [14, 1, 0.3494, 0.0025, 1, 0.28, 0.125, 677, 6, 0, 0, 0, 0, 0, 3], "semantic": {"name": "surf_loc3d_bf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " surf_loc3d_bf = (np.linalg.inv(start_conditions['pro_T_bf']) \\\n * np.row_stack((surf_loc3d_pro, 1+np.zeros((1,surf_loc3d_pro.shape[1])))))[0:3,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L280_C4", "label": "frame_bf = create_frame()", "type": "assigned_variable", "loc": [280, 280], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "vector": [14, 1, 0.3513, 0.0013, 1, 0.28, 0.1875, 548, 3, 2, 0, 0, 109, 10, 2], "semantic": {"name": "frame_bf", "arg_names": [], "import_names": [], "rhs_call_name": "create_frame", "annotation": ""}, "snippet": " frame_bf = create_frame(surf_loc3d_bf, p=np.matrix([-1, 0, 0.]).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L281_C4", "label": "center_bf = mean()", "type": "assigned_variable", "loc": [281, 281], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "vector": [14, 1, 0.3526, 0.0013, 1, 0.28, 0.25, 328, 3, 2, 0, 0, 856, 10, 1], "semantic": {"name": "center_bf", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " center_bf = np.mean(surf_loc3d_bf, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L284_C4", "label": "bf_R_pro =", "type": "assigned_variable", "loc": [284, 284], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "vector": [14, 1, 0.3563, 0.0013, 1, 0.28, 0.3125, 144, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "bf_R_pro", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bf_R_pro = (start_conditions['pro_T_bf'][0:3, 0:3]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L285_C4", "label": "bf_R_obj =", "type": "assigned_variable", "loc": [285, 285], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "vector": [14, 1, 0.3576, 0.0013, 1, 0.28, 0.375, 787, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "bf_R_obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bf_R_obj = frame_bf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L286_C4", "label": "x_bf =", "type": "assigned_variable", "loc": [286, 286], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "vector": [14, 1, 0.3588, 0.0013, 1, 0.28, 0.4375, 671, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_bf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_bf = frame_bf[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L287_C4", "label": "x_pro =", "type": "assigned_variable", "loc": [287, 287], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "vector": [14, 1, 0.3601, 0.0013, 1, 0.28, 0.5, 914, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_pro", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_pro = bf_R_pro.T * x_bf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L288_C4", "label": "x_ang_pro = atan2()", "type": "assigned_variable", "loc": [288, 288], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "vector": [14, 1, 0.3614, 0.0013, 1, 0.28, 0.5625, 123, 3, 2, 0, 0, 572, 10, 1], "semantic": {"name": "x_ang_pro", "arg_names": [], "import_names": [], "rhs_call_name": "atan2", "annotation": ""}, "snippet": " x_ang_pro = math.atan2(x_pro[1,0], x_pro[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L290_C4", "label": "center_pro = transform_points()", "type": "assigned_variable", "loc": [290, 290], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "vector": [14, 1, 0.3639, 0.0013, 1, 0.28, 0.625, 423, 3, 2, 0, 0, 725, 10, 1], "semantic": {"name": "center_pro", "arg_names": [], "import_names": [], "rhs_call_name": "transform_points", "annotation": ""}, "snippet": " center_pro = tfu.transform_points(start_conditions['pro_T_bf'], center_bf)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L291_C4", "label": "center2d_pro = project()", "type": "assigned_variable", "loc": [291, 291], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "vector": [14, 1, 0.3651, 0.0013, 1, 0.28, 0.6875, 319, 3, 1, 0, 0, 841, 10, 1], "semantic": {"name": "center2d_pro", "arg_names": [], "import_names": [], "rhs_call_name": "project", "annotation": ""}, "snippet": " center2d_pro = start_conditions['camera_info'].project(center_pro)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L293_C4", "label": "surf_directions =", "type": "assigned_variable", "loc": [293, 293], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "vector": [14, 1, 0.3676, 0.0013, 1, 0.28, 0.75, 733, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "surf_directions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " surf_directions = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L294_C4", "label": "surf_dir_center =", "type": "assigned_variable", "loc": [294, 294], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "vector": [14, 1, 0.3689, 0.0013, 1, 0.28, 0.8125, 159, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "surf_dir_center", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " surf_dir_center = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L295_C4", "label": "for loc, lap, size, direction, hess", "type": "for", "loc": [295, 298], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "vector": [6, 1, 0.372, 0.005, 1, 0.28, 0.875, 131, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "loc, lap, size, direction, hess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for loc, lap, size, direction, hess in model_surf_loc:\n surf_directions.append(ut.standard_rad(np.radians(direction) - x_ang_pro))\n direction_to_center = center2d_pro - np.matrix(loc).T\n surf_dir_center.append(direction_to_center)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L296_C8", "label": "append()", "type": "expression", "loc": [296, 296], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L295_C4", "vector": [8, 2, 0.3714, 0.0013, 2, 0.44, 0.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " surf_directions.append(ut.standard_rad(np.radians(direction) - x_ang_pro))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L297_C8", "label": "direction_to_center =", "type": "assigned_variable", "loc": [297, 297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L295_C4", "vector": [14, 2, 0.3726, 0.0013, 2, 0.44, 0.5, 901, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "direction_to_center", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " direction_to_center = center2d_pro - np.matrix(loc).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L298_C8", "label": "append()", "type": "expression", "loc": [298, 298], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L295_C4", "vector": [8, 2, 0.3739, 0.0013, 2, 0.44, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " surf_dir_center.append(direction_to_center)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L300_C4", "label": "surf_dir_center = column_stack()", "type": "assigned_variable", "loc": [300, 300], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "vector": [14, 1, 0.3764, 0.0013, 1, 0.28, 0.9375, 159, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "surf_dir_center", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " surf_dir_center = np.column_stack(surf_dir_center)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L301_C4", "label": "return", "type": "return", "loc": [301, 314], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "vector": [13, 1, 0.3858, 0.0176, 1, 0.28, 1.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return {\n 'contact_bf': mid_contact_bf,\n 'surf_loc3d_pro': surf_loc3d_pro,\n 'surf_loc2d_pro': model_surf_loc,\n 'point_cloud_2d_pro': point_cloud_2d_pro,\n\n 'surf_directions': surf_directions, #Orientation\n 'surf_pose_dir2d': surf_dir_center, #Position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "label": "extract_object_localization_features", "type": "function", "loc": [319, 374], "level": 0, "parent": null, "vector": [2, 0, 0.4348, 0.0703, 0, 0.66, 0.9189, 542, 0, 2, 1, 0, 0, 0, 32], "semantic": {"name": "extract_object_localization_features", "arg_names": ["start_conditions", "tflistener"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def extract_object_localization_features(start_conditions, tflistener):\n ## Find contacts\n find_contact_locs = ExtractTFData(tflistener)\n r = rospy.Rate(10)\n while not rospy.is_shutdown() and not find_contact_locs.contact_stopped:\n r.sleep()\n contact_locs = find_contact_locs.contact_locs\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L321_C4", "label": "find_contact_locs = ExtractTFData()", "type": "assigned_variable", "loc": [321, 321], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [14, 1, 0.4028, 0.0013, 1, 0.6, 0.0, 605, 3, 1, 0, 0, 704, 10, 1], "semantic": {"name": "find_contact_locs", "arg_names": [], "import_names": [], "rhs_call_name": "ExtractTFData", "annotation": ""}, "snippet": " find_contact_locs = ExtractTFData(tflistener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L322_C4", "label": "r = Rate()", "type": "assigned_variable", "loc": [322, 322], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [14, 1, 0.404, 0.0013, 1, 0.6, 0.0455, 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_99698:While_L323_C4", "label": "while", "type": "while", "loc": [323, 324], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [5, 1, 0.4059, 0.0025, 1, 0.6, 0.0909, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown() and not find_contact_locs.contact_stopped:\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L324_C8", "label": "sleep()", "type": "expression", "loc": [324, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:While_L323_C4", "vector": [8, 2, 0.4065, 0.0013, 2, 0.02, 0.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_99698:Assign_L325_C4", "label": "contact_locs =", "type": "assigned_variable", "loc": [325, 325], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [14, 1, 0.4078, 0.0013, 1, 0.6, 0.1364, 710, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "contact_locs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " contact_locs = find_contact_locs.contact_locs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L328_C4", "label": "model_file_name =", "type": "assigned_variable", "loc": [328, 328], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [14, 1, 0.4115, 0.0013, 1, 0.6, 0.1818, 585, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "model_file_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " model_file_name = start_conditions['model_image']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L329_C4", "label": "model_surf_loc, model_surf_descriptors = surf_color()", "type": "assigned_variable", "loc": [329, 329], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [14, 1, 0.4128, 0.0013, 1, 0.6, 0.2273, 530, 3, 1, 0, 0, 716, 10, 2], "semantic": {"name": "model_surf_loc, model_surf_descriptors", "arg_names": [], "import_names": [], "rhs_call_name": "surf_color", "annotation": ""}, "snippet": " model_surf_loc, model_surf_descriptors = fea.surf_color(cv.LoadImage(model_file_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L332_C4", "label": "point_cloud_bf = pointcloud_to_np()", "type": "assigned_variable", "loc": [332, 332], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [14, 1, 0.4166, 0.0013, 1, 0.6, 0.2727, 552, 3, 1, 0, 0, 2, 10, 1], "semantic": {"name": "point_cloud_bf", "arg_names": [], "import_names": [], "rhs_call_name": "pointcloud_to_np", "annotation": ""}, "snippet": " point_cloud_bf = ru.pointcloud_to_np(start_conditions['points'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L333_C4", "label": "point_cloud_pro =", "type": "assigned_variable", "loc": [333, 333], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [14, 1, 0.4178, 0.0013, 1, 0.6, 0.3182, 400, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "point_cloud_pro", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point_cloud_pro = start_conditions['pro_T_bf'] * np.row_stack((point_cloud_bf, 1+np.zeros((1, point_cloud_bf.shape[1]))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L334_C4", "label": "point_cloud_2d_pro = project()", "type": "assigned_variable", "loc": [334, 334], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [14, 1, 0.4191, 0.0013, 1, 0.6, 0.3636, 47, 3, 1, 0, 0, 841, 10, 1], "semantic": {"name": "point_cloud_2d_pro", "arg_names": [], "import_names": [], "rhs_call_name": "project", "annotation": ""}, "snippet": " point_cloud_2d_pro = start_conditions['camera_info'].project(point_cloud_pro[0:3,:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L335_C4", "label": "surf_loc3d_arr_bf = array()", "type": "assigned_variable", "loc": [335, 335], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [14, 1, 0.4203, 0.0013, 1, 0.6, 0.4091, 385, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "surf_loc3d_arr_bf", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " surf_loc3d_arr_bf = np.array(assign_3d_to_surf(model_surf_loc, point_cloud_bf, point_cloud_2d_pro))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L336_C4", "label": "surf_loc_tree_bf = KDTree()", "type": "assigned_variable", "loc": [336, 336], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [14, 1, 0.4216, 0.0013, 1, 0.6, 0.4545, 404, 3, 1, 0, 0, 940, 10, 1], "semantic": {"name": "surf_loc_tree_bf", "arg_names": [], "import_names": [], "rhs_call_name": "KDTree", "annotation": ""}, "snippet": " surf_loc_tree_bf = sp.KDTree(surf_loc3d_arr_bf.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L342_C4", "label": "left_contact, right_contact = zip()", "type": "assigned_variable", "loc": [342, 342], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [14, 1, 0.4291, 0.0013, 1, 0.6, 0.5, 351, 3, 1, 0, 0, 814, 10, 3], "semantic": {"name": "left_contact, right_contact", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " left_contact, right_contact = zip(*[(np.matrix(r[1][2]).T, np.matrix(r[1][3]).T) for r in contact_locs])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L343_C4", "label": "left_contact = column_stack()", "type": "assigned_variable", "loc": [343, 343], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [14, 1, 0.4304, 0.0013, 1, 0.6, 0.5455, 942, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "left_contact", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " left_contact = np.column_stack(left_contact)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L344_C4", "label": "right_contact = column_stack()", "type": "assigned_variable", "loc": [344, 344], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [14, 1, 0.4316, 0.0013, 1, 0.6, 0.5909, 751, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "right_contact", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " right_contact = np.column_stack(right_contact)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L345_C4", "label": "mid_contact_bf =", "type": "assigned_variable", "loc": [345, 345], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [14, 1, 0.4329, 0.0013, 1, 0.6, 0.6364, 289, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mid_contact_bf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mid_contact_bf = (left_contact[:,0] + right_contact[:,0]) / 2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L348_C4", "label": "surf_closest_idx =", "type": "assigned_variable", "loc": [348, 348], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [14, 1, 0.4366, 0.0013, 1, 0.6, 0.6818, 28, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "surf_closest_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " surf_closest_idx = surf_loc_tree_bf.query(np.array(mid_contact_bf.T))[1] #Get surf feature at mid point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L349_C4", "label": "surf_closest3d =", "type": "assigned_variable", "loc": [349, 349], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [14, 1, 0.4379, 0.0013, 1, 0.6, 0.7273, 844, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "surf_closest3d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " surf_closest3d = surf_loc3d_arr_bf[:, surf_closest_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L350_C4", "label": "surf_closest_fea =", "type": "assigned_variable", "loc": [350, 350], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [14, 1, 0.4391, 0.0013, 1, 0.6, 0.7727, 727, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "surf_closest_fea", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " surf_closest_fea = model_surf_loc[surf_closest_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L353_C4", "label": "surf_loc_3d_pro =", "type": "assigned_variable", "loc": [353, 353], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [14, 1, 0.4429, 0.0013, 1, 0.6, 0.8182, 413, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "surf_loc_3d_pro", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " surf_loc_3d_pro = (start_conditions['pro_T_bf'] * np.row_stack([surf_loc3d_arr_bf, 1 + np.zeros((1, surf_loc3d_arr_bf.shape[1]))]))[0:3,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L354_C4", "label": "object_frame_pro = create_frame()", "type": "assigned_variable", "loc": [354, 354], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [14, 1, 0.4442, 0.0013, 1, 0.6, 0.8636, 473, 3, 1, 0, 0, 109, 10, 2], "semantic": {"name": "object_frame_pro", "arg_names": [], "import_names": [], "rhs_call_name": "create_frame", "annotation": ""}, "snippet": " object_frame_pro = create_frame(np.matrix(surf_loc_3d_pro))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L357_C4", "label": "surf_directions =", "type": "assigned_variable", "loc": [357, 357], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [14, 1, 0.4479, 0.0013, 1, 0.6, 0.9091, 733, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "surf_directions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " surf_directions = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L358_C4", "label": "for loc, lap, size, direction, hess", "type": "for", "loc": [358, 365], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [6, 1, 0.4536, 0.01, 1, 0.6, 0.9545, 131, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "loc, lap, size, direction, hess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for loc, lap, size, direction, hess in model_surf_loc:\n drad = np.radians(direction)\n #project direction into the cannonical object frame\n surf_dir_obj = object_frame_pro * np.matrix([np.cos(drad), np.sin(drad), 0.]).T\n\n #measure angle between SURF feature and x axis of object frame, store this as delta theta\n delta_theta = math.atan2(surf_dir_obj[1,0], surf_dir_obj[0,0])\n surf_directions.append(delta_theta)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L359_C8", "label": "drad = radians()", "type": "assigned_variable", "loc": [359, 359], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L358_C4", "vector": [14, 2, 0.4504, 0.0013, 2, 0.56, 0.0, 451, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "drad", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " drad = np.radians(direction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L361_C8", "label": "surf_dir_obj =", "type": "assigned_variable", "loc": [361, 361], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L358_C4", "vector": [14, 2, 0.4529, 0.0013, 2, 0.56, 0.3333, 381, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "surf_dir_obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " surf_dir_obj = object_frame_pro * np.matrix([np.cos(drad), np.sin(drad), 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L364_C8", "label": "delta_theta = atan2()", "type": "assigned_variable", "loc": [364, 364], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L358_C4", "vector": [14, 2, 0.4567, 0.0013, 2, 0.56, 0.6667, 348, 3, 2, 0, 0, 572, 10, 1], "semantic": {"name": "delta_theta", "arg_names": [], "import_names": [], "rhs_call_name": "atan2", "annotation": ""}, "snippet": " delta_theta = math.atan2(surf_dir_obj[1,0], surf_dir_obj[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L365_C8", "label": "append()", "type": "expression", "loc": [365, 365], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L358_C4", "vector": [8, 2, 0.458, 0.0013, 2, 0.56, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " surf_directions.append(delta_theta)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L367_C4", "label": "return", "type": "return", "loc": [367, 374], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "vector": [13, 1, 0.4649, 0.01, 1, 0.6, 1.0, 0, 0, 0, 0, 0, 0, 6, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return {\n 'descriptors': model_surf_descriptors, \n 'directions': surf_directions, \n 'contact_bf': mid_contact_bf,\n 'closest_feature': surf_closest_fea[0],\n #'object_frame_bf': [np.mean(np.matrix(surf_loc3d_arr_bf), 1), create_frame(surf_loc3d_arr_bf)],\n 'object_frame_pro': [np.mean(np.matrix(surf_loc_3d_pro), 1), object_frame_pro, surf_loc_3d_pro]\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "label": "create_frame", "type": "function", "loc": [388, 416], "level": 0, "parent": null, "vector": [2, 0, 0.5044, 0.0364, 0, 0.66, 0.9459, 109, 0, 2, 1, 0, 0, 0, 12], "semantic": {"name": "create_frame", "arg_names": ["points3d", "p"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_frame(points3d, p=np.matrix([-1,0,0.]).T):\n #pdb.set_trace()\n u, s, vh = np.linalg.svd(np.cov(points3d))\n u = np.matrix(u)\n\n # Pick normal\n if (u[:,2].T * p)[0,0] < 0:\n normal = -u[:,2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L390_C4", "label": "u, s, vh = svd()", "type": "assigned_variable", "loc": [390, 390], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "vector": [14, 1, 0.4893, 0.0013, 1, 0.89, 0.0, 625, 3, 1, 0, 0, 388, 10, 2], "semantic": {"name": "u, s, vh", "arg_names": [], "import_names": [], "rhs_call_name": "svd", "annotation": ""}, "snippet": " u, s, vh = np.linalg.svd(np.cov(points3d))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L391_C4", "label": "u = matrix()", "type": "assigned_variable", "loc": [391, 391], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "vector": [14, 1, 0.4906, 0.0013, 1, 0.89, 0.0833, 609, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "u", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " u = np.matrix(u)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L394_C4", "label": "if", "type": "if", "loc": [394, 397], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "vector": [4, 1, 0.4962, 0.005, 1, 0.89, 0.1667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (u[:,2].T * p)[0,0] < 0:\n normal = -u[:,2]\n else:\n normal = u[:,2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L395_C8", "label": "normal =", "type": "assigned_variable", "loc": [395, 395], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L394_C4", "vector": [14, 2, 0.4956, 0.0013, 2, 0.5, 0.0, 444, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "normal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " normal = -u[:,2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L397_C8", "label": "normal =", "type": "assigned_variable", "loc": [397, 397], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L394_C4", "vector": [14, 2, 0.4981, 0.0013, 2, 0.5, 1.0, 444, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "normal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " normal = u[:,2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L400_C4", "label": "z_plus =", "type": "assigned_variable", "loc": [400, 400], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "vector": [14, 1, 0.5019, 0.0013, 1, 0.89, 0.25, 846, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "z_plus", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_plus = np.matrix([0, 0, 1.0]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L401_C4", "label": "x_plus =", "type": "assigned_variable", "loc": [401, 401], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "vector": [14, 1, 0.5031, 0.0013, 1, 0.89, 0.3333, 56, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "x_plus", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_plus = np.matrix([1, 0, 0.0]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L403_C4", "label": "u0 =", "type": "assigned_variable", "loc": [403, 403], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "vector": [14, 1, 0.5056, 0.0013, 1, 0.89, 0.4167, 247, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "u0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " u0 = u[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L404_C4", "label": "u1 =", "type": "assigned_variable", "loc": [404, 404], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "vector": [14, 1, 0.5069, 0.0013, 1, 0.89, 0.5, 74, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "u1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " u1 = u[:,1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L406_C4", "label": "mags =", "type": "assigned_variable", "loc": [406, 406], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "vector": [14, 1, 0.5094, 0.0013, 1, 0.89, 0.5833, 728, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "mags", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mags = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L407_C4", "label": "pos_dirs =", "type": "assigned_variable", "loc": [407, 407], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "vector": [14, 1, 0.5107, 0.0013, 1, 0.89, 0.6667, 24, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pos_dirs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos_dirs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L408_C4", "label": "for udir", "type": "for", "loc": [408, 411], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "vector": [6, 1, 0.5138, 0.005, 1, 0.89, 0.75, 171, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "udir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for udir in [u0, u1, -u0, -u1]:\n for can_dir in [z_plus, x_plus]:\n mags.append((udir.T * can_dir)[0,0])\n pos_dirs.append(udir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L409_C8", "label": "for can_dir", "type": "for", "loc": [409, 411], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L408_C4", "vector": [6, 2, 0.5144, 0.0038, 2, 0.87, 0.0, 695, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "can_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for can_dir in [z_plus, x_plus]:\n mags.append((udir.T * can_dir)[0,0])\n pos_dirs.append(udir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L410_C12", "label": "append()", "type": "expression", "loc": [410, 410], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L409_C8", "vector": [8, 3, 0.5144, 0.0013, 3, 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": " mags.append((udir.T * can_dir)[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L411_C12", "label": "append()", "type": "expression", "loc": [411, 411], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L409_C8", "vector": [8, 3, 0.5157, 0.0013, 3, 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": " pos_dirs.append(udir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L412_C4", "label": "x_dir =", "type": "assigned_variable", "loc": [412, 412], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "vector": [14, 1, 0.5169, 0.0013, 1, 0.89, 0.8333, 598, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "x_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_dir = pos_dirs[np.argmax(mags)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L415_C4", "label": "y_dir =", "type": "assigned_variable", "loc": [415, 415], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "vector": [14, 1, 0.5207, 0.0013, 1, 0.89, 0.9167, 366, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "y_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_dir = np.cross(normal.T, x_dir.T).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L416_C4", "label": "return", "type": "return", "loc": [416, 416], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "vector": [13, 1, 0.522, 0.0013, 1, 0.89, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix(np.column_stack([x_dir, y_dir, normal]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "label": "process_bag", "type": "function", "loc": [418, 566], "level": 0, "parent": null, "vector": [2, 0, 0.6173, 0.187, 0, 0.66, 0.973, 831, 0, 5, 0, 0, 0, 0, 70], "semantic": {"name": "process_bag", "arg_names": ["full_bag_name", "prosilica_image_file", "model_image_file", "experiment_start_condition_pkl", "arm_used"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def process_bag(full_bag_name, prosilica_image_file, model_image_file, experiment_start_condition_pkl, arm_used='left'):\n bag_path, bag_name_ext = os.path.split(full_bag_name)\n filename, ext = os.path.splitext(bag_name_ext)\n \n ###############################################################################\n # Playback the bag\n bag_playback = Process(target=playback_bag, args=(full_bag_name,))\n bag_playback.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L419_C4", "label": "bag_path, bag_name_ext = split()", "type": "assigned_variable", "loc": [419, 419], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.5257, 0.0013, 1, 0.82, 0.0, 186, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "bag_path, bag_name_ext", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " bag_path, bag_name_ext = os.path.split(full_bag_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L420_C4", "label": "filename, ext = splitext()", "type": "assigned_variable", "loc": [420, 420], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.527, 0.0013, 1, 0.82, 0.0208, 651, 3, 1, 0, 0, 622, 10, 1], "semantic": {"name": "filename, ext", "arg_names": [], "import_names": [], "rhs_call_name": "splitext", "annotation": ""}, "snippet": " filename, ext = os.path.splitext(bag_name_ext)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L424_C4", "label": "bag_playback = Process()", "type": "assigned_variable", "loc": [424, 424], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.532, 0.0013, 1, 0.82, 0.0417, 418, 3, 2, 0, 0, 303, 10, 1], "semantic": {"name": "bag_playback", "arg_names": [], "import_names": [], "rhs_call_name": "Process", "annotation": ""}, "snippet": " bag_playback = Process(target=playback_bag, args=(full_bag_name,))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L425_C4", "label": "start()", "type": "expression", "loc": [425, 425], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [8, 1, 0.5332, 0.0013, 1, 0.82, 0.0625, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " bag_playback.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L429_C4", "label": "init_node()", "type": "expression", "loc": [429, 429], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [8, 1, 0.5383, 0.0013, 1, 0.82, 0.0833, 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('bag_proceessor')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L431_C4", "label": "tl = TransformListener()", "type": "assigned_variable", "loc": [431, 431], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.5408, 0.0013, 1, 0.82, 0.1042, 731, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "tl", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " tl = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L433_C4", "label": "print()", "type": "expression", "loc": [433, 433], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [8, 1, 0.5433, 0.0013, 1, 0.82, 0.125, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('waiting for transform')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L434_C4", "label": "waitForTransform()", "type": "expression", "loc": [434, 434], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [8, 1, 0.5445, 0.0013, 1, 0.82, 0.1458, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " tl.waitForTransform('map', 'base_footprint', rospy.Time(), rospy.Duration(20))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L436_C4", "label": "p_base =", "type": "assigned_variable", "loc": [436, 437], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.5477, 0.0025, 1, 0.82, 0.1667, 544, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "p_base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_base = tfu.transform('map', 'base_footprint', tl) \\\n * tfu.tf_as_matrix(([0., 0., 0., 1.], tr.quaternion_from_euler(0,0,0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L438_C4", "label": "t, r = matrix_as_tf()", "type": "assigned_variable", "loc": [438, 438], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.5496, 0.0013, 1, 0.82, 0.1875, 361, 3, 1, 0, 0, 22, 10, 1], "semantic": {"name": "t, r", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_as_tf", "annotation": ""}, "snippet": " t, r = tfu.matrix_as_tf(p_base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L439_C4", "label": "pose_base =", "type": "assigned_variable", "loc": [439, 439], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.5508, 0.0013, 1, 0.82, 0.2083, 995, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "pose_base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose_base = (t, r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L440_C4", "label": "print()", "type": "expression", "loc": [440, 440], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [8, 1, 0.5521, 0.0013, 1, 0.82, 0.2292, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('done with tf')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L444_C4", "label": "start_conditions = load_pickle()", "type": "assigned_variable", "loc": [444, 444], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.5571, 0.0013, 1, 0.82, 0.25, 654, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "start_conditions", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " start_conditions = ut.load_pickle(experiment_start_condition_pkl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L445_C4", "label": "assign", "type": "assigned_variable", "loc": [445, 445], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.5583, 0.0013, 1, 0.82, 0.2708, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_conditions['highdef_image'] = prosilica_image_file"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L446_C4", "label": "assign", "type": "assigned_variable", "loc": [446, 446], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.5596, 0.0013, 1, 0.82, 0.2917, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_conditions['model_image'] = model_image_file"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L447_C4", "label": "loginfo()", "type": "expression", "loc": [447, 447], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [8, 1, 0.5609, 0.0013, 1, 0.82, 0.3125, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('extracting object localization features')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L448_C4", "label": " = extract_object_localization_features2()", "type": "assigned_variable", "loc": [448, 448], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.5621, 0.0013, 1, 0.82, 0.3333, 0, 3, 4, 0, 0, 701, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "extract_object_localization_features2", "annotation": ""}, "snippet": " start_conditions['pose_parameters'] = extract_object_localization_features2(start_conditions, tl, arm_used, p_base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L450_C4", "label": "if", "type": "if", "loc": [450, 456], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [4, 1, 0.5684, 0.0088, 1, 0.82, 0.3542, 0, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if bag_playback.is_alive():\n rospy.loginfo('Terminating playback process')\n bag_playback.terminate()\n time.sleep(1)\n bag_playback.terminate()\n time.sleep(1)\n rospy.loginfo('Playback process terminated? %s' % str(not bag_playback.is_alive()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L451_C8", "label": "loginfo()", "type": "expression", "loc": [451, 451], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L450_C4", "vector": [8, 2, 0.5659, 0.0013, 2, 0.81, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Terminating playback process')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L452_C8", "label": "terminate()", "type": "expression", "loc": [452, 452], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L450_C4", "vector": [8, 2, 0.5671, 0.0013, 2, 0.81, 0.2, 617, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "terminate", "arg_names": [], "import_names": [], "rhs_call_name": "terminate", "annotation": ""}, "snippet": " bag_playback.terminate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L453_C8", "label": "sleep()", "type": "expression", "loc": [453, 453], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L450_C4", "vector": [8, 2, 0.5684, 0.0013, 2, 0.81, 0.4, 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_99698:Expr_L454_C8", "label": "terminate()", "type": "expression", "loc": [454, 454], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L450_C4", "vector": [8, 2, 0.5696, 0.0013, 2, 0.81, 0.6, 617, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "terminate", "arg_names": [], "import_names": [], "rhs_call_name": "terminate", "annotation": ""}, "snippet": " bag_playback.terminate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L455_C8", "label": "sleep()", "type": "expression", "loc": [455, 455], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L450_C4", "vector": [8, 2, 0.5709, 0.0013, 2, 0.81, 0.8, 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_99698:Expr_L456_C8", "label": "loginfo()", "type": "expression", "loc": [456, 456], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L450_C4", "vector": [8, 2, 0.5721, 0.0013, 2, 0.81, 1.0, 607, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Playback process terminated? %s' % str(not bag_playback.is_alive()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L461_C4", "label": "pr2_kinematics = PR2Kinematics()", "type": "assigned_variable", "loc": [461, 461], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.5784, 0.0013, 1, 0.82, 0.375, 527, 3, 1, 0, 0, 444, 10, 1], "semantic": {"name": "pr2_kinematics", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Kinematics", "annotation": ""}, "snippet": " pr2_kinematics = pr2k.PR2Kinematics(tl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L462_C4", "label": "converter = JointMsgConverter()", "type": "assigned_variable", "loc": [462, 462], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.5797, 0.0013, 1, 0.82, 0.3958, 162, 3, 0, 0, 0, 728, 10, 1], "semantic": {"name": "converter", "arg_names": [], "import_names": [], "rhs_call_name": "JointMsgConverter", "annotation": ""}, "snippet": " converter = JointMsgConverter()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L463_C4", "label": "loginfo()", "type": "expression", "loc": [463, 463], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [8, 1, 0.5809, 0.0013, 1, 0.82, 0.4167, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('opening bag, reading state topics')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L464_C4", "label": "topics_dict = bag_sel()", "type": "assigned_variable", "loc": [464, 466], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.5834, 0.0038, 1, 0.82, 0.4375, 495, 3, 2, 0, 0, 463, 10, 1], "semantic": {"name": "topics_dict", "arg_names": [], "import_names": [], "rhs_call_name": "bag_sel", "annotation": ""}, "snippet": " topics_dict = ru.bag_sel(full_bag_name, ['/joint_states', '/l_cart/command_pose', \n '/r_cart/command_pose', '/torso_controller/state',\n '/pressure/l_gripper_motor', '/pressure/r_gripper_motor'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L469_C4", "label": "if", "type": "if", "loc": [469, 474], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [4, 1, 0.5916, 0.0075, 1, 0.82, 0.4583, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm_used == 'left':\n pressures = topics_dict['/pressure/l_gripper_motor']\n elif arm_used == 'right':\n pressures = topics_dict['/pressure/r_gripper_motor']\n else:\n raise RuntimeError('arm_used invalid')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L470_C8", "label": "pressures =", "type": "assigned_variable", "loc": [470, 470], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L469_C4", "vector": [14, 2, 0.5897, 0.0013, 2, 0.23, 0.0, 429, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pressures", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pressures = topics_dict['/pressure/l_gripper_motor']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L471_C4", "label": "if", "type": "if", "loc": [471, 474], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L469_C4", "vector": [4, 2, 0.5928, 0.005, 2, 0.23, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif arm_used == 'right':\n pressures = topics_dict['/pressure/r_gripper_motor']\n else:\n raise RuntimeError('arm_used invalid')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L472_C8", "label": "pressures =", "type": "assigned_variable", "loc": [472, 472], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L471_C4", "vector": [14, 3, 0.5922, 0.0013, 3, 0.58, 0.0, 429, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pressures", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pressures = topics_dict['/pressure/r_gripper_motor']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L477_C4", "label": "loginfo()", "type": "expression", "loc": [477, 477], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [8, 1, 0.5985, 0.0013, 1, 0.82, 0.4792, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Finding contact times')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L478_C4", "label": "left_f, right_f, ptimes = pressure_state_to_mat()", "type": "assigned_variable", "loc": [478, 478], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.5997, 0.0013, 1, 0.82, 0.5, 733, 3, 1, 0, 0, 871, 10, 1], "semantic": {"name": "left_f, right_f, ptimes", "arg_names": [], "import_names": [], "rhs_call_name": "pressure_state_to_mat", "annotation": ""}, "snippet": " left_f, right_f, ptimes = hpr2.pressure_state_to_mat(pressures['msg'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L482_C4", "label": "contact_times = find_contact_times()", "type": "assigned_variable", "loc": [482, 482], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.6048, 0.0013, 1, 0.82, 0.5208, 835, 3, 4, 0, 0, 852, 10, 1], "semantic": {"name": "contact_times", "arg_names": [], "import_names": [], "rhs_call_name": "find_contact_times", "annotation": ""}, "snippet": " contact_times = find_contact_times(left_f, right_f, ptimes, 250)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L483_C4", "label": "if", "type": "if", "loc": [483, 486], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [4, 1, 0.6079, 0.005, 1, 0.82, 0.5417, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(contact_times) > 2:\n time_segments = [['start', contact_times[0]], [contact_times[0], contact_times[-1]], [contact_times[-1], 'end']]\n else:\n time_segments = [['start', 'end']]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L484_C8", "label": "time_segments =", "type": "assigned_variable", "loc": [484, 484], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L483_C4", "vector": [14, 2, 0.6073, 0.0013, 2, 0.62, 0.0, 92, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "time_segments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_segments = [['start', contact_times[0]], [contact_times[0], contact_times[-1]], [contact_times[-1], 'end']]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L486_C8", "label": "time_segments =", "type": "assigned_variable", "loc": [486, 486], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L483_C4", "vector": [14, 2, 0.6098, 0.0013, 2, 0.62, 1.0, 92, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "time_segments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_segments = [['start', 'end']]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L488_C4", "label": "loginfo()", "type": "expression", "loc": [488, 488], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [8, 1, 0.6123, 0.0013, 1, 0.82, 0.5625, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Splitting messages based on contact times')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L490_C4", "label": "pressure_lseg = segment_msgs()", "type": "assigned_variable", "loc": [490, 490], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.6148, 0.0013, 1, 0.82, 0.5833, 35, 3, 2, 0, 0, 465, 10, 1], "semantic": {"name": "pressure_lseg", "arg_names": [], "import_names": [], "rhs_call_name": "segment_msgs", "annotation": ""}, "snippet": " pressure_lseg = segment_msgs(time_segments, topics_dict['/pressure/l_gripper_motor']['msg'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L491_C4", "label": "pressure_rseg = segment_msgs()", "type": "assigned_variable", "loc": [491, 491], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.6161, 0.0013, 1, 0.82, 0.6042, 964, 3, 2, 0, 0, 465, 10, 1], "semantic": {"name": "pressure_rseg", "arg_names": [], "import_names": [], "rhs_call_name": "segment_msgs", "annotation": ""}, "snippet": " pressure_rseg = segment_msgs(time_segments, topics_dict['/pressure/r_gripper_motor']['msg'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L494_C4", "label": "lcart_seg = segment_msgs()", "type": "assigned_variable", "loc": [494, 494], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.6198, 0.0013, 1, 0.82, 0.625, 877, 3, 2, 0, 0, 465, 10, 1], "semantic": {"name": "lcart_seg", "arg_names": [], "import_names": [], "rhs_call_name": "segment_msgs", "annotation": ""}, "snippet": " lcart_seg = segment_msgs(time_segments, topics_dict['/l_cart/command_pose']['msg'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L495_C4", "label": "rcart_seg = segment_msgs()", "type": "assigned_variable", "loc": [495, 495], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.6211, 0.0013, 1, 0.82, 0.6458, 839, 3, 2, 0, 0, 465, 10, 1], "semantic": {"name": "rcart_seg", "arg_names": [], "import_names": [], "rhs_call_name": "segment_msgs", "annotation": ""}, "snippet": " rcart_seg = segment_msgs(time_segments, topics_dict['/r_cart/command_pose']['msg'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L498_C4", "label": "joint_states =", "type": "assigned_variable", "loc": [498, 498], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.6248, 0.0013, 1, 0.82, 0.6667, 368, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "joint_states", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joint_states = topics_dict['/joint_states']['msg']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L499_C4", "label": "print()", "type": "expression", "loc": [499, 499], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [8, 1, 0.6261, 0.0013, 1, 0.82, 0.6875, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('there are %d joint state messages in bag' % len(joint_states))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L501_C4", "label": "j_segs = segment_msgs()", "type": "assigned_variable", "loc": [501, 501], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.6286, 0.0013, 1, 0.82, 0.7083, 346, 3, 2, 0, 0, 465, 10, 1], "semantic": {"name": "j_segs", "arg_names": [], "import_names": [], "rhs_call_name": "segment_msgs", "annotation": ""}, "snippet": " j_segs = segment_msgs(time_segments, topics_dict['/joint_states']['msg'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L502_C4", "label": "jseg_dicts =", "type": "assigned_variable", "loc": [502, 502], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.6299, 0.0013, 1, 0.82, 0.7292, 918, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "jseg_dicts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jseg_dicts = [converter.msgs_to_dict(seg) for seg in j_segs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L504_C4", "label": "j0_dict =", "type": "assigned_variable", "loc": [504, 504], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.6324, 0.0013, 1, 0.82, 0.75, 234, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "j0_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " j0_dict = jseg_dicts[0][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L507_C4", "label": "loginfo()", "type": "expression", "loc": [507, 507], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [8, 1, 0.6361, 0.0013, 1, 0.82, 0.7708, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Performing FK to find tip locations')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L508_C4", "label": "bf_T_obj = composeHomogeneousTransform()", "type": "assigned_variable", "loc": [508, 509], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.638, 0.0025, 1, 0.82, 0.7917, 279, 3, 2, 0, 0, 126, 10, 1], "semantic": {"name": "bf_T_obj", "arg_names": [], "import_names": [], "rhs_call_name": "composeHomogeneousTransform", "annotation": ""}, "snippet": " bf_T_obj = htf.composeHomogeneousTransform(start_conditions['pose_parameters']['frame_bf'], \n start_conditions['pose_parameters']['center_bf'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L510_C4", "label": "obj_T_bf = inv()", "type": "assigned_variable", "loc": [510, 510], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.6399, 0.0013, 1, 0.82, 0.8125, 282, 3, 1, 0, 0, 761, 10, 1], "semantic": {"name": "obj_T_bf", "arg_names": [], "import_names": [], "rhs_call_name": "inv", "annotation": ""}, "snippet": " obj_T_bf = np.linalg.inv(bf_T_obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L511_C4", "label": "for jseg_dict", "type": "for", "loc": [511, 526], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [6, 1, 0.6506, 0.0201, 1, 0.82, 0.8333, 63, 2, 0, 0, 0, 0, 0, 8], "semantic": {"name": "jseg_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for jseg_dict in jseg_dicts:\n for d in jseg_dict:\n rtip_bf = pr2_kinematics.right.fk('base_footprint',\n 'r_wrist_roll_link', 'r_gripper_tool_frame',\n d['poses']['rarm'].A1.tolist())\n ltip_bf = pr2_kinematics.left.fk('base_footprint',\n 'l_wrist_roll_link', 'l_gripper_tool_frame',\n d['poses']['larm'].A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L512_C8", "label": "for d", "type": "for", "loc": [512, 526], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L511_C4", "vector": [6, 2, 0.6512, 0.0188, 2, 0.4, 0.0, 355, 2, 0, 0, 0, 0, 0, 8], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for d in jseg_dict:\n rtip_bf = pr2_kinematics.right.fk('base_footprint',\n 'r_wrist_roll_link', 'r_gripper_tool_frame',\n d['poses']['rarm'].A1.tolist())\n ltip_bf = pr2_kinematics.left.fk('base_footprint',\n 'l_wrist_roll_link', 'l_gripper_tool_frame',\n d['poses']['larm'].A1.tolist())\n rtip_obj = obj_T_bf * rtip_bf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L513_C12", "label": "rtip_bf = fk()", "type": "assigned_variable", "loc": [513, 515], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L512_C8", "vector": [14, 3, 0.6449, 0.0038, 3, 0.84, 0.0, 295, 3, 4, 0, 0, 714, 10, 2], "semantic": {"name": "rtip_bf", "arg_names": [], "import_names": [], "rhs_call_name": "fk", "annotation": ""}, "snippet": " rtip_bf = pr2_kinematics.right.fk('base_footprint',\n 'r_wrist_roll_link', 'r_gripper_tool_frame',\n d['poses']['rarm'].A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L516_C12", "label": "ltip_bf = fk()", "type": "assigned_variable", "loc": [516, 518], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L512_C8", "vector": [14, 3, 0.6487, 0.0038, 3, 0.84, 0.1429, 57, 3, 4, 0, 0, 714, 10, 2], "semantic": {"name": "ltip_bf", "arg_names": [], "import_names": [], "rhs_call_name": "fk", "annotation": ""}, "snippet": " ltip_bf = pr2_kinematics.left.fk('base_footprint',\n 'l_wrist_roll_link', 'l_gripper_tool_frame',\n d['poses']['larm'].A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L519_C12", "label": "rtip_obj =", "type": "assigned_variable", "loc": [519, 519], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L512_C8", "vector": [14, 3, 0.6512, 0.0013, 3, 0.84, 0.2857, 121, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rtip_obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rtip_obj = obj_T_bf * rtip_bf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L520_C12", "label": "ltip_obj =", "type": "assigned_variable", "loc": [520, 520], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L512_C8", "vector": [14, 3, 0.6524, 0.0013, 3, 0.84, 0.4286, 684, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ltip_obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ltip_obj = obj_T_bf * ltip_bf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L522_C12", "label": " = matrix_as_tf()", "type": "assigned_variable", "loc": [522, 522], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L512_C8", "vector": [14, 3, 0.655, 0.0013, 3, 0.84, 0.5714, 0, 3, 1, 0, 0, 22, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_as_tf", "annotation": ""}, "snippet": " d['rtip_obj'] = tfu.matrix_as_tf(rtip_obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L523_C12", "label": " = matrix_as_tf()", "type": "assigned_variable", "loc": [523, 523], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L512_C8", "vector": [14, 3, 0.6562, 0.0013, 3, 0.84, 0.7143, 0, 3, 1, 0, 0, 22, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_as_tf", "annotation": ""}, "snippet": " d['ltip_obj'] = tfu.matrix_as_tf(ltip_obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L525_C12", "label": " = matrix_as_tf()", "type": "assigned_variable", "loc": [525, 525], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L512_C8", "vector": [14, 3, 0.6587, 0.0013, 3, 0.84, 0.8571, 0, 3, 1, 0, 0, 22, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_as_tf", "annotation": ""}, "snippet": " d['rtip_bf'] = tfu.matrix_as_tf(rtip_bf)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L526_C12", "label": " = matrix_as_tf()", "type": "assigned_variable", "loc": [526, 526], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L512_C8", "vector": [14, 3, 0.66, 0.0013, 3, 0.84, 1.0, 0, 3, 1, 0, 0, 22, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_as_tf", "annotation": ""}, "snippet": " d['ltip_bf'] = tfu.matrix_as_tf(ltip_bf)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L530_C4", "label": "movement_states =", "type": "assigned_variable", "loc": [530, 530], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.665, 0.0013, 1, 0.82, 0.8542, 388, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "movement_states", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " movement_states = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L531_C4", "label": "for i, seg", "type": "for", "loc": [531, 547], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [6, 1, 0.6763, 0.0213, 1, 0.82, 0.875, 495, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "i, seg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, seg in enumerate(time_segments):\n name = \"state_%d\" % i\n start_times = [lcart_seg[i][0].header.stamp.to_time(), \n rcart_seg[i][0].header.stamp.to_time(), \n jseg_dicts[i][0]['time'],\n pressure_lseg[i][0].header.stamp.to_time(), \n pressure_rseg[i][0].header.stamp.to_time()]\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L532_C8", "label": "name =", "type": "assigned_variable", "loc": [532, 532], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L531_C4", "vector": [14, 2, 0.6675, 0.0013, 2, 0.01, 0.0, 57, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = \"state_%d\" % i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L533_C8", "label": "start_times =", "type": "assigned_variable", "loc": [533, 537], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L531_C4", "vector": [14, 2, 0.6713, 0.0063, 2, 0.01, 0.3333, 800, 0, 0, 0, 0, 0, 5, 4], "semantic": {"name": "start_times", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_times = [lcart_seg[i][0].header.stamp.to_time(), \n rcart_seg[i][0].header.stamp.to_time(), \n jseg_dicts[i][0]['time'],\n pressure_lseg[i][0].header.stamp.to_time(), \n pressure_rseg[i][0].header.stamp.to_time()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L539_C8", "label": "sdict =", "type": "assigned_variable", "loc": [539, 545], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L531_C4", "vector": [14, 2, 0.6801, 0.0088, 2, 0.01, 0.6667, 575, 0, 0, 0, 0, 0, 6, 3], "semantic": {"name": "sdict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sdict = {'name': name,\n 'start_time': np.min(start_times),\n 'cartesian': [[ru.ros_to_dict(ps) for ps in lcart_seg[i]], \n [ru.ros_to_dict(ps) for ps in rcart_seg[i]]],\n 'joint_states': jseg_dicts[i]\n #'pressure': [pressure_lseg[i], pressure_rseg[i]]\n } "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L547_C8", "label": "append()", "type": "expression", "loc": [547, 547], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L531_C4", "vector": [8, 2, 0.6863, 0.0013, 2, 0.01, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " movement_states.append(sdict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L550_C4", "label": "data =", "type": "assigned_variable", "loc": [550, 559], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.6957, 0.0125, 1, 0.82, 0.8958, 929, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data = {'start_conditions': start_conditions, # ['camera_info', 'map_T_bf', 'pro_T_bf', 'points' (in base_frame), \n # 'highdef_image', 'model_image',\n ## 'pose_parameters'\n ## 'descriptors'\n ## 'directions' (wrt to cannonical orientation)\n ## 'closest_feature'\n 'base_pose': pose_base, \n 'robot_pose': j0_dict,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L562_C4", "label": "processed_bag_name =", "type": "assigned_variable", "loc": [562, 562], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [14, 1, 0.7051, 0.0013, 1, 0.82, 0.9167, 497, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "processed_bag_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " processed_bag_name = '%s_processed.pkl' % os.path.join(bag_path, filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L563_C4", "label": "loginfo()", "type": "expression", "loc": [563, 563], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [8, 1, 0.7064, 0.0013, 1, 0.82, 0.9375, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('saving to %s' % processed_bag_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L564_C4", "label": "save_pickle()", "type": "expression", "loc": [564, 564], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [8, 1, 0.7077, 0.0013, 1, 0.82, 0.9583, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(data, processed_bag_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L565_C4", "label": "join()", "type": "expression", "loc": [565, 565], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [8, 1, 0.7089, 0.0013, 1, 0.82, 0.9792, 933, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " bag_playback.join()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L566_C4", "label": "loginfo()", "type": "expression", "loc": [566, 566], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "vector": [8, 1, 0.7102, 0.0013, 1, 0.82, 1.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('finished!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L570_C0", "label": "if", "type": "if", "loc": [570, 577], "level": 0, "parent": null, "vector": [4, 0, 0.7196, 0.01, 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 arm_used = 'left'\n full_bag_name = sys.argv[1]\n prosilica_image_file = sys.argv[2]\n model_image_file = sys.argv[3]\n experiment_start_condition_pkl = sys.argv[4]\n\n process_bag(full_bag_name, prosilica_image_file, model_image_file, experiment_start_condition_pkl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L571_C4", "label": "arm_used =", "type": "assigned_variable", "loc": [571, 571], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L570_C0", "vector": [14, 1, 0.7164, 0.0013, 1, 0.29, 0.0, 683, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "arm_used", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm_used = 'left'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L572_C4", "label": "full_bag_name =", "type": "assigned_variable", "loc": [572, 572], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L570_C0", "vector": [14, 1, 0.7177, 0.0013, 1, 0.29, 0.2, 36, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "full_bag_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " full_bag_name = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L573_C4", "label": "prosilica_image_file =", "type": "assigned_variable", "loc": [573, 573], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L570_C0", "vector": [14, 1, 0.7189, 0.0013, 1, 0.29, 0.4, 223, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prosilica_image_file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prosilica_image_file = sys.argv[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L574_C4", "label": "model_image_file =", "type": "assigned_variable", "loc": [574, 574], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L570_C0", "vector": [14, 1, 0.7202, 0.0013, 1, 0.29, 0.6, 550, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "model_image_file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " model_image_file = sys.argv[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L575_C4", "label": "experiment_start_condition_pkl =", "type": "assigned_variable", "loc": [575, 575], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L570_C0", "vector": [14, 1, 0.7215, 0.0013, 1, 0.29, 0.8, 551, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "experiment_start_condition_pkl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " experiment_start_condition_pkl = sys.argv[4]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L577_C4", "label": "process_bag()", "type": "expression", "loc": [577, 577], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L570_C0", "vector": [8, 1, 0.724, 0.0013, 1, 0.29, 1.0, 831, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "process_bag", "arg_names": [], "import_names": [], "rhs_call_name": "process_bag", "annotation": ""}, "snippet": " process_bag(full_bag_name, prosilica_image_file, model_image_file, experiment_start_condition_pkl)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L36_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L37_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L38_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L38_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L39_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L44_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L45_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L45_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L46_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:ClassDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:ClassDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:ClassDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L138_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L138_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L139_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L138_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L141_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L142_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L146_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L148_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L149_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L148_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L150_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L151_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:ClassDef_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:ClassDef_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L170_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L170_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L171_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L170_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L172_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L172_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L173_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L170_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L175_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L170_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L176_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L176_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L177_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L179_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L180_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L181_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L183_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L183_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L185_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L183_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L186_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L186_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L187_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L188_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L192_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L192_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L193_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L192_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L194_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L194_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L195_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L194_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L196_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L194_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L197_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L194_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L199_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L194_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L200_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L209_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L209_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L213_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L209_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L209_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L220_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L209_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L223_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L224_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L223_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:While_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:While_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:While_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L223_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L230_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L223_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L232_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L223_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L223_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L223_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L238_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L241_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L245_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L246_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L250_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L250_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L254_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L250_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L255_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L250_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L265_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L250_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L266_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L250_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L267_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L250_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L268_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L275_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L278_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L281_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L284_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L285_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L286_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L287_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L288_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L290_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L293_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L294_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L295_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L296_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L297_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L298_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L300_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L301_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L321_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L322_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:While_L323_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:While_L323_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L324_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L325_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L328_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L329_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L332_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L333_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L334_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L335_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L336_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L342_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L343_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L344_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L345_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L348_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L349_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L350_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L353_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L354_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L357_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L358_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L359_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L361_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L364_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L365_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L367_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L390_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L391_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L394_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L395_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L397_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L400_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L401_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L403_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L404_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L406_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L407_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L408_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L408_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L409_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L409_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L410_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L409_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L411_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L412_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L415_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L388_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Return_L416_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L419_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L420_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L424_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L425_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L429_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L431_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L433_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L434_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L436_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L438_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L439_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L440_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L444_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L445_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L446_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L447_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L448_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L450_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L450_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L451_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L450_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L452_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L450_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L453_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L450_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L454_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L450_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L455_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L450_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L456_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L461_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L462_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L463_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L464_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L469_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L469_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L470_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L469_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L471_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L471_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L472_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L477_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L478_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L482_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L483_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L483_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L484_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L483_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L486_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L488_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L490_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L491_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L494_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L495_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L498_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L499_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L501_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L502_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L504_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L507_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L508_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L510_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L511_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L511_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L512_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L512_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L513_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L512_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L516_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L512_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L519_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L512_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L520_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L512_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L522_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L512_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L523_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L512_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L525_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L512_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L526_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L530_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L531_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L531_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L532_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L531_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L533_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L531_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L539_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:For_L531_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L547_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L550_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L562_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L563_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L564_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L565_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:FunctionDef_L418_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L566_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L570_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L571_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L570_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L572_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L570_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L573_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L570_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L574_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L570_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Assign_L575_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99698:If_L570_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99698:Expr_L577_C4"}]
import roslib; roslib.load_manifest('hai_sandbox') import rospy import hai_sandbox.recognize_3d as r3d import hrl_lib.util as ut import cv import sys fname = sys.argv[1] pkl = ut.load_pickle(fname) image_name = pkl['image'] img = cv.LoadImageM(image_name) #Draw the center r3d.draw_points(img, pkl['center'], [255, 0, 0], 6, 2) if pkl.has_key('pos'): pos_exp = pkl['pos'] neg_exp = pkl['neg'] #Draw points tried r3d.draw_points(img, pos_exp, [50, 255, 0], 9, 1) r3d.draw_points(img, neg_exp, [50, 0, 255], 9, 1) if pkl.has_key('pos_pred'): pos_pred = pkl['pos_pred'] neg_pred = pkl['neg_pred'] #Draw prediction r3d.draw_points(img, pos_pred, [255, 204, 51], 3, -1) r3d.draw_points(img, neg_pred, [51, 204, 255], 3, -1) #Draw what we're selecting tried_point, label = pkl['tried'] if label == r3d.POSITIVE: color = [0,255,0] else: color = [0,0,255] r3d.draw_points(img, tried_point, color, 8, -1) cv.NamedWindow('task relevant learner display', cv.CV_WINDOW_AUTOSIZE) cv.ShowImage('task relevant learner display', img) while True: cv.WaitKey(33)
ajibawa-2023/Python-Code-Large/train/row_99699
31
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_99699:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0233, 0.0233, 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; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0233, 0.0233, 0, 0.66, 0.0526, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hai_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0465, 0.0233, 0, 0.66, 0.1053, 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_99699:Import_L4_C0", "label": "hai_sandbox.recognize_3d import r3d", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.093, 0.0233, 0, 0.66, 0.1579, 520, 0, 1, 0, 0, 520, 0, 0], "semantic": {"name": "hai_sandbox.recognize_3d", "arg_names": [], "import_names": ["r3d"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hai_sandbox.recognize_3d as r3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Import_L5_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1163, 0.0233, 0, 0.66, 0.2105, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Import_L6_C0", "label": "cv import cv", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1395, 0.0233, 0, 0.66, 0.2632, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Import_L7_C0", "label": "sys import sys", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1628, 0.0233, 0, 0.66, 0.3158, 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_99699:Assign_L9_C0", "label": "fname =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.2093, 0.0233, 0, 0.66, 0.3684, 190, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "fname = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Assign_L10_C0", "label": "pkl = load_pickle()", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2326, 0.0233, 0, 0.66, 0.4211, 419, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "pkl", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": "pkl = ut.load_pickle(fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Assign_L11_C0", "label": "image_name =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.2558, 0.0233, 0, 0.66, 0.4737, 199, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "image_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "image_name = pkl['image']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Assign_L12_C0", "label": "img = LoadImageM()", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.2791, 0.0233, 0, 0.66, 0.5263, 200, 3, 1, 0, 0, 859, 10, 1], "semantic": {"name": "img", "arg_names": [], "import_names": [], "rhs_call_name": "LoadImageM", "annotation": ""}, "snippet": "img = cv.LoadImageM(image_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Expr_L15_C0", "label": "draw_points()", "type": "expression", "loc": [15, 15], "level": 0, "parent": null, "vector": [8, 0, 0.3488, 0.0233, 0, 0.66, 0.5789, 154, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "draw_points", "arg_names": [], "import_names": [], "rhs_call_name": "draw_points", "annotation": ""}, "snippet": "r3d.draw_points(img, pkl['center'], [255, 0, 0], 6, 2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L17_C0", "label": "if", "type": "if", "loc": [17, 22], "level": 0, "parent": null, "vector": [4, 0, 0.4535, 0.1395, 0, 0.66, 0.6316, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if pkl.has_key('pos'):\n pos_exp = pkl['pos']\n neg_exp = pkl['neg']\n #Draw points tried\n r3d.draw_points(img, pos_exp, [50, 255, 0], 9, 1)\n r3d.draw_points(img, neg_exp, [50, 0, 255], 9, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Assign_L18_C4", "label": "pos_exp =", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L17_C0", "vector": [14, 1, 0.4186, 0.0233, 1, 0.72, 0.0, 344, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos_exp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos_exp = pkl['pos']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Assign_L19_C4", "label": "neg_exp =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L17_C0", "vector": [14, 1, 0.4419, 0.0233, 1, 0.72, 0.3333, 409, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "neg_exp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " neg_exp = pkl['neg']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Expr_L21_C4", "label": "draw_points()", "type": "expression", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L17_C0", "vector": [8, 1, 0.4884, 0.0233, 1, 0.72, 0.6667, 154, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "draw_points", "arg_names": [], "import_names": [], "rhs_call_name": "draw_points", "annotation": ""}, "snippet": " r3d.draw_points(img, pos_exp, [50, 255, 0], 9, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Expr_L22_C4", "label": "draw_points()", "type": "expression", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L17_C0", "vector": [8, 1, 0.5116, 0.0233, 1, 0.72, 1.0, 154, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "draw_points", "arg_names": [], "import_names": [], "rhs_call_name": "draw_points", "annotation": ""}, "snippet": " r3d.draw_points(img, neg_exp, [50, 0, 255], 9, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L24_C0", "label": "if", "type": "if", "loc": [24, 29], "level": 0, "parent": null, "vector": [4, 0, 0.6163, 0.1395, 0, 0.66, 0.6842, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if pkl.has_key('pos_pred'):\n pos_pred = pkl['pos_pred']\n neg_pred = pkl['neg_pred']\n #Draw prediction \n r3d.draw_points(img, pos_pred, [255, 204, 51], 3, -1)\n r3d.draw_points(img, neg_pred, [51, 204, 255], 3, -1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Assign_L25_C4", "label": "pos_pred =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L24_C0", "vector": [14, 1, 0.5814, 0.0233, 1, 0.8, 0.0, 967, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos_pred", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos_pred = pkl['pos_pred']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Assign_L26_C4", "label": "neg_pred =", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L24_C0", "vector": [14, 1, 0.6047, 0.0233, 1, 0.8, 0.3333, 430, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "neg_pred", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " neg_pred = pkl['neg_pred']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Expr_L28_C4", "label": "draw_points()", "type": "expression", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L24_C0", "vector": [8, 1, 0.6512, 0.0233, 1, 0.8, 0.6667, 154, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "draw_points", "arg_names": [], "import_names": [], "rhs_call_name": "draw_points", "annotation": ""}, "snippet": " r3d.draw_points(img, pos_pred, [255, 204, 51], 3, -1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Expr_L29_C4", "label": "draw_points()", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L24_C0", "vector": [8, 1, 0.6744, 0.0233, 1, 0.8, 1.0, 154, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "draw_points", "arg_names": [], "import_names": [], "rhs_call_name": "draw_points", "annotation": ""}, "snippet": " r3d.draw_points(img, neg_pred, [51, 204, 255], 3, -1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Assign_L33_C0", "label": "tried_point, label =", "type": "assigned_variable", "loc": [33, 33], "level": 0, "parent": null, "vector": [14, 0, 0.7674, 0.0233, 0, 0.66, 0.7368, 313, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tried_point, label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "tried_point, label = pkl['tried']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L34_C0", "label": "if", "type": "if", "loc": [34, 37], "level": 0, "parent": null, "vector": [4, 0, 0.8256, 0.093, 0, 0.66, 0.7895, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if label == r3d.POSITIVE:\n color = [0,255,0]\nelse:\n color = [0,0,255]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Assign_L35_C4", "label": "color =", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L34_C0", "vector": [14, 1, 0.814, 0.0233, 1, 0.58, 0.0, 776, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " color = [0,255,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Assign_L37_C4", "label": "color =", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L34_C0", "vector": [14, 1, 0.8605, 0.0233, 1, 0.58, 1.0, 776, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " color = [0,0,255]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Expr_L38_C0", "label": "draw_points()", "type": "expression", "loc": [38, 38], "level": 0, "parent": null, "vector": [8, 0, 0.8837, 0.0233, 0, 0.66, 0.8421, 154, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "draw_points", "arg_names": [], "import_names": [], "rhs_call_name": "draw_points", "annotation": ""}, "snippet": "r3d.draw_points(img, tried_point, color, 8, -1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Expr_L40_C0", "label": "NamedWindow()", "type": "expression", "loc": [40, 40], "level": 0, "parent": null, "vector": [8, 0, 0.9302, 0.0233, 0, 0.66, 0.8947, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": "cv.NamedWindow('task relevant learner display', cv.CV_WINDOW_AUTOSIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Expr_L41_C0", "label": "ShowImage()", "type": "expression", "loc": [41, 41], "level": 0, "parent": null, "vector": [8, 0, 0.9535, 0.0233, 0, 0.66, 0.9474, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": "cv.ShowImage('task relevant learner display', img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:While_L42_C0", "label": "while", "type": "while", "loc": [42, 43], "level": 0, "parent": null, "vector": [5, 0, 0.9884, 0.0465, 0, 0.66, 1.0, 0, 1, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "while True:\n cv.WaitKey(33)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99699:Expr_L43_C4", "label": "WaitKey()", "type": "expression", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99699:While_L42_C0", "vector": [8, 1, 1.0, 0.0233, 1, 0.49, 0.0, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "WaitKey", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " cv.WaitKey(33)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99699:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99699:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99699:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99699:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99699:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99699:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99699:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99699:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99699:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99699:If_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99699:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99699:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99699:Expr_L43_C4"}]
import roslib roslib.load_manifest('trigger_msgs') import sys import rospy import trigger_msgs.msg rospy.init_node("trigger", anonymous=True) head_up = rospy.Publisher("head_up", trigger_msgs.msg.Trigger, latch = True) head_down = rospy.Publisher("head_down", trigger_msgs.msg.Trigger, latch = True) arm_on = rospy.Publisher("arm_on", trigger_msgs.msg.Trigger, latch = True) arm_off = rospy.Publisher("arm_off", trigger_msgs.msg.Trigger, latch = True) r = rospy.Rate(60/60.) i = 1 while not rospy.is_shutdown(): print '------------', i, '-------------' if i > 4: if i % 2 == 1: #Down print 'down' head_down.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.0)), rospy.get_param("~event", "")) if i % 2 == 0: #Up print 'up' head_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.0)), rospy.get_param("~event", "")) if i % 4 == 1: arm_on.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.0)), rospy.get_param("~event", "")) if i % 4 == 3: arm_off.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.0)), rospy.get_param("~event", "")) i = i+1 r.sleep()
ajibawa-2023/Python-Code-Large/train/row_99700
27
38
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99700:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0263, 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_99700:Expr_L2_C0", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0526, 0.0263, 0, 0.66, 0.0833, 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('trigger_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0789, 0.0263, 0, 0.66, 0.1667, 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_99700:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1053, 0.0263, 0, 0.66, 0.25, 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_99700:Import_L6_C0", "label": "trigger_msgs.msg import trigger_msgs.msg", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1579, 0.0263, 0, 0.66, 0.3333, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "trigger_msgs.msg", "arg_names": [], "import_names": ["trigger_msgs.msg"], "rhs_call_name": "", "annotation": ""}, "snippet": "import trigger_msgs.msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:Expr_L8_C0", "label": "init_node()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.2105, 0.0263, 0, 0.66, 0.4167, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": "rospy.init_node(\"trigger\", anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:Assign_L9_C0", "label": "head_up = Publisher()", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.2368, 0.0263, 0, 0.66, 0.5, 73, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "head_up", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "head_up = rospy.Publisher(\"head_up\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:Assign_L10_C0", "label": "head_down = Publisher()", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2632, 0.0263, 0, 0.66, 0.5833, 131, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "head_down", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "head_down = rospy.Publisher(\"head_down\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:Assign_L11_C0", "label": "arm_on = Publisher()", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.2895, 0.0263, 0, 0.66, 0.6667, 694, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "arm_on", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "arm_on = rospy.Publisher(\"arm_on\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:Assign_L12_C0", "label": "arm_off = Publisher()", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.3158, 0.0263, 0, 0.66, 0.75, 512, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "arm_off", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "arm_off = rospy.Publisher(\"arm_off\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:Assign_L13_C0", "label": "r = Rate()", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.3421, 0.0263, 0, 0.66, 0.8333, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": "r = rospy.Rate(60/60.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:Assign_L15_C0", "label": "i =", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.3947, 0.0263, 0, 0.66, 0.9167, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "i = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:While_L16_C0", "label": "while", "type": "while", "loc": [16, 38], "level": 0, "parent": null, "vector": [5, 0, 0.7105, 0.6053, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 25], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "while not rospy.is_shutdown():\n print('------------', i, '-------------')\n\n if i > 4:\n if i % 2 == 1:\n #Down\n print('down')\n head_down.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:Expr_L17_C4", "label": "print()", "type": "expression", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99700:While_L16_C0", "vector": [8, 1, 0.4474, 0.0263, 1, 0.25, 0.0, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('------------', i, '-------------')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L19_C4", "label": "if", "type": "if", "loc": [19, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99700:While_L16_C0", "vector": [4, 1, 0.6184, 0.2632, 1, 0.25, 0.2, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i > 4:\n if i % 2 == 1:\n #Down\n print('down')\n head_down.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.0)), rospy.get_param(\"~event\", \"\"))\n\n if i % 2 == 0:\n #Up"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L20_C8", "label": "if", "type": "if", "loc": [20, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L19_C4", "vector": [4, 2, 0.5658, 0.1053, 2, 0.54, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i % 2 == 1:\n #Down\n print('down')\n head_down.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:Expr_L22_C12", "label": "print()", "type": "expression", "loc": [22, 22], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L20_C8", "vector": [8, 3, 0.5789, 0.0263, 3, 0.37, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('down')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:Expr_L23_C12", "label": "publish()", "type": "expression", "loc": [23, 23], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L20_C8", "vector": [8, 3, 0.6053, 0.0263, 3, 0.37, 1.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " head_down.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L25_C8", "label": "if", "type": "if", "loc": [25, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L19_C4", "vector": [4, 2, 0.6974, 0.1053, 2, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i % 2 == 0:\n #Up\n print('up')\n head_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:Expr_L27_C12", "label": "print()", "type": "expression", "loc": [27, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L25_C8", "vector": [8, 3, 0.7105, 0.0263, 3, 0.07, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('up')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:Expr_L28_C12", "label": "publish()", "type": "expression", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L25_C8", "vector": [8, 3, 0.7368, 0.0263, 3, 0.07, 1.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " head_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L30_C4", "label": "if", "type": "if", "loc": [30, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99700:While_L16_C0", "vector": [4, 1, 0.8026, 0.0526, 1, 0.25, 0.4, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i % 4 == 1:\n arm_on.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:Expr_L31_C8", "label": "publish()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L30_C4", "vector": [8, 2, 0.8158, 0.0263, 2, 0.35, 0.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " arm_on.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L33_C4", "label": "if", "type": "if", "loc": [33, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99700:While_L16_C0", "vector": [4, 1, 0.8816, 0.0526, 1, 0.25, 0.6, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i % 4 == 3:\n arm_off.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:Expr_L34_C8", "label": "publish()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L33_C4", "vector": [8, 2, 0.8947, 0.0263, 2, 0.17, 0.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " arm_off.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:Assign_L37_C4", "label": "i =", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99700:While_L16_C0", "vector": [14, 1, 0.9737, 0.0263, 1, 0.25, 0.8, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = i+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99700:Expr_L38_C4", "label": "sleep()", "type": "expression", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99700:While_L16_C0", "vector": [8, 1, 1.0, 0.0263, 1, 0.25, 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()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99700:While_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99700:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99700:While_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L20_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99700:Expr_L22_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L20_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99700:Expr_L23_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L25_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99700:Expr_L27_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L25_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99700:Expr_L28_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99700:While_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99700:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99700:While_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99700:If_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99700:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99700:While_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99700:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99700:While_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99700:Expr_L38_C4"}]
import roslib roslib.load_manifest('trigger_msgs') import sys import rospy import cv import trigger_msgs.msg rospy.init_node("trigger", anonymous=True) arm_trigger = rospy.Publisher("arm_trigger", trigger_msgs.msg.Trigger, latch = True) head_trigger = rospy.Publisher("head_trigger", trigger_msgs.msg.Trigger, latch = True) cv.NamedWindow('keyboard', 1) img = cv.CreateImage((30, 30), cv.IPL_DEPTH_8U, 1) #r = rospy.Rate(132/60.) r = rospy.Rate(10.) i = 0 while not rospy.is_shutdown(): cv.ShowImage('keyboard', img) k = cv.WaitKey(10) #print (k & 0xff), k if chr(k & 0xff) == 'h': print 'head!' head_trigger.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.0)), rospy.get_param("~event", "")) if chr(k & 0xff) == 'a': print 'arm!' arm_trigger.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.0)), rospy.get_param("~event", "")) #if i % 4 == 0: #if i % 8 == 0: #i = i+1 #r.sleep()
ajibawa-2023/Python-Code-Large/train/row_99701
22
35
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99701:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0286, 0.0286, 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_99701:Expr_L2_C0", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0571, 0.0286, 0, 0.66, 0.0769, 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('trigger_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99701:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0857, 0.0286, 0, 0.66, 0.1538, 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_99701:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1143, 0.0286, 0, 0.66, 0.2308, 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_99701:Import_L5_C0", "label": "cv import cv", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0286, 0, 0.66, 0.3077, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99701:Import_L7_C0", "label": "trigger_msgs.msg import trigger_msgs.msg", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.0286, 0, 0.66, 0.3846, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "trigger_msgs.msg", "arg_names": [], "import_names": ["trigger_msgs.msg"], "rhs_call_name": "", "annotation": ""}, "snippet": "import trigger_msgs.msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99701:Expr_L9_C0", "label": "init_node()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.2571, 0.0286, 0, 0.66, 0.4615, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": "rospy.init_node(\"trigger\", anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99701:Assign_L10_C0", "label": "arm_trigger = Publisher()", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2857, 0.0286, 0, 0.66, 0.5385, 696, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "arm_trigger", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "arm_trigger = rospy.Publisher(\"arm_trigger\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99701:Assign_L11_C0", "label": "head_trigger = Publisher()", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.3143, 0.0286, 0, 0.66, 0.6154, 318, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "head_trigger", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "head_trigger = rospy.Publisher(\"head_trigger\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99701:Expr_L12_C0", "label": "NamedWindow()", "type": "expression", "loc": [12, 12], "level": 0, "parent": null, "vector": [8, 0, 0.3429, 0.0286, 0, 0.66, 0.6923, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": "cv.NamedWindow('keyboard', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99701:Assign_L13_C0", "label": "img = CreateImage()", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.3714, 0.0286, 0, 0.66, 0.7692, 200, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "img", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": "img = cv.CreateImage((30, 30), cv.IPL_DEPTH_8U, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99701:Assign_L15_C0", "label": "r = Rate()", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.4286, 0.0286, 0, 0.66, 0.8462, 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_99701:Assign_L17_C0", "label": "i =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.4857, 0.0286, 0, 0.66, 0.9231, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99701:While_L18_C0", "label": "while", "type": "while", "loc": [18, 28], "level": 0, "parent": null, "vector": [5, 0, 0.6571, 0.3143, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 17], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "while not rospy.is_shutdown():\n cv.ShowImage('keyboard', img)\n k = cv.WaitKey(10)\n #print (k & 0xff), k\n if chr(k & 0xff) == 'h':\n print('head!')\n head_trigger.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.0)), rospy.get_param(\"~event\", \"\"))\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99701:Expr_L19_C4", "label": "ShowImage()", "type": "expression", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99701:While_L18_C0", "vector": [8, 1, 0.5429, 0.0286, 1, 0.32, 0.0, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage('keyboard', img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99701:Assign_L20_C4", "label": "k = WaitKey()", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99701:While_L18_C0", "vector": [14, 1, 0.5714, 0.0286, 1, 0.32, 0.3333, 954, 3, 1, 0, 0, 885, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " k = cv.WaitKey(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99701:If_L22_C4", "label": "if", "type": "if", "loc": [22, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99701:While_L18_C0", "vector": [4, 1, 0.6571, 0.0857, 1, 0.32, 0.6667, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if chr(k & 0xff) == 'h':\n print('head!')\n head_trigger.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99701:Expr_L23_C8", "label": "print()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99701:If_L22_C4", "vector": [8, 2, 0.6571, 0.0286, 2, 0.7, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('head!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99701:Expr_L24_C8", "label": "publish()", "type": "expression", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99701:If_L22_C4", "vector": [8, 2, 0.6857, 0.0286, 2, 0.7, 1.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " head_trigger.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99701:If_L26_C4", "label": "if", "type": "if", "loc": [26, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99701:While_L18_C0", "vector": [4, 1, 0.7714, 0.0857, 1, 0.32, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if chr(k & 0xff) == 'a':\n print('arm!')\n arm_trigger.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99701:Expr_L27_C8", "label": "print()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99701:If_L26_C4", "vector": [8, 2, 0.7714, 0.0286, 2, 0.52, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('arm!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99701:Expr_L28_C8", "label": "publish()", "type": "expression", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99701:If_L26_C4", "vector": [8, 2, 0.8, 0.0286, 2, 0.52, 1.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " arm_trigger.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.0)), rospy.get_param(\"~event\", \"\"))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99701:While_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99701:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99701:While_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99701:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99701:While_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99701:If_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99701:If_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99701:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99701:If_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99701:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99701:While_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99701:If_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99701:If_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99701:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99701:If_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99701:Expr_L28_C8"}]
import roslib roslib.load_manifest('trigger_msgs') import sys import rospy import trigger_msgs.msg rospy.init_node("trigger", anonymous=True) left_initial_pose00 = rospy.Publisher("left_initial_pose00", trigger_msgs.msg.Trigger, latch = True) right_initial_pose00 = rospy.Publisher("right_initial_pose00", trigger_msgs.msg.Trigger, latch = True) head_initial_pose00 = rospy.Publisher("head_initial_pose00", trigger_msgs.msg.Trigger, latch = True) # head_initial_pose00 r = rospy.Rate(60/60.) head_initial_pose00.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 1)), rospy.get_param("~event", "")) left_initial_pose00.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 10)), rospy.get_param("~event", "")) right_initial_pose00.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 10)), rospy.get_param("~event", "")) r.sleep() r.sleep() r.sleep()
ajibawa-2023/Python-Code-Large/train/row_99702
16
22
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99702:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0455, 0.0455, 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_99702:Expr_L2_C0", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0909, 0.0455, 0, 0.66, 0.0667, 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('trigger_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99702:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1364, 0.0455, 0, 0.66, 0.1333, 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_99702:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1818, 0.0455, 0, 0.66, 0.2, 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_99702:Import_L6_C0", "label": "trigger_msgs.msg import trigger_msgs.msg", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.2727, 0.0455, 0, 0.66, 0.2667, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "trigger_msgs.msg", "arg_names": [], "import_names": ["trigger_msgs.msg"], "rhs_call_name": "", "annotation": ""}, "snippet": "import trigger_msgs.msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99702:Expr_L8_C0", "label": "init_node()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.3636, 0.0455, 0, 0.66, 0.3333, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": "rospy.init_node(\"trigger\", anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99702:Assign_L10_C0", "label": "left_initial_pose00 = Publisher()", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.4545, 0.0455, 0, 0.66, 0.4, 157, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "left_initial_pose00", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "left_initial_pose00 = rospy.Publisher(\"left_initial_pose00\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99702:Assign_L11_C0", "label": "right_initial_pose00 = Publisher()", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0455, 0, 0.66, 0.4667, 261, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "right_initial_pose00", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "right_initial_pose00 = rospy.Publisher(\"right_initial_pose00\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99702:Assign_L12_C0", "label": "head_initial_pose00 = Publisher()", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.5455, 0.0455, 0, 0.66, 0.5333, 940, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "head_initial_pose00", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "head_initial_pose00 = rospy.Publisher(\"head_initial_pose00\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99702:Assign_L15_C0", "label": "r = Rate()", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.6818, 0.0455, 0, 0.66, 0.6, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": "r = rospy.Rate(60/60.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99702:Expr_L16_C0", "label": "publish()", "type": "expression", "loc": [16, 16], "level": 0, "parent": null, "vector": [8, 0, 0.7273, 0.0455, 0, 0.66, 0.6667, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": "head_initial_pose00.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 1)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99702:Expr_L17_C0", "label": "publish()", "type": "expression", "loc": [17, 17], "level": 0, "parent": null, "vector": [8, 0, 0.7727, 0.0455, 0, 0.66, 0.7333, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": "left_initial_pose00.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 10)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99702:Expr_L18_C0", "label": "publish()", "type": "expression", "loc": [18, 18], "level": 0, "parent": null, "vector": [8, 0, 0.8182, 0.0455, 0, 0.66, 0.8, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": "right_initial_pose00.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 10)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99702:Expr_L19_C0", "label": "sleep()", "type": "expression", "loc": [19, 19], "level": 0, "parent": null, "vector": [8, 0, 0.8636, 0.0455, 0, 0.66, 0.8667, 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_99702:Expr_L20_C0", "label": "sleep()", "type": "expression", "loc": [20, 20], "level": 0, "parent": null, "vector": [8, 0, 0.9091, 0.0455, 0, 0.66, 0.9333, 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_99702:Expr_L21_C0", "label": "sleep()", "type": "expression", "loc": [21, 21], "level": 0, "parent": null, "vector": [8, 0, 0.9545, 0.0455, 0, 0.66, 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()"}]
[]
import roslib roslib.load_manifest('trigger_msgs') import sys import rospy import trigger_msgs.msg import dynamic_reconfigure.client import threading import time import geometry_msgs.msg as gm rospy.init_node("wake_up", anonymous=True) projector_on = {'camera_reset': False, 'forearm_l_rate': 30.0, 'forearm_l_trig_mode': 1, 'forearm_r_rate': 30.0, 'forearm_r_trig_mode': 1, 'narrow_stereo_trig_mode': 2, 'projector_mode': 3, 'projector_pulse_length': 0.002, 'projector_pulse_shift': 0.0, 'projector_rate': 58.823529411764703, 'projector_tweak': 0.0, 'prosilica_projector_inhibit': False, 'stereo_rate': 29.411764705882351, 'wide_stereo_trig_mode': 2} projector_off = {'camera_reset': False, 'forearm_l_rate': 30.0, 'forearm_l_trig_mode': 1, 'forearm_r_rate': 30.0, 'forearm_r_trig_mode': 1, 'narrow_stereo_trig_mode': 2, 'projector_mode': 1, 'projector_pulse_length': 0.002, 'projector_pulse_shift': 0.0, 'projector_rate': 58.823529411764703, 'projector_tweak': 0.0, 'prosilica_projector_inhibit': False, 'stereo_rate': 29.411764705882351, 'wide_stereo_trig_mode': 2} projector = dynamic_reconfigure.client.Client('camera_synchronizer_node') #move_base = rospy.Publisher('simple_move_base', gm.Pose2D) blink_time = .2 print 'on' projector.update_configuration(projector_on) time.sleep(1) print 'off' projector.update_configuration(projector_off) time.sleep(blink_time) print 'on' projector.update_configuration(projector_on) time.sleep(blink_time) print 'off' projector.update_configuration(projector_off) time.sleep(blink_time) print 'on' projector.update_configuration(projector_on) time.sleep(blink_time) print 'off' projector.update_configuration(projector_off) time.sleep(1) print 'on' projector.update_configuration(projector_on) time.sleep(10) #p2d = gm.Pose2D() #p2d.x = .6 #p2d.y = .15 # move_base.publish(p2d) #r = rospy.Rate(60/60.) #projector_animation = ProjectorWakeUp() #projector_animation.start() #time.sleep(3) #time.sleep(blink_time) #self.projector.update_configuration(self.projector_off) #self.projector.update_configuration(self.projector_on) #time.sleep(.2) #self.projector.update_configuration(self.projector_off) #time.sleep(.05) #self.projector.update_configuration(self.projector_on) #time.sleep(.05) #self.projector.update_configuration(self.projector_off) #time.sleep(.05) #self.projector.update_configuration(self.projector_on) #time.sleep(.05) #self.projector.update_configuration(self.projector_off) #time.sleep(2) #self.projector.update_configuration(self.projector_on) #time.sleep(3)
ajibawa-2023/Python-Code-Large/train/row_99703
35
136
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0074, 0.0074, 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_99703:Expr_L2_C0", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0147, 0.0074, 0, 0.66, 0.0294, 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('trigger_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0221, 0.0074, 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_99703:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0294, 0.0074, 0, 0.66, 0.0882, 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_99703:Import_L6_C0", "label": "trigger_msgs.msg import trigger_msgs.msg", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0441, 0.0074, 0, 0.66, 0.1176, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "trigger_msgs.msg", "arg_names": [], "import_names": ["trigger_msgs.msg"], "rhs_call_name": "", "annotation": ""}, "snippet": "import trigger_msgs.msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Import_L7_C0", "label": "dynamic_reconfigure.client import dynamic_reconfigure.client", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0515, 0.0074, 0, 0.66, 0.1471, 524, 0, 1, 0, 0, 524, 0, 0], "semantic": {"name": "dynamic_reconfigure.client", "arg_names": [], "import_names": ["dynamic_reconfigure.client"], "rhs_call_name": "", "annotation": ""}, "snippet": "import dynamic_reconfigure.client"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Import_L8_C0", "label": "threading import threading", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0074, 0, 0.66, 0.1765, 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_99703:Import_L9_C0", "label": "time import time", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0662, 0.0074, 0, 0.66, 0.2059, 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_99703:Import_L10_C0", "label": "geometry_msgs.msg import gm", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0735, 0.0074, 0, 0.66, 0.2353, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["gm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import geometry_msgs.msg as gm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Expr_L12_C0", "label": "init_node()", "type": "expression", "loc": [12, 12], "level": 0, "parent": null, "vector": [8, 0, 0.0882, 0.0074, 0, 0.66, 0.2647, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": "rospy.init_node(\"wake_up\", anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Assign_L14_C0", "label": "projector_on =", "type": "assigned_variable", "loc": [14, 27], "level": 0, "parent": null, "vector": [14, 0, 0.1507, 0.1029, 0, 0.66, 0.2941, 519, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "projector_on", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "projector_on = {'camera_reset': False,\n 'forearm_l_rate': 30.0,\n 'forearm_l_trig_mode': 1,\n 'forearm_r_rate': 30.0,\n 'forearm_r_trig_mode': 1,\n 'narrow_stereo_trig_mode': 2,\n 'projector_mode': 3,\n 'projector_pulse_length': 0.002,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Assign_L29_C0", "label": "projector_off =", "type": "assigned_variable", "loc": [29, 42], "level": 0, "parent": null, "vector": [14, 0, 0.261, 0.1029, 0, 0.66, 0.3235, 912, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "projector_off", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "projector_off = {'camera_reset': False,\n 'forearm_l_rate': 30.0,\n 'forearm_l_trig_mode': 1,\n 'forearm_r_rate': 30.0,\n 'forearm_r_trig_mode': 1,\n 'narrow_stereo_trig_mode': 2,\n 'projector_mode': 1,\n 'projector_pulse_length': 0.002,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Assign_L43_C0", "label": "projector = Client()", "type": "assigned_variable", "loc": [43, 43], "level": 0, "parent": null, "vector": [14, 0, 0.3162, 0.0074, 0, 0.66, 0.3529, 101, 3, 1, 0, 0, 412, 10, 1], "semantic": {"name": "projector", "arg_names": [], "import_names": [], "rhs_call_name": "Client", "annotation": ""}, "snippet": "projector = dynamic_reconfigure.client.Client('camera_synchronizer_node')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Assign_L46_C0", "label": "blink_time =", "type": "assigned_variable", "loc": [46, 46], "level": 0, "parent": null, "vector": [14, 0, 0.3382, 0.0074, 0, 0.66, 0.3824, 72, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "blink_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "blink_time = .2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Expr_L48_C0", "label": "print()", "type": "expression", "loc": [48, 48], "level": 0, "parent": null, "vector": [8, 0, 0.3529, 0.0074, 0, 0.66, 0.4118, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('on')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Expr_L49_C0", "label": "update_configuration()", "type": "expression", "loc": [49, 49], "level": 0, "parent": null, "vector": [8, 0, 0.3603, 0.0074, 0, 0.66, 0.4412, 662, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update_configuration", "arg_names": [], "import_names": [], "rhs_call_name": "update_configuration", "annotation": ""}, "snippet": "projector.update_configuration(projector_on)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Expr_L50_C0", "label": "sleep()", "type": "expression", "loc": [50, 50], "level": 0, "parent": null, "vector": [8, 0, 0.3676, 0.0074, 0, 0.66, 0.4706, 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_99703:Expr_L51_C0", "label": "print()", "type": "expression", "loc": [51, 51], "level": 0, "parent": null, "vector": [8, 0, 0.375, 0.0074, 0, 0.66, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('off')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Expr_L52_C0", "label": "update_configuration()", "type": "expression", "loc": [52, 52], "level": 0, "parent": null, "vector": [8, 0, 0.3824, 0.0074, 0, 0.66, 0.5294, 662, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update_configuration", "arg_names": [], "import_names": [], "rhs_call_name": "update_configuration", "annotation": ""}, "snippet": "projector.update_configuration(projector_off)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Expr_L53_C0", "label": "sleep()", "type": "expression", "loc": [53, 53], "level": 0, "parent": null, "vector": [8, 0, 0.3897, 0.0074, 0, 0.66, 0.5588, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": "time.sleep(blink_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Expr_L55_C0", "label": "print()", "type": "expression", "loc": [55, 55], "level": 0, "parent": null, "vector": [8, 0, 0.4044, 0.0074, 0, 0.66, 0.5882, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('on')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Expr_L56_C0", "label": "update_configuration()", "type": "expression", "loc": [56, 56], "level": 0, "parent": null, "vector": [8, 0, 0.4118, 0.0074, 0, 0.66, 0.6176, 662, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update_configuration", "arg_names": [], "import_names": [], "rhs_call_name": "update_configuration", "annotation": ""}, "snippet": "projector.update_configuration(projector_on)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Expr_L57_C0", "label": "sleep()", "type": "expression", "loc": [57, 57], "level": 0, "parent": null, "vector": [8, 0, 0.4191, 0.0074, 0, 0.66, 0.6471, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": "time.sleep(blink_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Expr_L58_C0", "label": "print()", "type": "expression", "loc": [58, 58], "level": 0, "parent": null, "vector": [8, 0, 0.4265, 0.0074, 0, 0.66, 0.6765, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('off')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Expr_L59_C0", "label": "update_configuration()", "type": "expression", "loc": [59, 59], "level": 0, "parent": null, "vector": [8, 0, 0.4338, 0.0074, 0, 0.66, 0.7059, 662, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update_configuration", "arg_names": [], "import_names": [], "rhs_call_name": "update_configuration", "annotation": ""}, "snippet": "projector.update_configuration(projector_off)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Expr_L60_C0", "label": "sleep()", "type": "expression", "loc": [60, 60], "level": 0, "parent": null, "vector": [8, 0, 0.4412, 0.0074, 0, 0.66, 0.7353, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": "time.sleep(blink_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Expr_L62_C0", "label": "print()", "type": "expression", "loc": [62, 62], "level": 0, "parent": null, "vector": [8, 0, 0.4559, 0.0074, 0, 0.66, 0.7647, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('on')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Expr_L63_C0", "label": "update_configuration()", "type": "expression", "loc": [63, 63], "level": 0, "parent": null, "vector": [8, 0, 0.4632, 0.0074, 0, 0.66, 0.7941, 662, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update_configuration", "arg_names": [], "import_names": [], "rhs_call_name": "update_configuration", "annotation": ""}, "snippet": "projector.update_configuration(projector_on)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Expr_L64_C0", "label": "sleep()", "type": "expression", "loc": [64, 64], "level": 0, "parent": null, "vector": [8, 0, 0.4706, 0.0074, 0, 0.66, 0.8235, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": "time.sleep(blink_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Expr_L65_C0", "label": "print()", "type": "expression", "loc": [65, 65], "level": 0, "parent": null, "vector": [8, 0, 0.4779, 0.0074, 0, 0.66, 0.8529, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('off')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Expr_L66_C0", "label": "update_configuration()", "type": "expression", "loc": [66, 66], "level": 0, "parent": null, "vector": [8, 0, 0.4853, 0.0074, 0, 0.66, 0.8824, 662, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update_configuration", "arg_names": [], "import_names": [], "rhs_call_name": "update_configuration", "annotation": ""}, "snippet": "projector.update_configuration(projector_off)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Expr_L67_C0", "label": "sleep()", "type": "expression", "loc": [67, 67], "level": 0, "parent": null, "vector": [8, 0, 0.4926, 0.0074, 0, 0.66, 0.9118, 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_99703:Expr_L69_C0", "label": "print()", "type": "expression", "loc": [69, 69], "level": 0, "parent": null, "vector": [8, 0, 0.5074, 0.0074, 0, 0.66, 0.9412, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('on')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Expr_L70_C0", "label": "update_configuration()", "type": "expression", "loc": [70, 70], "level": 0, "parent": null, "vector": [8, 0, 0.5147, 0.0074, 0, 0.66, 0.9706, 662, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update_configuration", "arg_names": [], "import_names": [], "rhs_call_name": "update_configuration", "annotation": ""}, "snippet": "projector.update_configuration(projector_on)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99703:Expr_L71_C0", "label": "sleep()", "type": "expression", "loc": [71, 71], "level": 0, "parent": null, "vector": [8, 0, 0.5221, 0.0074, 0, 0.66, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": "time.sleep(10)"}]
[]
import roslib roslib.load_manifest('trigger_msgs') import sys import rospy import dynamic_reconfigure.client import time import trigger_msgs.msg import geometry_msgs.msg as gm import time import sys dist = float(sys.argv[1]) print dist rospy.init_node("move_back", anonymous=True) move_base = rospy.Publisher('simple_move_base', gm.Pose2D) r = rospy.Rate(10) p2d = gm.Pose2D() p2d.x = dist p2d.y = .15 print 'move_back -.6' r.sleep() move_base.publish(p2d) r.sleep() r.sleep() r.sleep() r.sleep() r.sleep() #import threading as tr #class ProjectorWakeUp(threading.Thread): # # def __init__(self): # threading.Thread.__init__(self) # self.projector = dynamic_reconfigure.client.Client('camera_synchronizer_node') # # def run(self): # self.projector.update_configuration(projector_on) # time.sleep(.2) # self.projector.update_configuration(projector_off) # time.sleep(.05) # self.projector.update_configuration(projector_on) # time.sleep(.05) # self.projector.update_configuration(projector_off) # time.sleep(2) # self.projector.update_configuration(projector_on) #head_up = rospy.Publisher("head_up", trigger_msgs.msg.Trigger, latch = True) #head_down = rospy.Publisher("head_down", trigger_msgs.msg.Trigger, latch = True) #head_down_up = rospy.Publisher("head_down_up", trigger_msgs.msg.Trigger, latch = True) #arm_on = rospy.Publisher("light_on", trigger_msgs.msg.Trigger, latch = True) #arm_off = rospy.Publisher("light_off", trigger_msgs.msg.Trigger, latch = True) # #left_initial_pose = rospy.Publisher("left_start", trigger_msgs.msg.Trigger, latch = True) #left_initial_pose0 = rospy.Publisher("left_start2", trigger_msgs.msg.Trigger, latch = True) #right_initial_pose0 = rospy.Publisher("right_initial_pose0", trigger_msgs.msg.Trigger, latch = True) ##right_initial_pose00 = rospy.Publisher("right_initial_pose00", trigger_msgs.msg.Trigger, latch = True) #froo_froo = rospy.Publisher("froo_froo", trigger_msgs.msg.Trigger, latch = True) #head_look_around = rospy.Publisher("head_look_around2", trigger_msgs.msg.Trigger, latch = True) # #both_arms_forward2 = rospy.Publisher("both_arms_forward2", trigger_msgs.msg.Trigger, latch = True) #both_arms_fold2 = rospy.Publisher("both_arms_fold2", trigger_msgs.msg.Trigger, latch = True) #both_arms_fold_end_pose = rospy.Publisher("both_arms_fold_end_pose", trigger_msgs.msg.Trigger, latch = True) #head_turn = rospy.Publisher("head_turn", trigger_msgs.msg.Trigger, latch = True) # #arm_spin = rospy.Publisher("arm_spin", trigger_msgs.msg.Trigger, latch = True) #raise_the_roof = rospy.Publisher("raise_the_roof", trigger_msgs.msg.Trigger, latch = True) #head_up_full = rospy.Publisher("head_up_full", trigger_msgs.msg.Trigger, latch = True) #head_down_full = rospy.Publisher("head_down_full", trigger_msgs.msg.Trigger, latch = True) #hand_up = rospy.Publisher("hand_up", trigger_msgs.msg.Trigger, latch = True) #hand_down = rospy.Publisher("hand_down", trigger_msgs.msg.Trigger, latch = True) #left_initial_pose00 = rospy.Publisher("left_initial_pose00", trigger_msgs.msg.Trigger, latch = True) # right_initial_pose00 = rospy.Publisher("right_initial_pose00", trigger_msgs.msg.Trigger, latch = True) #right_initial_pose = rospy.Publisher("right_initial_pose", trigger_msgs.msg.Trigger, latch = True) #projector_on = {'camera_reset': False, # 'forearm_l_rate': 30.0, # 'forearm_l_trig_mode': 1, # 'forearm_r_rate': 30.0, # 'forearm_r_trig_mode': 1, # 'narrow_stereo_trig_mode': 2, # 'projector_mode': 3, # 'projector_pulse_length': 0.002, # 'projector_pulse_shift': 0.0, # 'projector_rate': 58.823529411764703, # 'projector_tweak': 0.0, # 'prosilica_projector_inhibit': False, # 'stereo_rate': 29.411764705882351, # 'wide_stereo_trig_mode': 2} # # #projector_off = {'camera_reset': False, # 'forearm_l_rate': 30.0, # 'forearm_l_trig_mode': 1, # 'forearm_r_rate': 30.0, # 'forearm_r_trig_mode': 1, # 'narrow_stereo_trig_mode': 2, # 'projector_mode': 1, # 'projector_pulse_length': 0.002, # 'projector_pulse_shift': 0.0, # 'projector_rate': 58.823529411764703, # 'projector_tweak': 0.0, # 'prosilica_projector_inhibit': False, # 'stereo_rate': 29.411764705882351, # 'wide_stereo_trig_mode': 2} #projector = dynamic_reconfigure.client.Client('camera_synchronizer_node') #r = rospy.Rate(120/60.) #time.sleep(.2) #r.sleep() #projector_animation = ProjectorWakeUp() #i = -23 #while not rospy.is_shutdown(): # # print '------------', i, '-------------' # if i == -23: # print 'left_initial_pose0' # left_initial_pose0.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 1.5)), rospy.get_param("~event", "")) # # if i == -12: # print 'left_initial_pose' # left_initial_pose.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 2.0)), rospy.get_param("~event", "")) # # if i == -6: # print 'arm_on' # arm_on.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.3)), rospy.get_param("~event", "")) # # if i == -5: # print 'head_look_around' # head_look_around.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.2)), rospy.get_param("~event", "")) # # if i >= 9 and i <= 49: # arm_i = (i - 9) # if arm_i % 8 == 0: # print 'lights off' # arm_off.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", .8)), rospy.get_param("~event", "")) # # if arm_i % 8 == 4: # print 'lights on' # arm_on.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", .8)), rospy.get_param("~event", "")) # # if i >= 15 and i <= 34: # head_i = i - 15 # if head_i % 4 == 0: # #Down # print 'down' # head_down_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.1)), rospy.get_param("~event", "")) # #head_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.0)), rospy.get_param("~event", "")) # # if head_i % 4 == 2: # #Up # print 'up' # #head_down.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.8)), rospy.get_param("~event", "")) # #head_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.0)), rospy.get_param("~event", "")) # #hand_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.0)), rospy.get_param("~event", "")) # # if i >= 40 and i <= 43: # head_i = i - 41 # if head_i % 4 == 0: # head_down_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.1)), rospy.get_param("~event", "")) # print 'down' # # if head_i % 4 == 2: # print 'up' # #head_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.8)), rospy.get_param("~event", "")) # # ################################################################################ # ### FREESTYLE # ################################################################################ # if i == 23: # print 'right_initial_pose0' # right_initial_pose0.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.3)), rospy.get_param("~event", "")) # # #if i == 24: # # print 'right_initial_pose0' # # right_initial_pose00.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 3.5)), rospy.get_param("~event", "")) # # if i == 26: # #if i == 29: # print 'arm_spin' # arm_spin.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 3.0)), rospy.get_param("~event", "")) # # #if i >= 29 and i < 37: # # if ((i-29) % 9) == 0: # # print 'Free style!' # # froo_froo.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 2.0)), rospy.get_param("~event", "")) # # if i == 42: # #if i == 45: # #ANOTHER FREESTYLE # print 'raise_the_roof' # raise_the_roof.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 3.0)), rospy.get_param("~event", "")) # # ############################################################################### # ## Dancy # ############################################################################### # if i == 53: # print 'head_down' # print 'both_arms_forward2' # both_arms_forward2.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 2)), rospy.get_param("~event", "")) # # if i == 56: # p2d = gm.Pose2D() # p2d.x = -.4 # p2d.y = .15 # move_base.publish(p2d) # head_down_full.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.5)), rospy.get_param("~event", "")) # # if i == 61: # print 'head_up' # print 'both_arms_fold2' # head_up_full.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.4)), rospy.get_param("~event", "")) # both_arms_fold2.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.8)), rospy.get_param("~event", "")) # # if i == 65: # p2d = gm.Pose2D() # p2d.y = 100. # p2d.theta = -390 # move_base.publish(p2d) # # if i == 77: # print 'both_arms_fold_end_pose' # print 'head_turn' # head_turn.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 7.0)), rospy.get_param("~event", "")) # both_arms_fold_end_pose.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.8)), rospy.get_param("~event", "")) # # i = i+1 # r.sleep() # if i == 80: # break #projector.update_configuration(projector_off) #if i == -12: # left_initial_pose00.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 5)), rospy.get_param("~event", "")) # right_initial_pose00.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 5)), rospy.get_param("~event", "")) #if i == 43: # right_initial_pose.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 3.)), rospy.get_param("~event", ""))
ajibawa-2023/Python-Code-Large/train/row_99704
26
258
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99704:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0039, 0.0039, 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_99704:Expr_L2_C0", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0078, 0.0039, 0, 0.66, 0.04, 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('trigger_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99704:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0116, 0.0039, 0, 0.66, 0.08, 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_99704:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0155, 0.0039, 0, 0.66, 0.12, 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_99704:Import_L5_C0", "label": "dynamic_reconfigure.client import dynamic_reconfigure.client", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0194, 0.0039, 0, 0.66, 0.16, 524, 0, 1, 0, 0, 524, 0, 0], "semantic": {"name": "dynamic_reconfigure.client", "arg_names": [], "import_names": ["dynamic_reconfigure.client"], "rhs_call_name": "", "annotation": ""}, "snippet": "import dynamic_reconfigure.client"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99704:Import_L6_C0", "label": "time import time", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0233, 0.0039, 0, 0.66, 0.2, 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_99704:Import_L7_C0", "label": "trigger_msgs.msg import trigger_msgs.msg", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0271, 0.0039, 0, 0.66, 0.24, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "trigger_msgs.msg", "arg_names": [], "import_names": ["trigger_msgs.msg"], "rhs_call_name": "", "annotation": ""}, "snippet": "import trigger_msgs.msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99704:Import_L8_C0", "label": "geometry_msgs.msg import gm", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.031, 0.0039, 0, 0.66, 0.28, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["gm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import geometry_msgs.msg as gm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99704:Import_L9_C0", "label": "time import time", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0349, 0.0039, 0, 0.66, 0.32, 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_99704:Import_L10_C0", "label": "sys import sys", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0388, 0.0039, 0, 0.66, 0.36, 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_99704:Assign_L12_C0", "label": "dist = float()", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.0465, 0.0039, 0, 0.66, 0.4, 673, 3, 1, 0, 0, 639, 10, 1], "semantic": {"name": "dist", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": "dist = float(sys.argv[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99704:Expr_L13_C0", "label": "print()", "type": "expression", "loc": [13, 13], "level": 0, "parent": null, "vector": [8, 0, 0.0504, 0.0039, 0, 0.66, 0.44, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print(dist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99704:Expr_L14_C0", "label": "init_node()", "type": "expression", "loc": [14, 14], "level": 0, "parent": null, "vector": [8, 0, 0.0543, 0.0039, 0, 0.66, 0.48, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": "rospy.init_node(\"move_back\", anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99704:Assign_L15_C0", "label": "move_base = Publisher()", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.0581, 0.0039, 0, 0.66, 0.52, 55, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "move_base", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "move_base = rospy.Publisher('simple_move_base', gm.Pose2D)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99704:Assign_L16_C0", "label": "r = Rate()", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.062, 0.0039, 0, 0.66, 0.56, 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_99704:Assign_L17_C0", "label": "p2d = Pose2D()", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.0659, 0.0039, 0, 0.66, 0.6, 716, 3, 0, 0, 0, 810, 10, 1], "semantic": {"name": "p2d", "arg_names": [], "import_names": [], "rhs_call_name": "Pose2D", "annotation": ""}, "snippet": "p2d = gm.Pose2D()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99704:Assign_L18_C0", "label": "p2d.x =", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.0698, 0.0039, 0, 0.66, 0.64, 958, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p2d.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "p2d.x = dist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99704:Assign_L19_C0", "label": "p2d.y =", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.0736, 0.0039, 0, 0.66, 0.68, 302, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "p2d.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "p2d.y = .15"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99704:Expr_L20_C0", "label": "print()", "type": "expression", "loc": [20, 20], "level": 0, "parent": null, "vector": [8, 0, 0.0775, 0.0039, 0, 0.66, 0.72, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('move_back -.6')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99704:Expr_L21_C0", "label": "sleep()", "type": "expression", "loc": [21, 21], "level": 0, "parent": null, "vector": [8, 0, 0.0814, 0.0039, 0, 0.66, 0.76, 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_99704:Expr_L22_C0", "label": "publish()", "type": "expression", "loc": [22, 22], "level": 0, "parent": null, "vector": [8, 0, 0.0853, 0.0039, 0, 0.66, 0.8, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": "move_base.publish(p2d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99704:Expr_L23_C0", "label": "sleep()", "type": "expression", "loc": [23, 23], "level": 0, "parent": null, "vector": [8, 0, 0.0891, 0.0039, 0, 0.66, 0.84, 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_99704:Expr_L24_C0", "label": "sleep()", "type": "expression", "loc": [24, 24], "level": 0, "parent": null, "vector": [8, 0, 0.093, 0.0039, 0, 0.66, 0.88, 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_99704:Expr_L25_C0", "label": "sleep()", "type": "expression", "loc": [25, 25], "level": 0, "parent": null, "vector": [8, 0, 0.0969, 0.0039, 0, 0.66, 0.92, 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_99704:Expr_L26_C0", "label": "sleep()", "type": "expression", "loc": [26, 26], "level": 0, "parent": null, "vector": [8, 0, 0.1008, 0.0039, 0, 0.66, 0.96, 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_99704:Expr_L27_C0", "label": "sleep()", "type": "expression", "loc": [27, 27], "level": 0, "parent": null, "vector": [8, 0, 0.1047, 0.0039, 0, 0.66, 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()"}]
[]
import roslib roslib.load_manifest('trigger_msgs') import sys import rospy import dynamic_reconfigure.client import time import trigger_msgs.msg import geometry_msgs.msg as gm #import threading as tr #class ProjectorWakeUp(threading.Thread): # # def __init__(self): # threading.Thread.__init__(self) # self.projector = dynamic_reconfigure.client.Client('camera_synchronizer_node') # # def run(self): # self.projector.update_configuration(projector_on) # time.sleep(.2) # self.projector.update_configuration(projector_off) # time.sleep(.05) # self.projector.update_configuration(projector_on) # time.sleep(.05) # self.projector.update_configuration(projector_off) # time.sleep(2) # self.projector.update_configuration(projector_on) rospy.init_node("trigger", anonymous=True) head_up = rospy.Publisher("head_up", trigger_msgs.msg.Trigger, latch = True) head_down = rospy.Publisher("head_down", trigger_msgs.msg.Trigger, latch = True) head_down_up = rospy.Publisher("head_down_up", trigger_msgs.msg.Trigger, latch = True) arm_on = rospy.Publisher("light_on", trigger_msgs.msg.Trigger, latch = True) arm_off = rospy.Publisher("light_off", trigger_msgs.msg.Trigger, latch = True) left_initial_pose = rospy.Publisher("left_start", trigger_msgs.msg.Trigger, latch = True) left_initial_pose0 = rospy.Publisher("left_start2", trigger_msgs.msg.Trigger, latch = True) right_initial_pose0 = rospy.Publisher("right_initial_pose0", trigger_msgs.msg.Trigger, latch = True) #right_initial_pose00 = rospy.Publisher("right_initial_pose00", trigger_msgs.msg.Trigger, latch = True) froo_froo = rospy.Publisher("froo_froo", trigger_msgs.msg.Trigger, latch = True) head_look_around = rospy.Publisher("head_look_around2", trigger_msgs.msg.Trigger, latch = True) both_arms_forward2 = rospy.Publisher("both_arms_forward2", trigger_msgs.msg.Trigger, latch = True) both_arms_fold2 = rospy.Publisher("both_arms_fold2", trigger_msgs.msg.Trigger, latch = True) both_arms_fold_end_pose = rospy.Publisher("both_arms_fold_end_pose", trigger_msgs.msg.Trigger, latch = True) head_turn = rospy.Publisher("head_turn", trigger_msgs.msg.Trigger, latch = True) arm_spin = rospy.Publisher("arm_spin", trigger_msgs.msg.Trigger, latch = True) raise_the_roof = rospy.Publisher("raise_the_roof", trigger_msgs.msg.Trigger, latch = True) head_up_full = rospy.Publisher("head_up_full", trigger_msgs.msg.Trigger, latch = True) head_down_full = rospy.Publisher("head_down_full", trigger_msgs.msg.Trigger, latch = True) move_base = rospy.Publisher('simple_move_base', gm.Pose2D) #hand_up = rospy.Publisher("hand_up", trigger_msgs.msg.Trigger, latch = True) #hand_down = rospy.Publisher("hand_down", trigger_msgs.msg.Trigger, latch = True) #left_initial_pose00 = rospy.Publisher("left_initial_pose00", trigger_msgs.msg.Trigger, latch = True) # right_initial_pose00 = rospy.Publisher("right_initial_pose00", trigger_msgs.msg.Trigger, latch = True) #right_initial_pose = rospy.Publisher("right_initial_pose", trigger_msgs.msg.Trigger, latch = True) projector_on = {'camera_reset': False, 'forearm_l_rate': 30.0, 'forearm_l_trig_mode': 1, 'forearm_r_rate': 30.0, 'forearm_r_trig_mode': 1, 'narrow_stereo_trig_mode': 2, 'projector_mode': 3, 'projector_pulse_length': 0.002, 'projector_pulse_shift': 0.0, 'projector_rate': 58.823529411764703, 'projector_tweak': 0.0, 'prosilica_projector_inhibit': False, 'stereo_rate': 29.411764705882351, 'wide_stereo_trig_mode': 2} projector_off = {'camera_reset': False, 'forearm_l_rate': 30.0, 'forearm_l_trig_mode': 1, 'forearm_r_rate': 30.0, 'forearm_r_trig_mode': 1, 'narrow_stereo_trig_mode': 2, 'projector_mode': 1, 'projector_pulse_length': 0.002, 'projector_pulse_shift': 0.0, 'projector_rate': 58.823529411764703, 'projector_tweak': 0.0, 'prosilica_projector_inhibit': False, 'stereo_rate': 29.411764705882351, 'wide_stereo_trig_mode': 2} projector = dynamic_reconfigure.client.Client('camera_synchronizer_node') r = rospy.Rate(120/60.) #time.sleep(.2) #r.sleep() #projector_animation = ProjectorWakeUp() i = -23 while not rospy.is_shutdown(): print '------------', i, '-------------' if i == -23: print 'left_initial_pose0' left_initial_pose0.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 1.5)), rospy.get_param("~event", "")) if i == -12: print 'left_initial_pose' left_initial_pose.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 2.0)), rospy.get_param("~event", "")) if i == -6: print 'arm_on' arm_on.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.3)), rospy.get_param("~event", "")) if i == -5: print 'head_look_around' head_look_around.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.2)), rospy.get_param("~event", "")) if i >= 9 and i <= 49: arm_i = (i - 9) if arm_i % 8 == 0: print 'lights off' arm_off.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", .8)), rospy.get_param("~event", "")) if arm_i % 8 == 4: print 'lights on' arm_on.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", .8)), rospy.get_param("~event", "")) if i >= 15 and i <= 34: head_i = i - 15 if head_i % 4 == 0: #Down print 'down' head_down_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.1)), rospy.get_param("~event", "")) #head_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.0)), rospy.get_param("~event", "")) if head_i % 4 == 2: #Up print 'up' #head_down.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.8)), rospy.get_param("~event", "")) #head_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.0)), rospy.get_param("~event", "")) #hand_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.0)), rospy.get_param("~event", "")) if i >= 40 and i <= 43: head_i = i - 41 if head_i % 4 == 0: head_down_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.1)), rospy.get_param("~event", "")) print 'down' if head_i % 4 == 2: print 'up' #head_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.8)), rospy.get_param("~event", "")) ################################################################################ ### FREESTYLE ################################################################################ if i == 23: print 'right_initial_pose0' right_initial_pose0.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.3)), rospy.get_param("~event", "")) #if i == 24: # print 'right_initial_pose0' # right_initial_pose00.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 3.5)), rospy.get_param("~event", "")) if i == 26: #if i == 29: print 'arm_spin' arm_spin.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 3.0)), rospy.get_param("~event", "")) #if i >= 29 and i < 37: # if ((i-29) % 9) == 0: # print 'Free style!' # froo_froo.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 2.0)), rospy.get_param("~event", "")) if i == 42: #if i == 45: #ANOTHER FREESTYLE print 'raise_the_roof' raise_the_roof.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 3.0)), rospy.get_param("~event", "")) ############################################################################### ## Dancy ############################################################################### if i == 53: print 'head_down' print 'both_arms_forward2' both_arms_forward2.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 2)), rospy.get_param("~event", "")) if i == 56: p2d = gm.Pose2D() p2d.x = -.4 p2d.y = .15 move_base.publish(p2d) head_down_full.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.5)), rospy.get_param("~event", "")) if i == 61: print 'head_up' print 'both_arms_fold2' head_up_full.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.4)), rospy.get_param("~event", "")) both_arms_fold2.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.8)), rospy.get_param("~event", "")) if i == 65: p2d = gm.Pose2D() p2d.y = 100. p2d.theta = -390 move_base.publish(p2d) if i == 77: print 'both_arms_fold_end_pose' print 'head_turn' head_turn.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 7.0)), rospy.get_param("~event", "")) both_arms_fold_end_pose.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.8)), rospy.get_param("~event", "")) i = i+1 r.sleep() if i == 80: break projector.update_configuration(projector_off) #if i == -12: # left_initial_pose00.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 5)), rospy.get_param("~event", "")) # right_initial_pose00.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 5)), rospy.get_param("~event", "")) #if i == 43: # right_initial_pose.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 3.)), rospy.get_param("~event", ""))
ajibawa-2023/Python-Code-Large/train/row_99705
107
240
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0042, 0.0042, 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_99705:Expr_L2_C0", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0083, 0.0042, 0, 0.66, 0.0294, 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('trigger_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0125, 0.0042, 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_99705:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0167, 0.0042, 0, 0.66, 0.0882, 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_99705:Import_L5_C0", "label": "dynamic_reconfigure.client import dynamic_reconfigure.client", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0208, 0.0042, 0, 0.66, 0.1176, 524, 0, 1, 0, 0, 524, 0, 0], "semantic": {"name": "dynamic_reconfigure.client", "arg_names": [], "import_names": ["dynamic_reconfigure.client"], "rhs_call_name": "", "annotation": ""}, "snippet": "import dynamic_reconfigure.client"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Import_L6_C0", "label": "time import time", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.025, 0.0042, 0, 0.66, 0.1471, 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_99705:Import_L7_C0", "label": "trigger_msgs.msg import trigger_msgs.msg", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0292, 0.0042, 0, 0.66, 0.1765, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "trigger_msgs.msg", "arg_names": [], "import_names": ["trigger_msgs.msg"], "rhs_call_name": "", "annotation": ""}, "snippet": "import trigger_msgs.msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Import_L8_C0", "label": "geometry_msgs.msg import gm", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0333, 0.0042, 0, 0.66, 0.2059, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["gm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import geometry_msgs.msg as gm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L28_C0", "label": "init_node()", "type": "expression", "loc": [28, 28], "level": 0, "parent": null, "vector": [8, 0, 0.1167, 0.0042, 0, 0.66, 0.2353, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": "rospy.init_node(\"trigger\", anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L29_C0", "label": "head_up = Publisher()", "type": "assigned_variable", "loc": [29, 29], "level": 0, "parent": null, "vector": [14, 0, 0.1208, 0.0042, 0, 0.66, 0.2647, 73, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "head_up", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "head_up = rospy.Publisher(\"head_up\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L30_C0", "label": "head_down = Publisher()", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.125, 0.0042, 0, 0.66, 0.2941, 131, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "head_down", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "head_down = rospy.Publisher(\"head_down\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L31_C0", "label": "head_down_up = Publisher()", "type": "assigned_variable", "loc": [31, 31], "level": 0, "parent": null, "vector": [14, 0, 0.1292, 0.0042, 0, 0.66, 0.3235, 789, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "head_down_up", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "head_down_up = rospy.Publisher(\"head_down_up\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L32_C0", "label": "arm_on = Publisher()", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.1333, 0.0042, 0, 0.66, 0.3529, 694, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "arm_on", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "arm_on = rospy.Publisher(\"light_on\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L33_C0", "label": "arm_off = Publisher()", "type": "assigned_variable", "loc": [33, 33], "level": 0, "parent": null, "vector": [14, 0, 0.1375, 0.0042, 0, 0.66, 0.3824, 512, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "arm_off", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "arm_off = rospy.Publisher(\"light_off\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L35_C0", "label": "left_initial_pose = Publisher()", "type": "assigned_variable", "loc": [35, 35], "level": 0, "parent": null, "vector": [14, 0, 0.1458, 0.0042, 0, 0.66, 0.4118, 203, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "left_initial_pose", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "left_initial_pose = rospy.Publisher(\"left_start\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L36_C0", "label": "left_initial_pose0 = Publisher()", "type": "assigned_variable", "loc": [36, 36], "level": 0, "parent": null, "vector": [14, 0, 0.15, 0.0042, 0, 0.66, 0.4412, 680, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "left_initial_pose0", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "left_initial_pose0 = rospy.Publisher(\"left_start2\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L37_C0", "label": "right_initial_pose0 = Publisher()", "type": "assigned_variable", "loc": [37, 37], "level": 0, "parent": null, "vector": [14, 0, 0.1542, 0.0042, 0, 0.66, 0.4706, 440, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "right_initial_pose0", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "right_initial_pose0 = rospy.Publisher(\"right_initial_pose0\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L39_C0", "label": "froo_froo = Publisher()", "type": "assigned_variable", "loc": [39, 39], "level": 0, "parent": null, "vector": [14, 0, 0.1625, 0.0042, 0, 0.66, 0.5, 601, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "froo_froo", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "froo_froo = rospy.Publisher(\"froo_froo\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L40_C0", "label": "head_look_around = Publisher()", "type": "assigned_variable", "loc": [40, 40], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.0042, 0, 0.66, 0.5294, 428, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "head_look_around", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "head_look_around = rospy.Publisher(\"head_look_around2\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L42_C0", "label": "both_arms_forward2 = Publisher()", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 0.175, 0.0042, 0, 0.66, 0.5588, 512, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "both_arms_forward2", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "both_arms_forward2 = rospy.Publisher(\"both_arms_forward2\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L43_C0", "label": "both_arms_fold2 = Publisher()", "type": "assigned_variable", "loc": [43, 43], "level": 0, "parent": null, "vector": [14, 0, 0.1792, 0.0042, 0, 0.66, 0.5882, 743, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "both_arms_fold2", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "both_arms_fold2 = rospy.Publisher(\"both_arms_fold2\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L44_C0", "label": "both_arms_fold_end_pose = Publisher()", "type": "assigned_variable", "loc": [44, 44], "level": 0, "parent": null, "vector": [14, 0, 0.1833, 0.0042, 0, 0.66, 0.6176, 639, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "both_arms_fold_end_pose", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "both_arms_fold_end_pose = rospy.Publisher(\"both_arms_fold_end_pose\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L45_C0", "label": "head_turn = Publisher()", "type": "assigned_variable", "loc": [45, 45], "level": 0, "parent": null, "vector": [14, 0, 0.1875, 0.0042, 0, 0.66, 0.6471, 135, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "head_turn", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "head_turn = rospy.Publisher(\"head_turn\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L47_C0", "label": "arm_spin = Publisher()", "type": "assigned_variable", "loc": [47, 47], "level": 0, "parent": null, "vector": [14, 0, 0.1958, 0.0042, 0, 0.66, 0.6765, 71, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "arm_spin", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "arm_spin = rospy.Publisher(\"arm_spin\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L48_C0", "label": "raise_the_roof = Publisher()", "type": "assigned_variable", "loc": [48, 48], "level": 0, "parent": null, "vector": [14, 0, 0.2, 0.0042, 0, 0.66, 0.7059, 521, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "raise_the_roof", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "raise_the_roof = rospy.Publisher(\"raise_the_roof\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L49_C0", "label": "head_up_full = Publisher()", "type": "assigned_variable", "loc": [49, 49], "level": 0, "parent": null, "vector": [14, 0, 0.2042, 0.0042, 0, 0.66, 0.7353, 365, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "head_up_full", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "head_up_full = rospy.Publisher(\"head_up_full\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L50_C0", "label": "head_down_full = Publisher()", "type": "assigned_variable", "loc": [50, 50], "level": 0, "parent": null, "vector": [14, 0, 0.2083, 0.0042, 0, 0.66, 0.7647, 350, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "head_down_full", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "head_down_full = rospy.Publisher(\"head_down_full\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L51_C0", "label": "move_base = Publisher()", "type": "assigned_variable", "loc": [51, 51], "level": 0, "parent": null, "vector": [14, 0, 0.2125, 0.0042, 0, 0.66, 0.7941, 55, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "move_base", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "move_base = rospy.Publisher('simple_move_base', gm.Pose2D)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L59_C0", "label": "projector_on =", "type": "assigned_variable", "loc": [59, 72], "level": 0, "parent": null, "vector": [14, 0, 0.2729, 0.0583, 0, 0.66, 0.8235, 519, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "projector_on", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "projector_on = {'camera_reset': False,\n 'forearm_l_rate': 30.0,\n 'forearm_l_trig_mode': 1,\n 'forearm_r_rate': 30.0,\n 'forearm_r_trig_mode': 1,\n 'narrow_stereo_trig_mode': 2,\n 'projector_mode': 3,\n 'projector_pulse_length': 0.002,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L75_C0", "label": "projector_off =", "type": "assigned_variable", "loc": [75, 88], "level": 0, "parent": null, "vector": [14, 0, 0.3396, 0.0583, 0, 0.66, 0.8529, 912, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "projector_off", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "projector_off = {'camera_reset': False,\n 'forearm_l_rate': 30.0,\n 'forearm_l_trig_mode': 1,\n 'forearm_r_rate': 30.0,\n 'forearm_r_trig_mode': 1,\n 'narrow_stereo_trig_mode': 2,\n 'projector_mode': 1,\n 'projector_pulse_length': 0.002,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L89_C0", "label": "projector = Client()", "type": "assigned_variable", "loc": [89, 89], "level": 0, "parent": null, "vector": [14, 0, 0.3708, 0.0042, 0, 0.66, 0.8824, 101, 3, 1, 0, 0, 412, 10, 1], "semantic": {"name": "projector", "arg_names": [], "import_names": [], "rhs_call_name": "Client", "annotation": ""}, "snippet": "projector = dynamic_reconfigure.client.Client('camera_synchronizer_node')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L92_C0", "label": "r = Rate()", "type": "assigned_variable", "loc": [92, 92], "level": 0, "parent": null, "vector": [14, 0, 0.3833, 0.0042, 0, 0.66, 0.9118, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": "r = rospy.Rate(120/60.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L96_C0", "label": "i =", "type": "assigned_variable", "loc": [96, 96], "level": 0, "parent": null, "vector": [14, 0, 0.4, 0.0042, 0, 0.66, 0.9412, 826, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "i = -23"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "label": "while", "type": "while", "loc": [97, 214], "level": 0, "parent": null, "vector": [5, 0, 0.6479, 0.4917, 0, 0.66, 0.9706, 0, 0, 0, 0, 0, 0, 0, 99], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "while not rospy.is_shutdown():\n\n print('------------', i, '-------------')\n if i == -23:\n print('left_initial_pose0')\n left_initial_pose0.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 1.5)), rospy.get_param(\"~event\", \"\"))\n\n if i == -12:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L99_C4", "label": "print()", "type": "expression", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "vector": [8, 1, 0.4125, 0.0042, 1, 0.6, 0.0, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('------------', i, '-------------')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L100_C4", "label": "if", "type": "if", "loc": [100, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "vector": [4, 1, 0.4208, 0.0125, 1, 0.6, 0.0556, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i == -23:\n print('left_initial_pose0')\n left_initial_pose0.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 1.5)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L101_C8", "label": "print()", "type": "expression", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L100_C4", "vector": [8, 2, 0.4208, 0.0042, 2, 0.37, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('left_initial_pose0')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L102_C8", "label": "publish()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L100_C4", "vector": [8, 2, 0.425, 0.0042, 2, 0.37, 1.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " left_initial_pose0.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 1.5)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L104_C4", "label": "if", "type": "if", "loc": [104, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "vector": [4, 1, 0.4375, 0.0125, 1, 0.6, 0.1111, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i == -12:\n print('left_initial_pose')\n left_initial_pose.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 2.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L105_C8", "label": "print()", "type": "expression", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L104_C4", "vector": [8, 2, 0.4375, 0.0042, 2, 0.73, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('left_initial_pose')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L106_C8", "label": "publish()", "type": "expression", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L104_C4", "vector": [8, 2, 0.4417, 0.0042, 2, 0.73, 1.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " left_initial_pose.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 2.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L108_C4", "label": "if", "type": "if", "loc": [108, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "vector": [4, 1, 0.4542, 0.0125, 1, 0.6, 0.1667, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i == -6:\n print('arm_on')\n arm_on.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.3)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L109_C8", "label": "print()", "type": "expression", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L108_C4", "vector": [8, 2, 0.4542, 0.0042, 2, 0.78, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('arm_on')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L110_C8", "label": "publish()", "type": "expression", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L108_C4", "vector": [8, 2, 0.4583, 0.0042, 2, 0.78, 1.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " arm_on.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.3)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L112_C4", "label": "if", "type": "if", "loc": [112, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "vector": [4, 1, 0.4708, 0.0125, 1, 0.6, 0.2222, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i == -5:\n print('head_look_around')\n head_look_around.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.2)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L113_C8", "label": "print()", "type": "expression", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L112_C4", "vector": [8, 2, 0.4708, 0.0042, 2, 0.33, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('head_look_around')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L114_C8", "label": "publish()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L112_C4", "vector": [8, 2, 0.475, 0.0042, 2, 0.33, 1.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " head_look_around.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.2)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L116_C4", "label": "if", "type": "if", "loc": [116, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "vector": [4, 1, 0.5, 0.0375, 1, 0.6, 0.2778, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i >= 9 and i <= 49:\n arm_i = (i - 9)\n if arm_i % 8 == 0:\n print('lights off')\n arm_off.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", .8)), rospy.get_param(\"~event\", \"\"))\n\n if arm_i % 8 == 4:\n print('lights on')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L117_C8", "label": "arm_i =", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L116_C4", "vector": [14, 2, 0.4875, 0.0042, 2, 0.97, 0.0, 217, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arm_i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm_i = (i - 9)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L118_C8", "label": "if", "type": "if", "loc": [118, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L116_C4", "vector": [4, 2, 0.4958, 0.0125, 2, 0.97, 0.5, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm_i % 8 == 0:\n print('lights off')\n arm_off.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", .8)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L119_C12", "label": "print()", "type": "expression", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L118_C8", "vector": [8, 3, 0.4958, 0.0042, 3, 0.55, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('lights off')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L120_C12", "label": "publish()", "type": "expression", "loc": [120, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L118_C8", "vector": [8, 3, 0.5, 0.0042, 3, 0.55, 1.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " arm_off.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", .8)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L122_C8", "label": "if", "type": "if", "loc": [122, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L116_C4", "vector": [4, 2, 0.5125, 0.0125, 2, 0.97, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm_i % 8 == 4:\n print('lights on')\n arm_on.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", .8)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L123_C12", "label": "print()", "type": "expression", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L122_C8", "vector": [8, 3, 0.5125, 0.0042, 3, 0.34, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('lights on')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L124_C12", "label": "publish()", "type": "expression", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L122_C8", "vector": [8, 3, 0.5167, 0.0042, 3, 0.34, 1.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " arm_on.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", .8)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L126_C4", "label": "if", "type": "if", "loc": [126, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "vector": [4, 1, 0.5458, 0.0458, 1, 0.6, 0.3333, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i >= 15 and i <= 34:\n head_i = i - 15\n if head_i % 4 == 0:\n #Down\n print('down')\n head_down_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.1)), rospy.get_param(\"~event\", \"\"))\n #head_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.0)), rospy.get_param(\"~event\", \"\"))\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L127_C8", "label": "head_i =", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L126_C4", "vector": [14, 2, 0.5292, 0.0042, 2, 0.72, 0.0, 61, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "head_i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " head_i = i - 15"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L128_C8", "label": "if", "type": "if", "loc": [128, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L126_C4", "vector": [4, 2, 0.5396, 0.0167, 2, 0.72, 0.5, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if head_i % 4 == 0:\n #Down\n print('down')\n head_down_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.1)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L130_C12", "label": "print()", "type": "expression", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L128_C8", "vector": [8, 3, 0.5417, 0.0042, 3, 0.94, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('down')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L131_C12", "label": "publish()", "type": "expression", "loc": [131, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L128_C8", "vector": [8, 3, 0.5458, 0.0042, 3, 0.94, 1.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " head_down_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.1)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L134_C8", "label": "if", "type": "if", "loc": [134, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L126_C4", "vector": [4, 2, 0.5625, 0.0125, 2, 0.72, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if head_i % 4 == 2:\n #Up\n print('up')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L136_C12", "label": "print()", "type": "expression", "loc": [136, 136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L134_C8", "vector": [8, 3, 0.5667, 0.0042, 3, 0.52, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('up')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L141_C4", "label": "if", "type": "if", "loc": [141, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "vector": [4, 1, 0.6021, 0.0333, 1, 0.6, 0.3889, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i >= 40 and i <= 43:\n head_i = i - 41\n if head_i % 4 == 0:\n head_down_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.1)), rospy.get_param(\"~event\", \"\"))\n print('down')\n\n if head_i % 4 == 2:\n print('up')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L142_C8", "label": "head_i =", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L141_C4", "vector": [14, 2, 0.5917, 0.0042, 2, 0.23, 0.0, 61, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "head_i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " head_i = i - 41"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L143_C8", "label": "if", "type": "if", "loc": [143, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L141_C4", "vector": [4, 2, 0.6, 0.0125, 2, 0.23, 0.5, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if head_i % 4 == 0:\n head_down_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.1)), rospy.get_param(\"~event\", \"\"))\n print('down')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L144_C12", "label": "publish()", "type": "expression", "loc": [144, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L143_C8", "vector": [8, 3, 0.6, 0.0042, 3, 0.56, 0.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " head_down_up.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.1)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L145_C12", "label": "print()", "type": "expression", "loc": [145, 145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L143_C8", "vector": [8, 3, 0.6042, 0.0042, 3, 0.56, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('down')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L147_C8", "label": "if", "type": "if", "loc": [147, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L141_C4", "vector": [4, 2, 0.6146, 0.0083, 2, 0.23, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if head_i % 4 == 2:\n print('up')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L148_C12", "label": "print()", "type": "expression", "loc": [148, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L147_C8", "vector": [8, 3, 0.6167, 0.0042, 3, 0.09, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('up')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L154_C4", "label": "if", "type": "if", "loc": [154, 156], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "vector": [4, 1, 0.6458, 0.0125, 1, 0.6, 0.4444, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i == 23:\n print('right_initial_pose0')\n right_initial_pose0.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.3)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L155_C8", "label": "print()", "type": "expression", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L154_C4", "vector": [8, 2, 0.6458, 0.0042, 2, 0.0, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('right_initial_pose0')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L156_C8", "label": "publish()", "type": "expression", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L154_C4", "vector": [8, 2, 0.65, 0.0042, 2, 0.0, 1.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " right_initial_pose0.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.3)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L162_C4", "label": "if", "type": "if", "loc": [162, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "vector": [4, 1, 0.6813, 0.0167, 1, 0.6, 0.5, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i == 26:\n #if i == 29:\n print('arm_spin')\n arm_spin.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 3.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L164_C8", "label": "print()", "type": "expression", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L162_C4", "vector": [8, 2, 0.6833, 0.0042, 2, 0.09, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('arm_spin')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L165_C8", "label": "publish()", "type": "expression", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L162_C4", "vector": [8, 2, 0.6875, 0.0042, 2, 0.09, 1.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " arm_spin.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 3.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L172_C4", "label": "if", "type": "if", "loc": [172, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "vector": [4, 1, 0.725, 0.0208, 1, 0.6, 0.5556, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i == 42:\n #if i == 45:\n #ANOTHER FREESTYLE\n print('raise_the_roof')\n raise_the_roof.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 3.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L175_C8", "label": "print()", "type": "expression", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L172_C4", "vector": [8, 2, 0.7292, 0.0042, 2, 0.73, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('raise_the_roof')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L176_C8", "label": "publish()", "type": "expression", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L172_C4", "vector": [8, 2, 0.7333, 0.0042, 2, 0.73, 1.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " raise_the_roof.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 3.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L181_C4", "label": "if", "type": "if", "loc": [181, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "vector": [4, 1, 0.7604, 0.0167, 1, 0.6, 0.6111, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i == 53:\n print('head_down')\n print('both_arms_forward2')\n both_arms_forward2.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 2)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L182_C8", "label": "print()", "type": "expression", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L181_C4", "vector": [8, 2, 0.7583, 0.0042, 2, 0.55, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('head_down')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L183_C8", "label": "print()", "type": "expression", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L181_C4", "vector": [8, 2, 0.7625, 0.0042, 2, 0.55, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('both_arms_forward2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L184_C8", "label": "publish()", "type": "expression", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L181_C4", "vector": [8, 2, 0.7667, 0.0042, 2, 0.55, 1.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " both_arms_forward2.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 2)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L186_C4", "label": "if", "type": "if", "loc": [186, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "vector": [4, 1, 0.7854, 0.025, 1, 0.6, 0.6667, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i == 56:\n p2d = gm.Pose2D()\n p2d.x = -.4\n p2d.y = .15\n move_base.publish(p2d)\n head_down_full.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.5)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L187_C8", "label": "p2d = Pose2D()", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L186_C4", "vector": [14, 2, 0.7792, 0.0042, 2, 0.15, 0.0, 716, 3, 0, 0, 0, 810, 10, 1], "semantic": {"name": "p2d", "arg_names": [], "import_names": [], "rhs_call_name": "Pose2D", "annotation": ""}, "snippet": " p2d = gm.Pose2D()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L188_C8", "label": "p2d.x =", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L186_C4", "vector": [14, 2, 0.7833, 0.0042, 2, 0.15, 0.25, 958, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p2d.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p2d.x = -.4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L189_C8", "label": "p2d.y =", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L186_C4", "vector": [14, 2, 0.7875, 0.0042, 2, 0.15, 0.5, 302, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "p2d.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p2d.y = .15"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L190_C8", "label": "publish()", "type": "expression", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L186_C4", "vector": [8, 2, 0.7917, 0.0042, 2, 0.15, 0.75, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " move_base.publish(p2d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L191_C8", "label": "publish()", "type": "expression", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L186_C4", "vector": [8, 2, 0.7958, 0.0042, 2, 0.15, 1.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " head_down_full.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.5)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L193_C4", "label": "if", "type": "if", "loc": [193, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "vector": [4, 1, 0.8125, 0.0208, 1, 0.6, 0.7222, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i == 61:\n print('head_up')\n print('both_arms_fold2')\n head_up_full.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.4)), rospy.get_param(\"~event\", \"\"))\n both_arms_fold2.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.8)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L194_C8", "label": "print()", "type": "expression", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L193_C4", "vector": [8, 2, 0.8083, 0.0042, 2, 0.92, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('head_up')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L195_C8", "label": "print()", "type": "expression", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L193_C4", "vector": [8, 2, 0.8125, 0.0042, 2, 0.92, 0.3333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('both_arms_fold2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L196_C8", "label": "publish()", "type": "expression", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L193_C4", "vector": [8, 2, 0.8167, 0.0042, 2, 0.92, 0.6667, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " head_up_full.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.4)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L197_C8", "label": "publish()", "type": "expression", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L193_C4", "vector": [8, 2, 0.8208, 0.0042, 2, 0.92, 1.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " both_arms_fold2.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.8)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L199_C4", "label": "if", "type": "if", "loc": [199, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "vector": [4, 1, 0.8375, 0.0208, 1, 0.6, 0.7778, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i == 65:\n p2d = gm.Pose2D()\n p2d.y = 100.\n p2d.theta = -390\n move_base.publish(p2d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L200_C8", "label": "p2d = Pose2D()", "type": "assigned_variable", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L199_C4", "vector": [14, 2, 0.8333, 0.0042, 2, 0.71, 0.0, 716, 3, 0, 0, 0, 810, 10, 1], "semantic": {"name": "p2d", "arg_names": [], "import_names": [], "rhs_call_name": "Pose2D", "annotation": ""}, "snippet": " p2d = gm.Pose2D()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L201_C8", "label": "p2d.y =", "type": "assigned_variable", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L199_C4", "vector": [14, 2, 0.8375, 0.0042, 2, 0.71, 0.3333, 302, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "p2d.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p2d.y = 100."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L202_C8", "label": "p2d.theta =", "type": "assigned_variable", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L199_C4", "vector": [14, 2, 0.8417, 0.0042, 2, 0.71, 0.6667, 718, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p2d.theta", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p2d.theta = -390"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L203_C8", "label": "publish()", "type": "expression", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L199_C4", "vector": [8, 2, 0.8458, 0.0042, 2, 0.71, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " move_base.publish(p2d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L205_C4", "label": "if", "type": "if", "loc": [205, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "vector": [4, 1, 0.8625, 0.0208, 1, 0.6, 0.8333, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i == 77:\n print('both_arms_fold_end_pose')\n print('head_turn')\n head_turn.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 7.0)), rospy.get_param(\"~event\", \"\"))\n both_arms_fold_end_pose.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.8)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L206_C8", "label": "print()", "type": "expression", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L205_C4", "vector": [8, 2, 0.8583, 0.0042, 2, 0.01, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('both_arms_fold_end_pose')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L207_C8", "label": "print()", "type": "expression", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L205_C4", "vector": [8, 2, 0.8625, 0.0042, 2, 0.01, 0.3333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('head_turn')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L208_C8", "label": "publish()", "type": "expression", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L205_C4", "vector": [8, 2, 0.8667, 0.0042, 2, 0.01, 0.6667, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " head_turn.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 7.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L209_C8", "label": "publish()", "type": "expression", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L205_C4", "vector": [8, 2, 0.8708, 0.0042, 2, 0.01, 1.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " both_arms_fold_end_pose.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.8)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L211_C4", "label": "i =", "type": "assigned_variable", "loc": [211, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "vector": [14, 1, 0.8792, 0.0042, 1, 0.6, 0.8889, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = i+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L212_C4", "label": "sleep()", "type": "expression", "loc": [212, 212], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "vector": [8, 1, 0.8833, 0.0042, 1, 0.6, 0.9444, 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_99705:If_L213_C4", "label": "if", "type": "if", "loc": [213, 214], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "vector": [4, 1, 0.8896, 0.0083, 1, 0.6, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i == 80:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L216_C0", "label": "update_configuration()", "type": "expression", "loc": [216, 216], "level": 0, "parent": null, "vector": [8, 0, 0.9, 0.0042, 0, 0.66, 1.0, 662, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update_configuration", "arg_names": [], "import_names": [], "rhs_call_name": "update_configuration", "annotation": ""}, "snippet": "projector.update_configuration(projector_off)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L112_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L112_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L118_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L118_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L120_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L143_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L143_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L147_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L186_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L193_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L193_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L193_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L193_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Assign_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:Expr_L212_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99705:While_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99705:If_L213_C4"}]
import roslib roslib.load_manifest('trigger_msgs') import sys import rospy import cv import trigger_msgs.msg rospy.init_node("trigger", anonymous=True) arm_trigger = rospy.Publisher("arm_trigger", trigger_msgs.msg.Trigger, latch = True) head_trigger = rospy.Publisher("head_trigger", trigger_msgs.msg.Trigger, latch = True) cv.NamedWindow('keyboard', 1) img = cv.CreateImage((30, 30), cv.IPL_DEPTH_8U, 1) #r = rospy.Rate(132/60.) r = rospy.Rate(10.) i = 0 while not rospy.is_shutdown(): cv.ShowImage('keyboard', img) k = cv.WaitKey(10) #print (k & 0xff), k if chr(k & 0xff) == 'h': print 'head!' head_trigger.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.0)), rospy.get_param("~event", "")) if chr(k & 0xff) == 'a': print 'arm!' arm_trigger.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param("~delay", 0.0)), rospy.get_param("~event", "")) #if i % 4 == 0: #if i % 8 == 0: #i = i+1 #r.sleep()
ajibawa-2023/Python-Code-Large/train/row_99706
22
35
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99706:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0286, 0.0286, 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_99706:Expr_L2_C0", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0571, 0.0286, 0, 0.66, 0.0769, 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('trigger_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99706:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0857, 0.0286, 0, 0.66, 0.1538, 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_99706:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1143, 0.0286, 0, 0.66, 0.2308, 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_99706:Import_L5_C0", "label": "cv import cv", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0286, 0, 0.66, 0.3077, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99706:Import_L7_C0", "label": "trigger_msgs.msg import trigger_msgs.msg", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.0286, 0, 0.66, 0.3846, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "trigger_msgs.msg", "arg_names": [], "import_names": ["trigger_msgs.msg"], "rhs_call_name": "", "annotation": ""}, "snippet": "import trigger_msgs.msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99706:Expr_L9_C0", "label": "init_node()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.2571, 0.0286, 0, 0.66, 0.4615, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": "rospy.init_node(\"trigger\", anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99706:Assign_L10_C0", "label": "arm_trigger = Publisher()", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2857, 0.0286, 0, 0.66, 0.5385, 696, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "arm_trigger", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "arm_trigger = rospy.Publisher(\"arm_trigger\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99706:Assign_L11_C0", "label": "head_trigger = Publisher()", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.3143, 0.0286, 0, 0.66, 0.6154, 318, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "head_trigger", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "head_trigger = rospy.Publisher(\"head_trigger\", trigger_msgs.msg.Trigger, latch = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99706:Expr_L12_C0", "label": "NamedWindow()", "type": "expression", "loc": [12, 12], "level": 0, "parent": null, "vector": [8, 0, 0.3429, 0.0286, 0, 0.66, 0.6923, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": "cv.NamedWindow('keyboard', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99706:Assign_L13_C0", "label": "img = CreateImage()", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.3714, 0.0286, 0, 0.66, 0.7692, 200, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "img", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": "img = cv.CreateImage((30, 30), cv.IPL_DEPTH_8U, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99706:Assign_L15_C0", "label": "r = Rate()", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.4286, 0.0286, 0, 0.66, 0.8462, 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_99706:Assign_L17_C0", "label": "i =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.4857, 0.0286, 0, 0.66, 0.9231, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99706:While_L18_C0", "label": "while", "type": "while", "loc": [18, 28], "level": 0, "parent": null, "vector": [5, 0, 0.6571, 0.3143, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 17], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "while not rospy.is_shutdown():\n cv.ShowImage('keyboard', img)\n k = cv.WaitKey(10)\n #print (k & 0xff), k\n if chr(k & 0xff) == 'h':\n print('head!')\n head_trigger.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.0)), rospy.get_param(\"~event\", \"\"))\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99706:Expr_L19_C4", "label": "ShowImage()", "type": "expression", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99706:While_L18_C0", "vector": [8, 1, 0.5429, 0.0286, 1, 0.75, 0.0, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage('keyboard', img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99706:Assign_L20_C4", "label": "k = WaitKey()", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99706:While_L18_C0", "vector": [14, 1, 0.5714, 0.0286, 1, 0.75, 0.3333, 954, 3, 1, 0, 0, 885, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " k = cv.WaitKey(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99706:If_L22_C4", "label": "if", "type": "if", "loc": [22, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99706:While_L18_C0", "vector": [4, 1, 0.6571, 0.0857, 1, 0.75, 0.6667, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if chr(k & 0xff) == 'h':\n print('head!')\n head_trigger.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99706:Expr_L23_C8", "label": "print()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99706:If_L22_C4", "vector": [8, 2, 0.6571, 0.0286, 2, 0.24, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('head!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99706:Expr_L24_C8", "label": "publish()", "type": "expression", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99706:If_L22_C4", "vector": [8, 2, 0.6857, 0.0286, 2, 0.24, 1.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " head_trigger.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99706:If_L26_C4", "label": "if", "type": "if", "loc": [26, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99706:While_L18_C0", "vector": [4, 1, 0.7714, 0.0857, 1, 0.75, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if chr(k & 0xff) == 'a':\n print('arm!')\n arm_trigger.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.0)), rospy.get_param(\"~event\", \"\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99706:Expr_L27_C8", "label": "print()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99706:If_L26_C4", "vector": [8, 2, 0.7714, 0.0286, 2, 0.33, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('arm!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99706:Expr_L28_C8", "label": "publish()", "type": "expression", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99706:If_L26_C4", "vector": [8, 2, 0.8, 0.0286, 2, 0.33, 1.0, 102, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " arm_trigger.publish(rospy.get_rostime() + rospy.Duration(rospy.get_param(\"~delay\", 0.0)), rospy.get_param(\"~event\", \"\"))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99706:While_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99706:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99706:While_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99706:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99706:While_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99706:If_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99706:If_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99706:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99706:If_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99706:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99706:While_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99706:If_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99706:If_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99706:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99706:If_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99706:Expr_L28_C8"}]
#!/usr/bin/env python # # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) import roslib; roslib.load_manifest('laser_camera_segmentation') import rospy from laser_camera_segmentation.srv._Segmentation import * import sensor_msgs from laser_camera_segmentation.ROS_interface_helper_functions import * import laser_camera_segmentation.processor as processor import laser_camera_segmentation.configuration as configuration from labeling.scan_dataset import scan_dataset def segment_pointcloud(request): #convert data from ROS pts3d, intensities, labels = convert_ROS_pointcloud_to_pointcloud(request.pointcloud) cvimage = convert_ROS_image_to_cvimage(request.image, request.imageWidth, request.imageHeight) polygon = convert_ROS_polygon_to_polygon(request.regionOfInterest2D) polygon.set_label('surface') print polygon, polygon.get_points() #create processor and configuration #cfg = configuration.configuration('/home/martin/robot1_data/usr/martin/ROS_server_test', 'codyRobot') cfg = configuration.configuration('../data/ROS_server', 'dummyScanner') pc = processor.processor(cfg) pc.scan_dataset = scan_dataset() pc.scan_dataset.image_artag_filename = '' pc.scan_dataset.table_plane_translation = np.matrix([0,0,0]).T pc.scan_dataset.ground_plane_translation = np.matrix([0,0,request.laserHeightAboveGround]).T pc.scan_dataset.ground_plane_rotation = '' #pc.scan_dataset.is_test_set = True pc.scan_dataset.is_labeled = True pc.scan_dataset.id = 'ROStest' pc.img = cvimage pc.image_angle = request.imageAngle pc.pts3d = pts3d pc.intensities = intensities pc.scan_indices = np.zeros(len(intensities)) pc.scan_dataset.polygons.append(polygon) pc.do_all_point_cloud() pc.do_polygon_mapping() pc.scan_dataset.ground_plane_normal = np.matrix([0.,0.,1.]).T if request.numberOfPointsToClassify == -1: n = 999999999999 else: n = request.numberOfPointsToClassify feature_data = pc.generate_features(n, False, True) labels, testresults = pc.load_classifier_and_test_on_dataset('all_post', feature_data) response = SegmentationResponse() response.pointcloud = convert_pointcloud_to_ROS(pc.pts3d_bound, pc.intensities_bound, labels) return response def segmentation_server(): rospy.init_node('segmentation_server') s = rospy.Service('segment_pointcloud', Segmentation, segment_pointcloud) print "Ready to segment pointclouds!" rospy.spin() if __name__ == "__main__": segmentation_server()
ajibawa-2023/Python-Code-Large/train/row_99708
48
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_99708:Import_L31_C0", "label": "roslib import roslib", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.3131, 0.0101, 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; roslib.load_manifest('laser_camera_segmentation')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Expr_L31_C15", "label": "load_manifest()", "type": "expression", "loc": [31, 31], "level": 0, "parent": null, "vector": [8, 0, 0.3131, 0.0101, 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": "import roslib; roslib.load_manifest('laser_camera_segmentation')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Import_L33_C0", "label": "rospy import rospy", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.0101, 0, 0.66, 0.1818, 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_99708:ImportFrom_L35_C0", "label": "from laser_camera_segmentation.srv._Segmentation import *", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.3535, 0.0101, 0, 0.66, 0.2727, 322, 0, 1, 0, 0, 322, 0, 0], "semantic": {"name": "laser_camera_segmentation.srv._Segmentation", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from laser_camera_segmentation.srv._Segmentation import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Import_L36_C0", "label": "sensor_msgs import sensor_msgs", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.3636, 0.0101, 0, 0.66, 0.3636, 61, 0, 1, 0, 0, 61, 0, 0], "semantic": {"name": "sensor_msgs", "arg_names": [], "import_names": ["sensor_msgs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sensor_msgs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:ImportFrom_L38_C0", "label": "from laser_camera_segmentation.ROS_interface_helper_functions import *", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.3838, 0.0101, 0, 0.66, 0.4545, 898, 0, 1, 0, 0, 898, 0, 0], "semantic": {"name": "laser_camera_segmentation.ROS_interface_helper_functions", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from laser_camera_segmentation.ROS_interface_helper_functions import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Import_L40_C0", "label": "laser_camera_segmentation.processor import processor", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.404, 0.0101, 0, 0.66, 0.5455, 235, 0, 1, 0, 0, 235, 0, 0], "semantic": {"name": "laser_camera_segmentation.processor", "arg_names": [], "import_names": ["processor"], "rhs_call_name": "", "annotation": ""}, "snippet": "import laser_camera_segmentation.processor as processor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Import_L41_C0", "label": "laser_camera_segmentation.configuration import configuration", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.4141, 0.0101, 0, 0.66, 0.6364, 995, 0, 1, 0, 0, 995, 0, 0], "semantic": {"name": "laser_camera_segmentation.configuration", "arg_names": [], "import_names": ["configuration"], "rhs_call_name": "", "annotation": ""}, "snippet": "import laser_camera_segmentation.configuration as configuration"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:ImportFrom_L43_C0", "label": "from labeling.scan_dataset import scan_dataset", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.4343, 0.0101, 0, 0.66, 0.7273, 710, 0, 1, 0, 0, 710, 0, 0], "semantic": {"name": "labeling.scan_dataset", "arg_names": [], "import_names": ["scan_dataset"], "rhs_call_name": "", "annotation": ""}, "snippet": "from labeling.scan_dataset import scan_dataset"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "label": "segment_pointcloud", "type": "function", "loc": [45, 89], "level": 0, "parent": null, "vector": [2, 0, 0.6768, 0.4545, 0, 0.66, 0.8182, 499, 0, 1, 1, 0, 0, 0, 21], "semantic": {"name": "segment_pointcloud", "arg_names": ["request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def segment_pointcloud(request):\n #convert data from ROS\n pts3d, intensities, labels = convert_ROS_pointcloud_to_pointcloud(request.pointcloud)\n cvimage = convert_ROS_image_to_cvimage(request.image, request.imageWidth, request.imageHeight)\n polygon = convert_ROS_polygon_to_polygon(request.regionOfInterest2D)\n polygon.set_label('surface')\n print(polygon, polygon.get_points())\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L47_C4", "label": "pts3d, intensities, labels = convert_ROS_pointcloud_to_pointcloud()", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.4747, 0.0101, 1, 0.0, 0.0, 226, 3, 1, 0, 0, 227, 10, 1], "semantic": {"name": "pts3d, intensities, labels", "arg_names": [], "import_names": [], "rhs_call_name": "convert_ROS_pointcloud_to_pointcloud", "annotation": ""}, "snippet": " pts3d, intensities, labels = convert_ROS_pointcloud_to_pointcloud(request.pointcloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L48_C4", "label": "cvimage = convert_ROS_image_to_cvimage()", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.4848, 0.0101, 1, 0.0, 0.0357, 103, 3, 3, 0, 0, 988, 10, 1], "semantic": {"name": "cvimage", "arg_names": [], "import_names": [], "rhs_call_name": "convert_ROS_image_to_cvimage", "annotation": ""}, "snippet": " cvimage = convert_ROS_image_to_cvimage(request.image, request.imageWidth, request.imageHeight)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L49_C4", "label": "polygon = convert_ROS_polygon_to_polygon()", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.4949, 0.0101, 1, 0.0, 0.0714, 854, 3, 1, 0, 0, 250, 10, 1], "semantic": {"name": "polygon", "arg_names": [], "import_names": [], "rhs_call_name": "convert_ROS_polygon_to_polygon", "annotation": ""}, "snippet": " polygon = convert_ROS_polygon_to_polygon(request.regionOfInterest2D)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Expr_L50_C4", "label": "set_label()", "type": "expression", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [8, 1, 0.5051, 0.0101, 1, 0.0, 0.1071, 88, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_label", "arg_names": [], "import_names": [], "rhs_call_name": "set_label", "annotation": ""}, "snippet": " polygon.set_label('surface')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Expr_L51_C4", "label": "print()", "type": "expression", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [8, 1, 0.5152, 0.0101, 1, 0.0, 0.1429, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(polygon, polygon.get_points())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L55_C4", "label": "cfg = configuration()", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.5556, 0.0101, 1, 0.0, 0.1786, 46, 3, 2, 0, 0, 627, 10, 1], "semantic": {"name": "cfg", "arg_names": [], "import_names": [], "rhs_call_name": "configuration", "annotation": ""}, "snippet": " cfg = configuration.configuration('../data/ROS_server', 'dummyScanner')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L56_C4", "label": "pc = processor()", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.5657, 0.0101, 1, 0.0, 0.2143, 876, 3, 1, 0, 0, 177, 10, 1], "semantic": {"name": "pc", "arg_names": [], "import_names": [], "rhs_call_name": "processor", "annotation": ""}, "snippet": " pc = processor.processor(cfg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L58_C4", "label": "pc.scan_dataset = scan_dataset()", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.5859, 0.0101, 1, 0.0, 0.25, 977, 3, 0, 0, 0, 727, 10, 1], "semantic": {"name": "pc.scan_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "scan_dataset", "annotation": ""}, "snippet": " pc.scan_dataset = scan_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L59_C4", "label": "pc.scan_dataset.image_artag_filename =", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.596, 0.0101, 1, 0.0, 0.2857, 299, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "pc.scan_dataset.image_artag_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.scan_dataset.image_artag_filename = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L60_C4", "label": "pc.scan_dataset.table_plane_translation =", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.6061, 0.0101, 1, 0.0, 0.3214, 270, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pc.scan_dataset.table_plane_translation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.scan_dataset.table_plane_translation = np.matrix([0,0,0]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L62_C4", "label": "pc.scan_dataset.ground_plane_translation =", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.6263, 0.0101, 1, 0.0, 0.3571, 85, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pc.scan_dataset.ground_plane_translation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.scan_dataset.ground_plane_translation = np.matrix([0,0,request.laserHeightAboveGround]).T "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L63_C4", "label": "pc.scan_dataset.ground_plane_rotation =", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.6364, 0.0101, 1, 0.0, 0.3929, 671, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "pc.scan_dataset.ground_plane_rotation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.scan_dataset.ground_plane_rotation = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L65_C4", "label": "pc.scan_dataset.is_labeled =", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.6566, 0.0101, 1, 0.0, 0.4286, 712, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "pc.scan_dataset.is_labeled", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.scan_dataset.is_labeled = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L66_C4", "label": "pc.scan_dataset.id =", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.6667, 0.0101, 1, 0.0, 0.4643, 850, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "pc.scan_dataset.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.scan_dataset.id = 'ROStest'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L68_C4", "label": "pc.img =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.6869, 0.0101, 1, 0.0, 0.5, 4, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pc.img", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.img = cvimage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L69_C4", "label": "pc.image_angle =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.697, 0.0101, 1, 0.0, 0.5357, 103, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pc.image_angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.image_angle = request.imageAngle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L70_C4", "label": "pc.pts3d =", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.7071, 0.0101, 1, 0.0, 0.5714, 76, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pc.pts3d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.pts3d = pts3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L71_C4", "label": "pc.intensities =", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.7172, 0.0101, 1, 0.0, 0.6071, 960, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pc.intensities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.intensities = intensities"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L72_C4", "label": "pc.scan_indices = zeros()", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.7273, 0.0101, 1, 0.0, 0.6429, 426, 3, 1, 0, 0, 213, 10, 2], "semantic": {"name": "pc.scan_indices", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " pc.scan_indices = np.zeros(len(intensities))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Expr_L74_C4", "label": "append()", "type": "expression", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [8, 1, 0.7475, 0.0101, 1, 0.0, 0.6786, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " pc.scan_dataset.polygons.append(polygon)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Expr_L75_C4", "label": "do_all_point_cloud()", "type": "expression", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [8, 1, 0.7576, 0.0101, 1, 0.0, 0.7143, 194, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "do_all_point_cloud", "arg_names": [], "import_names": [], "rhs_call_name": "do_all_point_cloud", "annotation": ""}, "snippet": " pc.do_all_point_cloud()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Expr_L76_C4", "label": "do_polygon_mapping()", "type": "expression", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [8, 1, 0.7677, 0.0101, 1, 0.0, 0.75, 954, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "do_polygon_mapping", "arg_names": [], "import_names": [], "rhs_call_name": "do_polygon_mapping", "annotation": ""}, "snippet": " pc.do_polygon_mapping()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L78_C4", "label": "pc.scan_dataset.ground_plane_normal =", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.7879, 0.0101, 1, 0.0, 0.7857, 810, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pc.scan_dataset.ground_plane_normal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.scan_dataset.ground_plane_normal = np.matrix([0.,0.,1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:If_L80_C4", "label": "if", "type": "if", "loc": [80, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [4, 1, 0.8232, 0.0404, 1, 0.0, 0.8214, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if request.numberOfPointsToClassify == -1:\n n = 999999999999\n else:\n n = request.numberOfPointsToClassify"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L81_C8", "label": "n =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:If_L80_C4", "vector": [14, 2, 0.8182, 0.0101, 2, 0.06, 0.0, 773, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n = 999999999999"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L83_C8", "label": "n =", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:If_L80_C4", "vector": [14, 2, 0.8384, 0.0101, 2, 0.06, 1.0, 773, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n = request.numberOfPointsToClassify"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L84_C4", "label": "feature_data = generate_features()", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.8485, 0.0101, 1, 0.0, 0.8571, 491, 3, 3, 0, 0, 250, 10, 1], "semantic": {"name": "feature_data", "arg_names": [], "import_names": [], "rhs_call_name": "generate_features", "annotation": ""}, "snippet": " feature_data = pc.generate_features(n, False, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L85_C4", "label": "labels, testresults = load_classifier_and_test_on_dataset()", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.8586, 0.0101, 1, 0.0, 0.8929, 321, 3, 2, 0, 0, 725, 10, 1], "semantic": {"name": "labels, testresults", "arg_names": [], "import_names": [], "rhs_call_name": "load_classifier_and_test_on_dataset", "annotation": ""}, "snippet": " labels, testresults = pc.load_classifier_and_test_on_dataset('all_post', feature_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L87_C4", "label": "response = SegmentationResponse()", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.8788, 0.0101, 1, 0.0, 0.9286, 511, 3, 0, 0, 0, 702, 10, 1], "semantic": {"name": "response", "arg_names": [], "import_names": [], "rhs_call_name": "SegmentationResponse", "annotation": ""}, "snippet": " response = SegmentationResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L88_C4", "label": "response.pointcloud = convert_pointcloud_to_ROS()", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [14, 1, 0.8889, 0.0101, 1, 0.0, 0.9643, 173, 3, 3, 0, 0, 783, 10, 1], "semantic": {"name": "response.pointcloud", "arg_names": [], "import_names": [], "rhs_call_name": "convert_pointcloud_to_ROS", "annotation": ""}, "snippet": " response.pointcloud = convert_pointcloud_to_ROS(pc.pts3d_bound, pc.intensities_bound, labels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Return_L89_C4", "label": "return", "type": "return", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "vector": [13, 1, 0.899, 0.0101, 1, 0.0, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return response"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L92_C0", "label": "segmentation_server", "type": "function", "loc": [92, 96], "level": 0, "parent": null, "vector": [2, 0, 0.9495, 0.0505, 0, 0.66, 0.9091, 185, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "segmentation_server", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def segmentation_server():\n rospy.init_node('segmentation_server')\n s = rospy.Service('segment_pointcloud', Segmentation, segment_pointcloud)\n print(\"Ready to segment pointclouds!\")\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Expr_L93_C4", "label": "init_node()", "type": "expression", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L92_C0", "vector": [8, 1, 0.9394, 0.0101, 1, 0.64, 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('segmentation_server')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L94_C4", "label": "s = Service()", "type": "assigned_variable", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L92_C0", "vector": [14, 1, 0.9495, 0.0101, 1, 0.64, 0.3333, 553, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " s = rospy.Service('segment_pointcloud', Segmentation, segment_pointcloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Expr_L95_C4", "label": "print()", "type": "expression", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L92_C0", "vector": [8, 1, 0.9596, 0.0101, 1, 0.64, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Ready to segment pointclouds!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Expr_L96_C4", "label": "spin()", "type": "expression", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L92_C0", "vector": [8, 1, 0.9697, 0.0101, 1, 0.64, 1.0, 17, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "spin", "arg_names": [], "import_names": [], "rhs_call_name": "spin", "annotation": ""}, "snippet": " rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:If_L98_C0", "label": "if", "type": "if", "loc": [98, 99], "level": 0, "parent": null, "vector": [4, 0, 0.9949, 0.0202, 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 segmentation_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99708:Expr_L99_C4", "label": "segmentation_server()", "type": "expression", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99708:If_L98_C0", "vector": [8, 1, 1.0, 0.0101, 1, 0.16, 0.0, 185, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "segmentation_server", "arg_names": [], "import_names": [], "rhs_call_name": "segmentation_server", "annotation": ""}, "snippet": " segmentation_server()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Expr_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Expr_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Expr_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Expr_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:If_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:If_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:If_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Return_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Expr_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Assign_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Expr_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Expr_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99708:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99708:Expr_L99_C4"}]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) class label_object(object): def __init__(self): ''' Constructor ''' self.points = [] self.label = 'object' def get_points(self): return self.points def add_point(self, x): self.points.append(x) def set_label(self, label): self.label = label def get_label(self): return self.label def get_type(self): if self.label == 'edge' or self.label == 'edge_up' or self.label == 'edge_down': return 'line' else: return 'polygon' def set_type(self, type): self.type = type def delete_last_point(self): self.points.pop() def is_empty(self): return len(self.points)==0
ajibawa-2023/Python-Code-Large/train/row_99709
23
67
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99709:ClassDef_L29_C0", "label": "label_object", "type": "class", "loc": [29, 67], "level": 0, "parent": null, "vector": [3, 0, 0.7164, 0.5821, 0, 0.66, 0.0, 589, 0, 9, 0, 0, 186, 0, 3], "semantic": {"name": "label_object", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class label_object(object):\n\n\n def __init__(self):\n '''\n Constructor\n '''\n self.points = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L32_C4", "label": "__init__", "type": "function", "loc": [32, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:ClassDef_L29_C0", "vector": [2, 1, 0.5149, 0.0896, 1, 0.68, 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 '''\n Constructor\n '''\n self.points = []\n self.label = 'object'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99709:Expr_L33_C8", "label": "expression", "type": "expression", "loc": [33, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L32_C4", "vector": [8, 2, 0.5075, 0.0448, 2, 0.85, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n Constructor\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99709:Assign_L36_C8", "label": "self.points =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L32_C4", "vector": [14, 2, 0.5373, 0.0149, 2, 0.85, 0.5, 831, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.points", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.points = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99709:Assign_L37_C8", "label": "self.label =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L32_C4", "vector": [14, 2, 0.5522, 0.0149, 2, 0.85, 1.0, 51, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.label = 'object'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L40_C4", "label": "get_points", "type": "function", "loc": [40, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:ClassDef_L29_C0", "vector": [2, 1, 0.6045, 0.0299, 1, 0.68, 0.125, 522, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_points", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_points(self):\n return self.points"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99709:Return_L41_C8", "label": "return", "type": "return", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L40_C4", "vector": [13, 2, 0.6119, 0.0149, 2, 0.74, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.points"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L44_C4", "label": "add_point", "type": "function", "loc": [44, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:ClassDef_L29_C0", "vector": [2, 1, 0.6642, 0.0299, 1, 0.68, 0.25, 692, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_point", "arg_names": ["self", "x"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_point(self, x):\n self.points.append(x) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99709:Expr_L45_C8", "label": "append()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L44_C4", "vector": [8, 2, 0.6716, 0.0149, 2, 0.69, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.points.append(x) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L48_C4", "label": "set_label", "type": "function", "loc": [48, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:ClassDef_L29_C0", "vector": [2, 1, 0.7239, 0.0299, 1, 0.68, 0.375, 88, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "set_label", "arg_names": ["self", "label"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_label(self, label):\n self.label = label"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99709:Assign_L49_C8", "label": "self.label =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L48_C4", "vector": [14, 2, 0.7313, 0.0149, 2, 0.94, 0.0, 51, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.label = label"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L51_C4", "label": "get_label", "type": "function", "loc": [51, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:ClassDef_L29_C0", "vector": [2, 1, 0.7687, 0.0299, 1, 0.68, 0.5, 305, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_label", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_label(self):\n return self.label "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99709:Return_L52_C8", "label": "return", "type": "return", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L51_C4", "vector": [13, 2, 0.7761, 0.0149, 2, 0.92, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.label "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L54_C4", "label": "get_type", "type": "function", "loc": [54, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:ClassDef_L29_C0", "vector": [2, 1, 0.8358, 0.0746, 1, 0.68, 0.625, 606, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_type", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_type(self):\n if self.label == 'edge' or self.label == 'edge_up' or self.label == 'edge_down':\n return 'line'\n else:\n return 'polygon'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99709:If_L55_C8", "label": "if", "type": "if", "loc": [55, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L54_C4", "vector": [4, 2, 0.8433, 0.0597, 2, 0.92, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.label == 'edge' or self.label == 'edge_up' or self.label == 'edge_down':\n return 'line'\n else:\n return 'polygon'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99709:Return_L56_C12", "label": "return", "type": "return", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:If_L55_C8", "vector": [13, 3, 0.8358, 0.0149, 3, 0.0, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'line'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99709:Return_L58_C12", "label": "return", "type": "return", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:If_L55_C8", "vector": [13, 3, 0.8657, 0.0149, 3, 0.0, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'polygon'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L60_C4", "label": "set_type", "type": "function", "loc": [60, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:ClassDef_L29_C0", "vector": [2, 1, 0.903, 0.0299, 1, 0.68, 0.75, 316, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "set_type", "arg_names": ["self", "type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_type(self, type):\n self.type = type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99709:Assign_L61_C8", "label": "self.type =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L60_C4", "vector": [14, 2, 0.9104, 0.0149, 2, 0.12, 0.0, 398, 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_99709:FunctionDef_L63_C4", "label": "delete_last_point", "type": "function", "loc": [63, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:ClassDef_L29_C0", "vector": [2, 1, 0.9478, 0.0299, 1, 0.68, 0.875, 897, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "delete_last_point", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def delete_last_point(self): \n self.points.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99709:Expr_L64_C8", "label": "pop()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L63_C4", "vector": [8, 2, 0.9552, 0.0149, 2, 0.73, 0.0, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " self.points.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L66_C4", "label": "is_empty", "type": "function", "loc": [66, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:ClassDef_L29_C0", "vector": [2, 1, 0.9925, 0.0299, 1, 0.68, 1.0, 623, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "is_empty", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_empty(self):\n return len(self.points)==0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99709:Return_L67_C8", "label": "return", "type": "return", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L66_C4", "vector": [13, 2, 1.0, 0.0149, 2, 0.51, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return len(self.points)==0"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99709:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99709:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:Return_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99709:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99709:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99709:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:Return_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99709:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:If_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99709:If_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:Return_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99709:If_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:Return_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99709:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99709:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99709:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99709:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99709:Return_L67_C8"}]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) from labeling import label_object, scan_dataset import hrl_lib.util as ut import shutil #file operations class scans_database(object): ''' classdocs ''' def __init__(self): ''' Constructor ''' self.datasets = [] self.current_index = 0 def load(self, path, filename): self.filename = filename self.path = path #try: dict = ut.load_pickle(self.path+'/'+self.filename) #except: # print 'loading of '+self.path+'/'+filename+' failed. WARNING: it will be overwritten on save()!' # return self.datasets = dict['datasets'] def save(self): dict = {'datasets': self.datasets,'version': 0.1} #for now: make a backup first: database_filename = self.path+'/'+self.filename backup_filename = self.path+'/'+self.filename+'_backup_'+ut.formatted_time() print 'Backing up old database to ' + backup_filename shutil.copy(database_filename, backup_filename) print "Saving: "+database_filename ut.save_pickle(dict,database_filename) def get_path(self): return self.path def get_dataset(self, index): self.current_index = index return self.datasets[index] def get_dataset_by_id(self, id): #TODO: faster lookup, probably using a dictionary instead of a list? for dataset in self.datasets: if dataset.id == id: return dataset return False def set_internal_pointer_to_dataset(self, id): self.current_index = 0 for dataset in self.datasets: if dataset.id == id: return True self.current_index += 1 return False def get_next_dataset(self): if self.current_index < len(self.datasets) - 1: self.current_index = self.current_index + 1 return self.datasets[self.current_index] else: return False def get_prev_dataset(self): if self.current_index > 0: self.current_index = self.current_index - 1 return self.datasets[self.current_index] else: return False def get_first_dataset(self): if len(self.datasets) > 0: self.current_index = 0 return self.datasets[self.current_index] else: return False def get_last_dataset(self): if len(self.datasets) > 0: self.current_index = len(self.datasets) - 1 return self.datasets[self.current_index] else: return False def get_count(self): return len(self.datasets) def add_dataset(self, dataset): self.datasets.append(dataset) def delete_current_dataset(self): del self.datasets[self.current_index] dataset = self.get_prev_dataset() if False != dataset: return dataset else: dataset = self.get_next_dataset() return dataset #TODO: still fails if there is only one dataset! def add_attribute_to_every_dataset(self, name): for dataset in self.datasets: dataset.dict[name]=''
ajibawa-2023/Python-Code-Large/train/row_99710
71
145
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99710:ImportFrom_L30_C0", "label": "from labeling import label_object, scan_dataset", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.2069, 0.0069, 0, 0.66, 0.0, 948, 0, 2, 0, 0, 948, 0, 0], "semantic": {"name": "labeling", "arg_names": [], "import_names": ["label_object", "scan_dataset"], "rhs_call_name": "", "annotation": ""}, "snippet": "from labeling import label_object, scan_dataset"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Import_L31_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.2138, 0.0069, 0, 0.66, 0.3333, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Import_L33_C0", "label": "shutil import shutil", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.2276, 0.0069, 0, 0.66, 0.6667, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "shutil", "arg_names": [], "import_names": ["shutil"], "rhs_call_name": "", "annotation": ""}, "snippet": "import shutil #file operations"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "label": "scans_database", "type": "class", "loc": [35, 143], "level": 0, "parent": null, "vector": [3, 0, 0.6138, 0.7517, 0, 0.66, 1.0, 332, 0, 15, 0, 0, 186, 0, 14], "semantic": {"name": "scans_database", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class scans_database(object):\n '''\n classdocs\n '''\n\n\n def __init__(self):\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Expr_L36_C4", "label": "expression", "type": "expression", "loc": [36, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "vector": [8, 1, 0.2552, 0.0207, 1, 0.19, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n classdocs\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L41_C4", "label": "__init__", "type": "function", "loc": [41, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "vector": [2, 1, 0.3, 0.0414, 1, 0.19, 0.0667, 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 '''\n Constructor\n '''\n self.datasets = []\n self.current_index = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Expr_L42_C8", "label": "expression", "type": "expression", "loc": [42, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L41_C4", "vector": [8, 2, 0.2966, 0.0207, 2, 0.23, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n Constructor\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L45_C8", "label": "self.datasets =", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L41_C4", "vector": [14, 2, 0.3103, 0.0069, 2, 0.23, 0.5, 863, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.datasets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.datasets = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L46_C8", "label": "self.current_index =", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L41_C4", "vector": [14, 2, 0.3172, 0.0069, 2, 0.23, 1.0, 214, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.current_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_index = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L49_C4", "label": "load", "type": "function", "loc": [49, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "vector": [2, 1, 0.369, 0.069, 1, 0.19, 0.1333, 37, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": ["self", "path", "filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def load(self, path, filename):\n self.filename = filename\n self.path = path\n #try:\n dict = ut.load_pickle(self.path+'/'+self.filename)\n #except:\n # print 'loading of '+self.path+'/'+filename+' failed. WARNING: it will be overwritten on save()!'\n # return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L50_C8", "label": "self.filename =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L49_C4", "vector": [14, 2, 0.3448, 0.0069, 2, 0.71, 0.0, 942, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.filename = filename"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L51_C8", "label": "self.path =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L49_C4", "vector": [14, 2, 0.3517, 0.0069, 2, 0.71, 0.3333, 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_99710:Assign_L53_C8", "label": "dict = load_pickle()", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L49_C4", "vector": [14, 2, 0.3655, 0.0069, 2, 0.71, 0.6667, 827, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "dict", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " dict = ut.load_pickle(self.path+'/'+self.filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L58_C8", "label": "self.datasets =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L49_C4", "vector": [14, 2, 0.4, 0.0069, 2, 0.71, 1.0, 863, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.datasets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.datasets = dict['datasets']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L60_C4", "label": "save", "type": "function", "loc": [60, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "vector": [2, 1, 0.4483, 0.0759, 1, 0.19, 0.2, 928, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "save", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def save(self):\n dict = {'datasets': self.datasets,'version': 0.1} \n \n #for now: make a backup first:\n database_filename = self.path+'/'+self.filename\n backup_filename = self.path+'/'+self.filename+'_backup_'+ut.formatted_time()\n print('Backing up old database to ' + backup_filename)\n shutil.copy(database_filename, backup_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L61_C8", "label": "dict =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L60_C4", "vector": [14, 2, 0.4207, 0.0069, 2, 0.15, 0.0, 827, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dict = {'datasets': self.datasets,'version': 0.1} "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L64_C8", "label": "database_filename =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L60_C4", "vector": [14, 2, 0.4414, 0.0069, 2, 0.15, 0.1667, 684, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "database_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " database_filename = self.path+'/'+self.filename"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L65_C8", "label": "backup_filename =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L60_C4", "vector": [14, 2, 0.4483, 0.0069, 2, 0.15, 0.3333, 71, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "backup_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " backup_filename = self.path+'/'+self.filename+'_backup_'+ut.formatted_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Expr_L66_C8", "label": "print()", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L60_C4", "vector": [8, 2, 0.4552, 0.0069, 2, 0.15, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Backing up old database to ' + backup_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Expr_L67_C8", "label": "copy()", "type": "expression", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L60_C4", "vector": [8, 2, 0.4621, 0.0069, 2, 0.15, 0.6667, 739, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "copy", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " shutil.copy(database_filename, backup_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Expr_L69_C8", "label": "print()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L60_C4", "vector": [8, 2, 0.4759, 0.0069, 2, 0.15, 0.8333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Saving: \"+database_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Expr_L70_C8", "label": "save_pickle()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L60_C4", "vector": [8, 2, 0.4828, 0.0069, 2, 0.15, 1.0, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(dict,database_filename) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L73_C4", "label": "get_path", "type": "function", "loc": [73, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "vector": [2, 1, 0.5069, 0.0138, 1, 0.19, 0.2667, 601, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_path", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_path(self):\n return self.path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L74_C8", "label": "return", "type": "return", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L73_C4", "vector": [13, 2, 0.5103, 0.0069, 2, 0.25, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L76_C4", "label": "get_dataset", "type": "function", "loc": [76, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "vector": [2, 1, 0.531, 0.0207, 1, 0.19, 0.3333, 941, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "get_dataset", "arg_names": ["self", "index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_dataset(self, index):\n self.current_index = index\n return self.datasets[index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L77_C8", "label": "self.current_index =", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L76_C4", "vector": [14, 2, 0.531, 0.0069, 2, 0.14, 0.0, 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_99710:Return_L78_C8", "label": "return", "type": "return", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L76_C4", "vector": [13, 2, 0.5379, 0.0069, 2, 0.14, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.datasets[index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L80_C4", "label": "get_dataset_by_id", "type": "function", "loc": [80, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "vector": [2, 1, 0.5724, 0.0483, 1, 0.19, 0.4, 514, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "get_dataset_by_id", "arg_names": ["self", "id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_dataset_by_id(self, id):\n #TODO: faster lookup, probably using a dictionary instead of a list?\n \n for dataset in self.datasets:\n if dataset.id == id:\n return dataset\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:For_L83_C8", "label": "for dataset", "type": "for", "loc": [83, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L80_C4", "vector": [6, 2, 0.5793, 0.0207, 2, 0.42, 0.0, 603, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dataset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for dataset in self.datasets:\n if dataset.id == id:\n return dataset"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L84_C12", "label": "if", "type": "if", "loc": [84, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:For_L83_C8", "vector": [4, 3, 0.5828, 0.0138, 3, 0.9, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dataset.id == id:\n return dataset"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L85_C16", "label": "return", "type": "return", "loc": [85, 85], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L84_C12", "vector": [13, 4, 0.5862, 0.0069, 4, 0.33, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dataset"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L86_C8", "label": "return", "type": "return", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L80_C4", "vector": [13, 2, 0.5931, 0.0069, 2, 0.42, 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_99710:FunctionDef_L88_C4", "label": "set_internal_pointer_to_dataset", "type": "function", "loc": [88, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "vector": [2, 1, 0.6276, 0.0483, 1, 0.19, 0.4667, 775, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "set_internal_pointer_to_dataset", "arg_names": ["self", "id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_internal_pointer_to_dataset(self, id):\n self.current_index = 0\n for dataset in self.datasets:\n if dataset.id == id:\n return True\n self.current_index += 1\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L89_C8", "label": "self.current_index =", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L88_C4", "vector": [14, 2, 0.6138, 0.0069, 2, 0.85, 0.0, 214, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.current_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_index = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:For_L90_C8", "label": "for dataset", "type": "for", "loc": [90, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L88_C4", "vector": [6, 2, 0.631, 0.0276, 2, 0.85, 0.5, 603, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dataset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for dataset in self.datasets:\n if dataset.id == id:\n return True\n self.current_index += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L91_C12", "label": "if", "type": "if", "loc": [91, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:For_L90_C8", "vector": [4, 3, 0.631, 0.0138, 3, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dataset.id == id:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L92_C16", "label": "return", "type": "return", "loc": [92, 92], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L91_C12", "vector": [13, 4, 0.6345, 0.0069, 4, 0.32, 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_99710:Return_L94_C8", "label": "return", "type": "return", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L88_C4", "vector": [13, 2, 0.6483, 0.0069, 2, 0.85, 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_99710:FunctionDef_L96_C4", "label": "get_next_dataset", "type": "function", "loc": [96, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "vector": [2, 1, 0.6793, 0.0414, 1, 0.19, 0.5333, 672, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_next_dataset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_next_dataset(self):\n if self.current_index < len(self.datasets) - 1:\n self.current_index = self.current_index + 1\n return self.datasets[self.current_index]\n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L97_C8", "label": "if", "type": "if", "loc": [97, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L96_C4", "vector": [4, 2, 0.6828, 0.0345, 2, 0.07, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.current_index < len(self.datasets) - 1:\n self.current_index = self.current_index + 1\n return self.datasets[self.current_index]\n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L98_C12", "label": "self.current_index =", "type": "assigned_variable", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L97_C8", "vector": [14, 3, 0.6759, 0.0069, 3, 0.0, 0.0, 214, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.current_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_index = self.current_index + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L99_C12", "label": "return", "type": "return", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L97_C8", "vector": [13, 3, 0.6828, 0.0069, 3, 0.0, 0.5, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.datasets[self.current_index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L101_C12", "label": "return", "type": "return", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L97_C8", "vector": [13, 3, 0.6966, 0.0069, 3, 0.0, 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_99710:FunctionDef_L103_C4", "label": "get_prev_dataset", "type": "function", "loc": [103, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "vector": [2, 1, 0.7276, 0.0414, 1, 0.19, 0.6, 58, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_prev_dataset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_prev_dataset(self):\n if self.current_index > 0:\n self.current_index = self.current_index - 1\n return self.datasets[self.current_index]\n else:\n return False "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L104_C8", "label": "if", "type": "if", "loc": [104, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L103_C4", "vector": [4, 2, 0.731, 0.0345, 2, 0.48, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.current_index > 0:\n self.current_index = self.current_index - 1\n return self.datasets[self.current_index]\n else:\n return False "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L105_C12", "label": "self.current_index =", "type": "assigned_variable", "loc": [105, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L104_C8", "vector": [14, 3, 0.7241, 0.0069, 3, 0.17, 0.0, 214, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.current_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_index = self.current_index - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L106_C12", "label": "return", "type": "return", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L104_C8", "vector": [13, 3, 0.731, 0.0069, 3, 0.17, 0.5, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.datasets[self.current_index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L108_C12", "label": "return", "type": "return", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L104_C8", "vector": [13, 3, 0.7448, 0.0069, 3, 0.17, 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_99710:FunctionDef_L110_C4", "label": "get_first_dataset", "type": "function", "loc": [110, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "vector": [2, 1, 0.7759, 0.0414, 1, 0.19, 0.6667, 189, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_first_dataset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_first_dataset(self):\n if len(self.datasets) > 0:\n self.current_index = 0\n return self.datasets[self.current_index]\n else:\n return False "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L111_C8", "label": "if", "type": "if", "loc": [111, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L110_C4", "vector": [4, 2, 0.7793, 0.0345, 2, 0.95, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(self.datasets) > 0:\n self.current_index = 0\n return self.datasets[self.current_index]\n else:\n return False "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L112_C12", "label": "self.current_index =", "type": "assigned_variable", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L111_C8", "vector": [14, 3, 0.7724, 0.0069, 3, 0.85, 0.0, 214, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.current_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_index = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L113_C12", "label": "return", "type": "return", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L111_C8", "vector": [13, 3, 0.7793, 0.0069, 3, 0.85, 0.5, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.datasets[self.current_index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L115_C12", "label": "return", "type": "return", "loc": [115, 115], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L111_C8", "vector": [13, 3, 0.7931, 0.0069, 3, 0.85, 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_99710:FunctionDef_L117_C4", "label": "get_last_dataset", "type": "function", "loc": [117, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "vector": [2, 1, 0.8241, 0.0414, 1, 0.19, 0.7333, 863, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "get_last_dataset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_last_dataset(self):\n if len(self.datasets) > 0:\n self.current_index = len(self.datasets) - 1\n return self.datasets[self.current_index]\n else:\n return False "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L118_C8", "label": "if", "type": "if", "loc": [118, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L117_C4", "vector": [4, 2, 0.8276, 0.0345, 2, 0.67, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(self.datasets) > 0:\n self.current_index = len(self.datasets) - 1\n return self.datasets[self.current_index]\n else:\n return False "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L119_C12", "label": "self.current_index =", "type": "assigned_variable", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L118_C8", "vector": [14, 3, 0.8207, 0.0069, 3, 0.65, 0.0, 214, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.current_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_index = len(self.datasets) - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L120_C12", "label": "return", "type": "return", "loc": [120, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L118_C8", "vector": [13, 3, 0.8276, 0.0069, 3, 0.65, 0.5, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.datasets[self.current_index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L122_C12", "label": "return", "type": "return", "loc": [122, 122], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L118_C8", "vector": [13, 3, 0.8414, 0.0069, 3, 0.65, 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_99710:FunctionDef_L125_C4", "label": "get_count", "type": "function", "loc": [125, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "vector": [2, 1, 0.8655, 0.0138, 1, 0.19, 0.8, 338, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_count", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_count(self):\n return len(self.datasets)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L126_C8", "label": "return", "type": "return", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L125_C4", "vector": [13, 2, 0.869, 0.0069, 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 len(self.datasets)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L128_C4", "label": "add_dataset", "type": "function", "loc": [128, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "vector": [2, 1, 0.8862, 0.0138, 1, 0.19, 0.8667, 326, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_dataset", "arg_names": ["self", "dataset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_dataset(self, dataset):\n self.datasets.append(dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Expr_L129_C8", "label": "append()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L128_C4", "vector": [8, 2, 0.8897, 0.0069, 2, 0.03, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.datasets.append(dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L131_C4", "label": "delete_current_dataset", "type": "function", "loc": [131, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "vector": [2, 1, 0.9276, 0.0552, 1, 0.19, 0.9333, 145, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "delete_current_dataset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def delete_current_dataset(self):\n del self.datasets[self.current_index]\n dataset = self.get_prev_dataset()\n if False != dataset:\n return dataset\n else: \n dataset = self.get_next_dataset()\n return dataset #TODO: still fails if there is only one dataset!"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L133_C8", "label": "dataset = get_prev_dataset()", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L131_C4", "vector": [14, 2, 0.9172, 0.0069, 2, 0.96, 0.0, 603, 3, 0, 0, 0, 58, 10, 1], "semantic": {"name": "dataset", "arg_names": [], "import_names": [], "rhs_call_name": "get_prev_dataset", "annotation": ""}, "snippet": " dataset = self.get_prev_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L134_C8", "label": "if", "type": "if", "loc": [134, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L131_C4", "vector": [4, 2, 0.9345, 0.0276, 2, 0.96, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False != dataset:\n return dataset\n else: \n dataset = self.get_next_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L135_C12", "label": "return", "type": "return", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L134_C8", "vector": [13, 3, 0.931, 0.0069, 3, 0.36, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dataset"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L137_C12", "label": "dataset = get_next_dataset()", "type": "assigned_variable", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L134_C8", "vector": [14, 3, 0.9448, 0.0069, 3, 0.36, 1.0, 603, 3, 0, 0, 0, 672, 10, 1], "semantic": {"name": "dataset", "arg_names": [], "import_names": [], "rhs_call_name": "get_next_dataset", "annotation": ""}, "snippet": " dataset = self.get_next_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L138_C8", "label": "return", "type": "return", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L131_C4", "vector": [13, 2, 0.9517, 0.0069, 2, 0.96, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dataset #TODO: still fails if there is only one dataset!"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L141_C4", "label": "add_attribute_to_every_dataset", "type": "function", "loc": [141, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "vector": [2, 1, 0.9793, 0.0207, 1, 0.19, 1.0, 636, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "add_attribute_to_every_dataset", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_attribute_to_every_dataset(self, name):\n for dataset in self.datasets:\n dataset.dict[name]=''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:For_L142_C8", "label": "for dataset", "type": "for", "loc": [142, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L141_C4", "vector": [6, 2, 0.9828, 0.0138, 2, 0.14, 0.0, 603, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dataset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for dataset in self.datasets:\n dataset.dict[name]=''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L143_C12", "label": "assign", "type": "assigned_variable", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99710:For_L142_C8", "vector": [14, 3, 0.9862, 0.0069, 3, 0.8, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dataset.dict[name]=''"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Expr_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:For_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:For_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L84_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L85_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:For_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:For_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L91_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L92_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L97_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L97_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L97_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L104_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L104_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L104_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L115_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L117_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L118_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L118_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L120_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L118_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Expr_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:If_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Return_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:For_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99710:For_L142_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99710:Assign_L143_C12"}]
#!/usr/bin/python import roslib; roslib.load_manifest('laser_camera_segmentation') print 'TEST script!!!' # Import Psyco if available try: import psyco psyco.full() print "Psyco loaded" except ImportError: pass import laser_camera_segmentation.processor as processor import laser_camera_segmentation.configuration as configuration import time def getTime(): return '['+time.strftime("%H:%M:%S", time.localtime())+']' def generate_train_save(): #pc.load_data(id) #print getTime(), 'generate and save features...' #pc.generate_save_features(True, True) pc.load_data(id) print getTime(), 'train_and_save_Classifiers...' pc.train_and_save_Classifiers() def print_test(): print getTime(), 'testing:',pc.feature_type,'k=',pc.feature_neighborhood,'r=',pc.feature_radius print getTime(), 'start' cfg = configuration.configuration('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling') #sc = scanner.scanner(cfg) pc = processor.processor(cfg) #generate all features and train Classifiers id = '2009Oct30_162400' #pc.classifier_training_size = 1000000000 #pc.feature_neighborhood = 20 #pc.feature_radius = 0.03 #pc.feature_type = 'gaussian_histograms' #print_test() #generate_train_save() #pc.load_Classifiers() #pc.test_classifiers_on_testset() #pc.update_test_postprocessing_on_testset() labels, testresults = pc.load_classifier_and_test_on_dataset('all_post', id) print 'testresults', testresults import numpy as np print np.shape(labels) print labels import sys #sys.exit() print getTime(), 'done'
ajibawa-2023/Python-Code-Large/train/row_99711
29
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_99711:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0274, 0.0137, 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; roslib.load_manifest('laser_camera_segmentation')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Expr_L2_C15", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0274, 0.0137, 0, 0.66, 0.05, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('laser_camera_segmentation')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Expr_L4_C0", "label": "print()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0548, 0.0137, 0, 0.66, 0.1, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('TEST script!!!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Try_L7_C0", "label": "try", "type": "try", "loc": [7, 12], "level": 0, "parent": null, "vector": [7, 0, 0.1301, 0.0822, 0, 0.66, 0.15, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n import psyco\n psyco.full()\n print(\"Psyco loaded\")\nexcept ImportError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Import_L8_C4", "label": "psyco import psyco", "type": "import", "loc": [8, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99711:Try_L7_C0", "vector": [1, 1, 0.1096, 0.0137, 1, 0.84, 0.0, 17, 0, 1, 0, 0, 17, 0, 0], "semantic": {"name": "psyco", "arg_names": [], "import_names": ["psyco"], "rhs_call_name": "", "annotation": ""}, "snippet": " import psyco"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Expr_L9_C4", "label": "full()", "type": "expression", "loc": [9, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99711:Try_L7_C0", "vector": [8, 1, 0.1233, 0.0137, 1, 0.84, 0.5, 159, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "full", "arg_names": [], "import_names": [], "rhs_call_name": "full", "annotation": ""}, "snippet": " psyco.full()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Expr_L10_C4", "label": "print()", "type": "expression", "loc": [10, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99711:Try_L7_C0", "vector": [8, 1, 0.137, 0.0137, 1, 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(\"Psyco loaded\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Import_L14_C0", "label": "laser_camera_segmentation.processor import processor", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1918, 0.0137, 0, 0.66, 0.2, 235, 0, 1, 0, 0, 235, 0, 0], "semantic": {"name": "laser_camera_segmentation.processor", "arg_names": [], "import_names": ["processor"], "rhs_call_name": "", "annotation": ""}, "snippet": "import laser_camera_segmentation.processor as processor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Import_L15_C0", "label": "laser_camera_segmentation.configuration import configuration", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.2055, 0.0137, 0, 0.66, 0.25, 995, 0, 1, 0, 0, 995, 0, 0], "semantic": {"name": "laser_camera_segmentation.configuration", "arg_names": [], "import_names": ["configuration"], "rhs_call_name": "", "annotation": ""}, "snippet": "import laser_camera_segmentation.configuration as configuration "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Import_L17_C0", "label": "time import time", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.2329, 0.0137, 0, 0.66, 0.3, 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_99711:FunctionDef_L19_C0", "label": "getTime", "type": "function", "loc": [19, 20], "level": 0, "parent": null, "vector": [2, 0, 0.2671, 0.0274, 0, 0.66, 0.35, 732, 0, 0, 1, 0, 0, 0, 2], "semantic": {"name": "getTime", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def getTime():\n return '['+time.strftime(\"%H:%M:%S\", time.localtime())+']'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Return_L20_C4", "label": "return", "type": "return", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99711:FunctionDef_L19_C0", "vector": [13, 1, 0.274, 0.0137, 1, 0.12, 0.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '['+time.strftime(\"%H:%M:%S\", time.localtime())+']'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:FunctionDef_L23_C0", "label": "generate_train_save", "type": "function", "loc": [23, 29], "level": 0, "parent": null, "vector": [2, 0, 0.3562, 0.0959, 0, 0.66, 0.4, 146, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "generate_train_save", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def generate_train_save(): \n #pc.load_data(id)\n #print getTime(), 'generate and save features...' \n #pc.generate_save_features(True, True) \n pc.load_data(id)\n print(getTime(), 'train_and_save_Classifiers...')\n pc.train_and_save_Classifiers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Expr_L27_C4", "label": "load_data()", "type": "expression", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99711:FunctionDef_L23_C0", "vector": [8, 1, 0.3699, 0.0137, 1, 0.07, 0.0, 477, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_data", "arg_names": [], "import_names": [], "rhs_call_name": "load_data", "annotation": ""}, "snippet": " pc.load_data(id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Expr_L28_C4", "label": "print()", "type": "expression", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99711:FunctionDef_L23_C0", "vector": [8, 1, 0.3836, 0.0137, 1, 0.07, 0.5, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), 'train_and_save_Classifiers...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Expr_L29_C4", "label": "train_and_save_Classifiers()", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99711:FunctionDef_L23_C0", "vector": [8, 1, 0.3973, 0.0137, 1, 0.07, 1.0, 169, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "train_and_save_Classifiers", "arg_names": [], "import_names": [], "rhs_call_name": "train_and_save_Classifiers", "annotation": ""}, "snippet": " pc.train_and_save_Classifiers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:FunctionDef_L31_C0", "label": "print_test", "type": "function", "loc": [31, 32], "level": 0, "parent": null, "vector": [2, 0, 0.4315, 0.0274, 0, 0.66, 0.45, 490, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "print_test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def print_test():\n print(getTime(), 'testing:',pc.feature_type,'k=',pc.feature_neighborhood,'r=',pc.feature_radius)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Expr_L32_C4", "label": "print()", "type": "expression", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99711:FunctionDef_L31_C0", "vector": [8, 1, 0.4384, 0.0137, 1, 0.26, 0.0, 535, 3, 7, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), 'testing:',pc.feature_type,'k=',pc.feature_neighborhood,'r=',pc.feature_radius)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Expr_L36_C0", "label": "print()", "type": "expression", "loc": [36, 36], "level": 0, "parent": null, "vector": [8, 0, 0.4932, 0.0137, 0, 0.66, 0.5, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print(getTime(), 'start')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Assign_L39_C0", "label": "cfg = configuration()", "type": "assigned_variable", "loc": [39, 39], "level": 0, "parent": null, "vector": [14, 0, 0.5342, 0.0137, 0, 0.66, 0.55, 46, 3, 1, 0, 0, 627, 10, 1], "semantic": {"name": "cfg", "arg_names": [], "import_names": [], "rhs_call_name": "configuration", "annotation": ""}, "snippet": "cfg = configuration.configuration('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Assign_L41_C0", "label": "pc = processor()", "type": "assigned_variable", "loc": [41, 41], "level": 0, "parent": null, "vector": [14, 0, 0.5616, 0.0137, 0, 0.66, 0.6, 876, 3, 1, 0, 0, 177, 10, 1], "semantic": {"name": "pc", "arg_names": [], "import_names": [], "rhs_call_name": "processor", "annotation": ""}, "snippet": "pc = processor.processor(cfg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Assign_L43_C0", "label": "id =", "type": "assigned_variable", "loc": [43, 43], "level": 0, "parent": null, "vector": [14, 0, 0.589, 0.0137, 0, 0.66, 0.65, 941, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "id = '2009Oct30_162400'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Assign_L57_C0", "label": "labels, testresults = load_classifier_and_test_on_dataset()", "type": "assigned_variable", "loc": [57, 57], "level": 0, "parent": null, "vector": [14, 0, 0.7808, 0.0137, 0, 0.66, 0.7, 321, 3, 2, 0, 0, 725, 10, 1], "semantic": {"name": "labels, testresults", "arg_names": [], "import_names": [], "rhs_call_name": "load_classifier_and_test_on_dataset", "annotation": ""}, "snippet": "labels, testresults = pc.load_classifier_and_test_on_dataset('all_post', id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Expr_L58_C0", "label": "print()", "type": "expression", "loc": [58, 58], "level": 0, "parent": null, "vector": [8, 0, 0.7945, 0.0137, 0, 0.66, 0.75, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('testresults', testresults)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Import_L59_C0", "label": "numpy import np", "type": "import", "loc": [59, 59], "level": 0, "parent": null, "vector": [1, 0, 0.8082, 0.0137, 0, 0.66, 0.8, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Expr_L60_C0", "label": "print()", "type": "expression", "loc": [60, 60], "level": 0, "parent": null, "vector": [8, 0, 0.8219, 0.0137, 0, 0.66, 0.85, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print(np.shape(labels))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Expr_L61_C0", "label": "print()", "type": "expression", "loc": [61, 61], "level": 0, "parent": null, "vector": [8, 0, 0.8356, 0.0137, 0, 0.66, 0.9, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print(labels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99711:Import_L63_C0", "label": "sys import sys", "type": "import", "loc": [63, 63], "level": 0, "parent": null, "vector": [1, 0, 0.863, 0.0137, 0, 0.66, 0.95, 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_99711:Expr_L69_C0", "label": "print()", "type": "expression", "loc": [69, 69], "level": 0, "parent": null, "vector": [8, 0, 0.9452, 0.0137, 0, 0.66, 1.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print(getTime(), 'done')"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99711:Try_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99711:Import_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99711:Try_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99711:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99711:Try_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99711:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99711:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99711:Return_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99711:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99711:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99711:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99711:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99711:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99711:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99711:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99711:Expr_L32_C4"}]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) from labeling import label_object class scan_dataset(object): ''' classdocs ''' def __init__(self): ''' Constructor ''' self.dict = {} self.dict['title'] = '' self.dict['id'] = '' self.dict['polygons'] = [label_object.label_object()] self.dict['scan_filename'] = '' self.dict['image_filename'] = '' self.dict['image_artag_filename'] = '' self.dict['surface_id'] = '' self.dict['surface_height'] = '' self.dict['camera_height'] = '' self.dict['camera_angle'] = '' self.dict['surface_type'] = '' self.dict['ground_plane_normal'] = '' self.dict['ground_plane_three_points'] = '' self.dict['is_training_set'] = False self.dict['is_test_set'] = False self.dict['is_labeled'] = False def __setattr__(self, name, value): if not name == 'dict': self.dict[name] = value else: object.__setattr__(self, name, value) def __getattr__(self, name): if not name == 'dict' and name in self.dict: return self.dict[name] else: return object.__getattribute__(self, name)
ajibawa-2023/Python-Code-Large/train/row_99712
30
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_99712:ImportFrom_L29_C0", "label": "from labeling import label_object", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.3973, 0.0137, 0, 0.66, 0.0, 948, 0, 1, 0, 0, 948, 0, 0], "semantic": {"name": "labeling", "arg_names": [], "import_names": ["label_object"], "rhs_call_name": "", "annotation": ""}, "snippet": "from labeling import label_object"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:ClassDef_L31_C0", "label": "scan_dataset", "type": "class", "loc": [31, 72], "level": 0, "parent": null, "vector": [3, 0, 0.7055, 0.5753, 0, 0.66, 1.0, 727, 0, 3, 0, 0, 186, 0, 3], "semantic": {"name": "scan_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class scan_dataset(object):\n '''\n classdocs\n '''\n\n\n def __init__(self):\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Expr_L32_C4", "label": "expression", "type": "expression", "loc": [32, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:ClassDef_L31_C0", "vector": [8, 1, 0.4521, 0.0411, 1, 0.79, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n classdocs\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "label": "__init__", "type": "function", "loc": [37, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:ClassDef_L31_C0", "vector": [2, 1, 0.6644, 0.3288, 1, 0.79, 0.3333, 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 '''\n Constructor\n '''\n self.dict = {}\n self.dict['title'] = ''\n self.dict['id'] = ''\n self.dict['polygons'] = [label_object.label_object()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Expr_L38_C8", "label": "expression", "type": "expression", "loc": [38, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "vector": [8, 2, 0.5342, 0.0411, 2, 0.89, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n Constructor\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L41_C8", "label": "self.dict =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "vector": [14, 2, 0.5616, 0.0137, 2, 0.89, 0.0588, 313, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L42_C8", "label": "assign", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "vector": [14, 2, 0.5753, 0.0137, 2, 0.89, 0.1176, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dict['title'] = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L43_C8", "label": "assign", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "vector": [14, 2, 0.589, 0.0137, 2, 0.89, 0.1765, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dict['id'] = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L44_C8", "label": "assign", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "vector": [14, 2, 0.6027, 0.0137, 2, 0.89, 0.2353, 0, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dict['polygons'] = [label_object.label_object()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L45_C8", "label": "assign", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "vector": [14, 2, 0.6164, 0.0137, 2, 0.89, 0.2941, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dict['scan_filename'] = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L46_C8", "label": "assign", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "vector": [14, 2, 0.6301, 0.0137, 2, 0.89, 0.3529, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dict['image_filename'] = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L47_C8", "label": "assign", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "vector": [14, 2, 0.6438, 0.0137, 2, 0.89, 0.4118, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dict['image_artag_filename'] = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L49_C8", "label": "assign", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "vector": [14, 2, 0.6712, 0.0137, 2, 0.89, 0.4706, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dict['surface_id'] = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L50_C8", "label": "assign", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "vector": [14, 2, 0.6849, 0.0137, 2, 0.89, 0.5294, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dict['surface_height'] = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L51_C8", "label": "assign", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "vector": [14, 2, 0.6986, 0.0137, 2, 0.89, 0.5882, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dict['camera_height'] = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L52_C8", "label": "assign", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "vector": [14, 2, 0.7123, 0.0137, 2, 0.89, 0.6471, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dict['camera_angle'] = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L53_C8", "label": "assign", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "vector": [14, 2, 0.726, 0.0137, 2, 0.89, 0.7059, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dict['surface_type'] = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L55_C8", "label": "assign", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "vector": [14, 2, 0.7534, 0.0137, 2, 0.89, 0.7647, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dict['ground_plane_normal'] = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L56_C8", "label": "assign", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "vector": [14, 2, 0.7671, 0.0137, 2, 0.89, 0.8235, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dict['ground_plane_three_points'] = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L58_C8", "label": "assign", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "vector": [14, 2, 0.7945, 0.0137, 2, 0.89, 0.8824, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dict['is_training_set'] = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L59_C8", "label": "assign", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "vector": [14, 2, 0.8082, 0.0137, 2, 0.89, 0.9412, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dict['is_test_set'] = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L60_C8", "label": "assign", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "vector": [14, 2, 0.8219, 0.0137, 2, 0.89, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dict['is_labeled'] = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L62_C4", "label": "__setattr__", "type": "function", "loc": [62, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:ClassDef_L31_C0", "vector": [2, 1, 0.8767, 0.0685, 1, 0.79, 0.6667, 112, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__setattr__", "arg_names": ["self", "name", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __setattr__(self, name, value): \n if not name == 'dict':\n self.dict[name] = value\n else:\n object.__setattr__(self, name, value) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:If_L63_C8", "label": "if", "type": "if", "loc": [63, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L62_C4", "vector": [4, 2, 0.8836, 0.0548, 2, 0.23, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not name == 'dict':\n self.dict[name] = value\n else:\n object.__setattr__(self, name, value) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L64_C12", "label": "assign", "type": "assigned_variable", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:If_L63_C8", "vector": [14, 3, 0.8767, 0.0137, 3, 0.22, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dict[name] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Expr_L66_C12", "label": "__setattr__()", "type": "expression", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:If_L63_C8", "vector": [8, 3, 0.9041, 0.0137, 3, 0.22, 1.0, 112, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__setattr__", "arg_names": [], "import_names": [], "rhs_call_name": "__setattr__", "annotation": ""}, "snippet": " object.__setattr__(self, name, value) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L68_C4", "label": "__getattr__", "type": "function", "loc": [68, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:ClassDef_L31_C0", "vector": [2, 1, 0.9589, 0.0685, 1, 0.79, 1.0, 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 not name == 'dict' and name in self.dict:\n return self.dict[name]\n else:\n return object.__getattribute__(self, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:If_L69_C8", "label": "if", "type": "if", "loc": [69, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L68_C4", "vector": [4, 2, 0.9658, 0.0548, 2, 0.15, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not name == 'dict' and name in self.dict:\n return self.dict[name]\n else:\n return object.__getattribute__(self, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Return_L70_C12", "label": "return", "type": "return", "loc": [70, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:If_L69_C8", "vector": [13, 3, 0.9589, 0.0137, 3, 0.41, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.dict[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99712:Return_L72_C12", "label": "return", "type": "return", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99712:If_L69_C8", "vector": [13, 3, 0.9863, 0.0137, 3, 0.41, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return object.__getattribute__(self, name)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99712:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Expr_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:If_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:If_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Assign_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:If_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Expr_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:If_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:If_L69_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Return_L70_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99712:If_L69_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99712:Return_L72_C12"}]
#!/usr/bin/python # # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) import roslib; roslib.load_manifest('laser_camera_segmentation') from opencv.highgui import cvLoadImage import sys import opencv.cv as cv import opencv.highgui as hg from PyQt4 import QtGui, QtCore import shutil #file operations import os from dumpObj import dumpObj from labeling import label_object, scan_dataset, scans_database #take scans: import laser_camera_segmentation.scanner as scanner import laser_camera_segmentation.processor as processor import laser_camera_segmentation.configuration as configuration import hrl_lib.util as ut class labeling_tool(QtGui.QWidget): draw_widget = None display_mode = 'image' display_3d_type = 'height' def __init__(self, path, parent=None): self.init_in_progress = True self.path = path # load configs for taking scans, etc: self.config = configuration.configuration(path) #create scanner and processor when needed: self.scanner = False self.processor = False # load database: self.scans_database = scans_database.scans_database() self.scans_database.load(path,'database.pkl') #get first dataset: self.current_dataset = self.scans_database.get_dataset(0) QtGui.QWidget.__init__(self, parent) self.setWindowTitle('labeling tool') left_layout = QtGui.QVBoxLayout() self.draw_widget = draw_widget(self.current_dataset.polygons, self.scans_database.get_path() + '/' + self.current_dataset.image_filename, self) title_layout = QtGui.QHBoxLayout() take_scan_button = QtGui.QPushButton('Scan') take_scan_button.setMaximumWidth(50) title_layout.addWidget(take_scan_button) self.connect(take_scan_button, QtCore.SIGNAL('clicked()'), self.slot_take_scan ) take_artag_image_button = QtGui.QPushButton('ARTag') take_artag_image_button.setMaximumWidth(50) title_layout.addWidget(take_artag_image_button) self.connect(take_artag_image_button, QtCore.SIGNAL('clicked()'), self.slot_take_artag_image ) button = QtGui.QPushButton('Import Img') title_layout.addWidget(button) self.connect(button, QtCore.SIGNAL('clicked()'), self.slot_import_image ) label = QtGui.QLabel("View: ") title_layout.addWidget(label) self.display_3d_button = QtGui.QPushButton('3D') self.display_3d_button.setMaximumWidth(40) title_layout.addWidget(self.display_3d_button) self.connect(self.display_3d_button, QtCore.SIGNAL('clicked()'), self.slot_display_3d ) combobox = QtGui.QComboBox() combobox.addItem("Height", QtCore.QVariant("height")) combobox.addItem("Intensities", QtCore.QVariant("intensities")) #combobox.addItem("objects", QtCore.QVariant("objects")) combobox.addItem("Labels", QtCore.QVariant("labels")) combobox.addItem("Classifier range", QtCore.QVariant("range")) combobox.addItem("Classifier color", QtCore.QVariant("color")) combobox.addItem("Classifier all", QtCore.QVariant("all")) combobox.addItem("Classifier all+post", QtCore.QVariant("all_post")) combobox.addItem("Baseline algo", QtCore.QVariant("baseline")) combobox.addItem("h", QtCore.QVariant("h")) combobox.addItem("s", QtCore.QVariant("s")) combobox.addItem("v", QtCore.QVariant("v")) self.connect(combobox, QtCore.SIGNAL('currentIndexChanged(int)'), self.slot_update_display_3d_type) title_layout.addWidget(combobox) self.display_3d_type_combobox = combobox; self.display_3d_spheres_button = QtGui.QPushButton('3D_Spheres') title_layout.addWidget(self.display_3d_spheres_button) self.connect(self.display_3d_spheres_button, QtCore.SIGNAL('clicked()'), self.slot_display_3d_spheres ) self.display_intensity_button = QtGui.QPushButton('Intensity') self.display_intensity_button.setMaximumWidth(50) title_layout.addWidget(self.display_intensity_button) self.connect(self.display_intensity_button, QtCore.SIGNAL('clicked()'), self.slot_display_intensity ) self.display_features_button = QtGui.QPushButton('Features') title_layout.addWidget(self.display_features_button) self.display_features_button.setMaximumWidth(50) self.connect(self.display_features_button, QtCore.SIGNAL('clicked()'), self.slot_display_features ) self.display_labels_button = QtGui.QPushButton('Labels') title_layout.addWidget(self.display_labels_button) self.display_labels_button.setMaximumWidth(50) self.connect(self.display_labels_button, QtCore.SIGNAL('clicked()'), self.slot_display_labels ) self.display_stats_button = QtGui.QPushButton('Stats') title_layout.addWidget(self.display_stats_button) self.display_stats_button.setMaximumWidth(50) self.connect(self.display_stats_button, QtCore.SIGNAL('clicked()'), self.slot_display_stats ) self.display_global_stats_button = QtGui.QPushButton('Global Stats') title_layout.addWidget(self.display_global_stats_button) self.display_global_stats_button.setMaximumWidth(50) self.connect(self.display_global_stats_button, QtCore.SIGNAL('clicked()'), self.slot_display_global_stats ) self.line_edits = [] self.add_line_edit('Title:',title_layout,'title') first_dataset_button = QtGui.QPushButton('<<') first_dataset_button.setMaximumWidth(30) title_layout.addWidget(first_dataset_button) self.connect(first_dataset_button, QtCore.SIGNAL('clicked()'), self.slot_first_dataset ) prev_dataset_button = QtGui.QPushButton('<') prev_dataset_button.setMaximumWidth(30) title_layout.addWidget(prev_dataset_button) self.connect(prev_dataset_button, QtCore.SIGNAL('clicked()'), self.slot_prev_dataset ) next_dataset_button = QtGui.QPushButton('>') next_dataset_button.setMaximumWidth(30) title_layout.addWidget(next_dataset_button) self.connect(next_dataset_button, QtCore.SIGNAL('clicked()'), self.slot_next_dataset ) last_dataset_button = QtGui.QPushButton('>>') last_dataset_button.setMaximumWidth(30) title_layout.addWidget(last_dataset_button) self.connect(last_dataset_button, QtCore.SIGNAL('clicked()'), self.slot_last_dataset ) save_button = QtGui.QPushButton('Save') title_layout.addWidget(save_button) save_button.setMaximumWidth(50) self.connect(save_button, QtCore.SIGNAL('clicked()'), self.slot_save ) delete_button = QtGui.QPushButton('Delete') title_layout.addWidget(delete_button) delete_button.setMaximumWidth(50) self.connect(delete_button, QtCore.SIGNAL('clicked()'), self.slot_delete ) self.connect(self.draw_widget, QtCore.SIGNAL('sigPolyChanged'), self.slot_update_polygons) self.connect(self.draw_widget, QtCore.SIGNAL('sigPolyLabelChanged'), self.slot_update_polygon_label) self.connect(self.draw_widget, QtCore.SIGNAL('sigDefineGroundPlane'), self.slot_define_ground_plane) left_layout.addLayout(title_layout) #second row: row2_layout = QtGui.QHBoxLayout() left_layout.addLayout(row2_layout) label = QtGui.QLabel("Id:") row2_layout.addWidget(label) self.id_label = QtGui.QLabel("") row2_layout.addWidget(self.id_label) self.add_line_edit('Surface: ID:',row2_layout,'surface_id') self.add_line_edit('Height',row2_layout,'surface_height') label = QtGui.QLabel("Type: ") row2_layout.addWidget(label) combobox = QtGui.QComboBox() combobox.addItem("Table Office", QtCore.QVariant("table_office")) combobox.addItem("Table Dorm", QtCore.QVariant("table_dorm")) combobox.addItem("Table House", QtCore.QVariant("table_house")) combobox.addItem("Shelf Office", QtCore.QVariant("shelf_office")) combobox.addItem("Shelf Dorm", QtCore.QVariant("shelf_dorm")) combobox.addItem("Shelf House", QtCore.QVariant("shelf_house")) self.connect(combobox, QtCore.SIGNAL('currentIndexChanged(int)'), self.slot_update_surface_type) row2_layout.addWidget(combobox) self.surface_type_combobox = combobox; self.add_line_edit('Camera: Height:',row2_layout,'camera_height') self.add_line_edit('Camera: Angle:',row2_layout,'camera_angle') ##################################### #thrid row: row3_layout = QtGui.QHBoxLayout() left_layout.addLayout(row3_layout) #checkboxes: button = QtGui.QPushButton("&gen'n'save features") row3_layout.addWidget(button) self.connect(button, QtCore.SIGNAL('clicked()'), self.slot_generate_save_features ) checkbox = QtGui.QCheckBox('&Training Set') row3_layout.addWidget(checkbox) self.connect(checkbox, QtCore.SIGNAL('stateChanged(int)'), self.slot_update_training_set) self.checkbox_training_set = checkbox checkbox = QtGui.QCheckBox('Te&st Set') row3_layout.addWidget(checkbox) self.connect(checkbox, QtCore.SIGNAL('stateChanged(int)'), self.slot_update_test_set) self.checkbox_test_set = checkbox checkbox = QtGui.QCheckBox('Labels, Groundp. checked') row3_layout.addWidget(checkbox) self.connect(checkbox, QtCore.SIGNAL('stateChanged(int)'), self.slot_update_is_labeled) self.checkbox_is_labeled = checkbox button = QtGui.QPushButton("Train'n'save Classifiers (training set)") row3_layout.addWidget(button) self.connect(button, QtCore.SIGNAL('clicked()'), self.slot_train_and_save_Classifiers ) button = QtGui.QPushButton('Test Classifiers (on current)') row3_layout.addWidget(button) self.connect(button, QtCore.SIGNAL('clicked()'), self.slot_test_Classifiers ) button = QtGui.QPushButton('Test Classifiers (on testset)') row3_layout.addWidget(button) self.connect(button, QtCore.SIGNAL('clicked()'), self.slot_test_Classifiers_on_testset ) button = QtGui.QPushButton('Load Classifiers') row3_layout.addWidget(button) self.connect(button, QtCore.SIGNAL('clicked()'), self.slot_load_Classifiers ) # button = QtGui.QPushButton('Save Classifier') # row3_layout.addWidget(button) # self.connect(button, QtCore.SIGNAL('clicked()'), self.slot_save_Classifier ) ##################################### left_layout.addWidget(self.draw_widget) self.right_layout = QtGui.QVBoxLayout() self.right_layout.setAlignment(QtCore.Qt.AlignTop) self.outer_layout = QtGui.QHBoxLayout() self.outer_layout.addLayout(left_layout) self.outer_layout.addLayout(self.right_layout) self.polygon_comboboxes = [] self.add_polygon_combobox() self.slot_update_polygons(self.current_dataset.polygons,0) self.setLayout(self.outer_layout) self.resize(900, 700) self.load_values_from_dataset() self.init_in_progress = False #at startup, display newest: self.slot_last_dataset() def slot_update_training_set(self, checkState): if checkState: self.current_dataset.is_training_set = True else: self.current_dataset.is_training_set = False def slot_update_test_set(self, checkState): if checkState: self.current_dataset.is_test_set = True else: self.current_dataset.is_test_set = False def slot_update_is_labeled(self, checkState): if checkState: self.current_dataset.is_labeled = True else: self.current_dataset.is_labeled = False def closeEvent(self, x): print "Exit: saving database..." self.slot_save() def slot_import_image(self): fileName = QtGui.QFileDialog.getOpenFileName(self,"Open Image", self.path, "Image Files (*.png)") print "Import image into new dataset:" + fileName name = ut.formatted_time() new_dataset = scan_dataset.scan_dataset() new_dataset.id = name new_dataset.image_filename = 'data/'+name+'_image.png' shutil.copy(fileName,self.path+'/'+new_dataset.image_filename) self.scans_database.add_dataset(new_dataset) #proceed to new dataset: while True == self.slot_next_dataset(): pass def add_line_edit(self,label, layout, variable): label = QtGui.QLabel(label) line_edit = QtGui.QLineEdit() line_edit.setMinimumWidth(80) self.line_edits.append((line_edit,variable)) layout.addWidget(label) layout.addWidget(line_edit) self.connect(line_edit, QtCore.SIGNAL('textEdited (const QString&)'), self.slot_line_edit_changed ) return line_edit def slot_line_edit_changed(self,text): if True == self.init_in_progress: return for (line_edit, variable) in self.line_edits: self.current_dataset.dict[variable] = str(line_edit.text()) def slot_next_dataset(self): dataset = self.scans_database.get_next_dataset() if False != dataset: self.current_dataset = dataset self.load_values_from_dataset() return True return False def slot_prev_dataset(self): dataset = self.scans_database.get_prev_dataset() if False != dataset: self.current_dataset = dataset self.load_values_from_dataset() return True return False def slot_first_dataset(self): dataset = self.scans_database.get_first_dataset() if False != dataset: self.current_dataset = dataset self.load_values_from_dataset() return True return False def slot_last_dataset(self): dataset = self.scans_database.get_last_dataset() if False != dataset: self.current_dataset = dataset self.load_values_from_dataset() return True return False def load_values_from_dataset(self): self.init_in_progress = True self.id_label.setText(self.current_dataset.id) for (line_edit, variable) in self.line_edits: line_edit.setText(self.current_dataset.dict[variable]) for index, box in enumerate(self.polygon_comboboxes): if index < len(self.current_dataset.polygons): print str(index) + " load label:" + self.current_dataset.polygons[index].get_label() boxindex = box.findData(QtCore.QVariant(self.current_dataset.polygons[index].get_label())) box.setCurrentIndex(boxindex) else: #set default to first: box.setCurrentIndex(0) box = self.surface_type_combobox boxindex = box.findData(QtCore.QVariant(self.current_dataset.surface_type)) box.setCurrentIndex(boxindex) print self.current_dataset.is_training_set if self.current_dataset.is_training_set: self.checkbox_training_set.setCheckState(QtCore.Qt.Checked) else: self.checkbox_training_set.setCheckState(QtCore.Qt.Unchecked) if self.current_dataset.is_test_set: self.checkbox_test_set.setCheckState(QtCore.Qt.Checked) else: self.checkbox_test_set.setCheckState(QtCore.Qt.Unchecked) if self.current_dataset.is_labeled: self.checkbox_is_labeled.setCheckState(QtCore.Qt.Checked) else: self.checkbox_is_labeled.setCheckState(QtCore.Qt.Unchecked) #hide button if there is no 3d data: print self.current_dataset.scan_filename if '' == self.current_dataset.scan_filename: self.display_3d_button.setEnabled(False) self.display_3d_spheres_button.setEnabled(False) self.display_intensity_button.setEnabled(False) else: self.display_3d_button.setEnabled(True) self.display_3d_spheres_button.setEnabled(True) self.display_intensity_button.setEnabled(True) self.display_mode = 'image' self.draw_widget.set_polygons(self.current_dataset.polygons) self.draw_widget.set_image(self.scans_database.get_path() + '/' + self.current_dataset.image_filename) self.init_in_progress = False def slot_take_artag_image(self): if False == self.scanner: self.scanner = scanner.scanner(self.config) if False == self.processor: self.processor = processor.processor(self.config) img = self.scanner.take_artag_image() self.current_dataset.image_artag_filename = self.scanner.save_artag_image(self.current_dataset.id) self.slot_save() #save for consistency with files if self.processor.read_artag(img).any(): print "SUCCESS in reading ARTag" else: print "FAILURE in reading ARTag - try again!" def slot_take_scan(self): #save database, let scanner add dataset, reload it then self.slot_save() if False == self.scanner: self.scanner = scanner.scanner(self.config) if False == self.processor: self.processor = processor.processor(self.config) name = ut.formatted_time() self.scanner.capture_and_save(name) #self.processor.load_raw_data(name) #self.processor.load_metadata(name) #self.processor.process_raw_data() #self.processor.save_mapped_image(name) #self.processor.display_all_data() print 'scan ' + name + ' taken' self.scans_database.load(self.path,'database.pkl') #proceed to new scan: while True == self.slot_next_dataset(): pass def slot_display_intensity(self): if self.display_mode != 'intensities': if False == self.processor: self.processor = processor.processor(self.config) #reset ground plane: self.current_dataset.ground_plane_normal = '' self.current_dataset.ground_plane_three_points = '' self.slot_save() self.processor.load_data(self.current_dataset.id) self.processor.process_intensities() filename = self.processor.save_intensity_image(self.current_dataset.id) #self.processor.display_intensities() self.display_mode = 'intensities' self.draw_widget.set_image(filename) else: #display normal image self.display_mode = 'image' self.draw_widget.set_image(self.scans_database.get_path() + '/' + self.current_dataset.image_filename) def slot_display_features(self): if self.display_mode != 'features': if False == self.processor: self.processor = processor.processor(self.config) self.processor.load_data(self.current_dataset.id) self.processor.process_intensities() filename = self.processor.save_intensity_image(self.current_dataset.id) self.display_mode = 'features' self.draw_widget.set_image(filename) else: #display normal image self.display_mode = 'image' self.draw_widget.set_image(self.scans_database.get_path() + '/' + self.current_dataset.image_filename) def slot_display_labels(self): if self.display_mode != 'labels': if False == self.processor: self.processor = processor.processor(self.config) self.processor.load_data(self.current_dataset.id) self.processor.process_labels(self.display_3d_type) filename = self.processor.save_labels_image(self.display_3d_type) self.draw_widget.set_image(filename) self.display_mode = 'labels' else: #display normal image self.draw_widget.set_image(self.scans_database.get_path() + '/' + self.current_dataset.image_filename) self.display_mode = 'image' def slot_display_stats(self): if False == self.processor: self.processor = processor.processor(self.config) self.processor.load_data(self.current_dataset.id) self.processor.display_stats() def slot_display_global_stats(self): if False == self.processor: self.processor = processor.processor(self.config) self.processor.load_data(self.current_dataset.id) self.processor.display_stats(True) def slot_display_3d_spheres(self): self.slot_display_3d(True) def slot_display_3d(self, spheres = False): if False == self.processor: self.processor = processor.processor(self.config) #save data first so the processor can load it: self.slot_save() self.processor.load_data(self.current_dataset.id) #self.processor.create_polygon_images() self.processor.process_raw_data() #pc.save_mapped_image(name) self.processor.display_3d(self.display_3d_type, spheres) def slot_train_and_save_Classifiers(self): if False == self.processor: self.processor = processor.processor(self.config) #save data first so the processor can load it: self.slot_save() self.processor.load_data(self.current_dataset.id) self.processor.train_and_save_Classifiers() def slot_generate_save_features(self): if False == self.processor: self.processor = processor.processor(self.config) #save data first so the processor can load it: self.slot_save() self.processor.load_data(self.current_dataset.id) self.processor.generate_save_features() def slot_test_Classifiers(self): if False == self.processor: self.processor = processor.processor(self.config) self.slot_save() #save data first so the processor can load it: self.processor.load_data(self.current_dataset.id) self.processor.train_and_save_Classifiers() self.processor.test_Classifiers() def slot_test_Classifiers_on_testset(self): if False == self.processor: self.processor = processor.processor(self.config) self.slot_save() #save data first so the processor can load it: self.processor.load_data(self.current_dataset.id) self.processor.train_and_save_Classifiers() self.processor.test_classifiers_on_testset() def slot_load_Classifiers(self): if False == self.processor: self.processor = processor.processor(self.config) self.processor.load_Classifiers() def slot_save_Classifier(self): if False == self.processor: print 'ERROR: no processor object exists -> no Classifier to save!' return self.processor.save_Classifier() def add_polygon_combobox(self): combobox = QtGui.QComboBox() combobox.addItem("Object", QtCore.QVariant("object")) combobox.addItem("Surface", QtCore.QVariant("surface")) combobox.addItem("Region of Interest (ROI)", QtCore.QVariant("roi")) combobox.addItem("Background", QtCore.QVariant("background")) combobox.addItem("Visible Surface-Edge", QtCore.QVariant("edge")) combobox.addItem("Wall-Surface-Edge", QtCore.QVariant("edge_up")) combobox.addItem("Downward-Surface-Edge", QtCore.QVariant("edge_down")) combobox.setCurrentIndex(0) self.connect(combobox, QtCore.SIGNAL('currentIndexChanged(int)'), self.slot_update_polygon_labels) self.polygon_comboboxes.append(combobox) self.right_layout.addWidget(combobox, QtCore.Qt.AlignTop) self.slot_update_polygon_labels() def slot_delete(self): #delete scan-files: if os.path.isfile(self.current_dataset.scan_filename): os.remove(self.path + '/' + self.current_dataset.scan_filename); if os.path.isfile(self.current_dataset.image_filename): os.remove(self.path + '/' + self.current_dataset.image_filename); if os.path.isfile(self.current_dataset.image_artag_filename): os.remove(self.path + '/' + self.current_dataset.image_artag_filename); #delete metadata self.current_dataset = self.scans_database.delete_current_dataset() self.load_values_from_dataset() self.slot_save() #save for consistency with files def slot_save(self): dumpObj(self.current_dataset) #for poly in self.draw_widget.get_polygons(): # dumpObj(poly) #self.slot_update_polygons(self.draw_widget.get_polygons(), 1) self.scans_database.save() def slot_update_surface_type(self): if True == self.init_in_progress: return box = self.surface_type_combobox self.current_dataset.surface_type = str(box.itemData(box.currentIndex()).toString()) def slot_update_display_3d_type(self): if True == self.init_in_progress: return box = self.display_3d_type_combobox self.display_3d_type = str(box.itemData(box.currentIndex()).toString()) def slot_update_polygon_label(self, index, label): if True == self.init_in_progress: return box = self.polygon_comboboxes[index] boxindex = box.findData(QtCore.QVariant(label)) box.setCurrentIndex(boxindex) self.draw_widget.update() def slot_update_polygon_labels(self): if True == self.init_in_progress: return for index, box in enumerate(self.polygon_comboboxes): if index < len(self.current_dataset.polygons): self.current_dataset.polygons[index].set_label(str(box.itemData(box.currentIndex()).toString())) print str(index) + " xx " + str(box.itemData(box.currentIndex()).toString()) self.draw_widget.update() def slot_update_polygons(self, polygons, current_index): while len(self.polygon_comboboxes) < len(polygons): self.add_polygon_combobox() #self.polygon_comboboxes[self.current_polygon_index].x() for index, box in enumerate(self.polygon_comboboxes): if index < len(polygons): self.polygon_comboboxes[index].show() else: self.polygon_comboboxes[index].hide() self.update() def paintEvent(self, event): painter = QtGui.QPainter() painter.begin(self) x = self.polygon_comboboxes[self.draw_widget.get_current_polygon_index()].x() y = self.polygon_comboboxes[self.draw_widget.get_current_polygon_index()].y() color = QtGui.QColor(255,0,0) painter.setPen(color) painter.setBrush(color) painter.drawEllipse(QtCore.QRectF(x-8,y+8,6,6)) painter.end() def get_display_mode(self): return self.display_mode def slot_define_ground_plane(self, ground_plane_points): #assumes that intensity image is loaded in processor! (self.current_dataset.ground_plane_normal, self.current_dataset.ground_plane_three_points) = self.processor.get_3d_plane_normal(ground_plane_points) self.slot_display_intensity() #switch back to image mode class draw_widget(QtGui.QLabel): ground_plane_points = [] def __init__(self,polygons, image_filename, parent=None): QtGui.QWidget.__init__(self, parent) self.scaleFactor = False #init is done later self.setBackgroundRole(QtGui.QPalette.Base) #self.setSizePolicy(QtGui.QSizePolicy.Ignored, QtGui.QSizePolicy.Ignored) self.setSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) self.setScaledContents(True) self.set_polygons(polygons) self.set_image(image_filename) self.setScaleFactor(0.8) def setScaleFactor(self, f): self.scaleFactor = f self.updateImageSize() def updateImageSize(self): if self.parent().get_display_mode() == 'intensities' or self.parent().get_display_mode() == 'features': self.scaleFactor = 1 else: self.scaleFactor = 0.8 self.parent().resize(900, 700) self.setMinimumHeight(self.image.height() * self.scaleFactor) self.setMinimumWidth(self.image.width() * self.scaleFactor) self.setMaximumHeight(self.image.height() * self.scaleFactor) self.setMaximumWidth(self.image.width() * self.scaleFactor) pixmap = QtGui.QPixmap.fromImage(self.image) self.resize(self.scaleFactor * pixmap.size()); self.setPixmap(pixmap); def set_polygons(self, polygons): self.polygons = polygons self.current_polygon_index = 0 self.update() self.emit(QtCore.SIGNAL("sigPolyChanged"), self.polygons, self.current_polygon_index) def set_image(self, filename): print filename if os.path.isfile(filename): self.image = QtGui.QImage(filename) else: self.image = QtGui.QImage('noimage.png') self.updateImageSize() self.update() def paintEvent(self, event): # draw image as label-pixmap QtGui.QLabel.paintEvent(self,event) painter = QtGui.QPainter() painter.begin(self) if self.parent().get_display_mode() == 'image' or self.parent().get_display_mode() == 'labels': color = QtGui.QColor(0,0,255) color_surface = QtGui.QColor(0,255,0) color_roi = QtGui.QColor(255,255,255) color_edge = QtGui.QColor(255,255,0) color_edge_up = QtGui.QColor(255,255,255) color_edge_down = QtGui.QColor(255,150,255) color_background = QtGui.QColor(255,0,255) color_current = QtGui.QColor(255,0,0) for index, polygon in enumerate(self.polygons): last_point = (-1,-1) first = True; if self.current_polygon_index != index or self.parent().get_display_mode() != 'image': if polygon.get_label() == 'surface': painter.setPen(color_surface) elif polygon.get_label() == 'roi': painter.setPen(color_roi) elif polygon.get_label() == 'edge': painter.setPen(color_edge) elif polygon.get_label() == 'edge_up': painter.setPen(color_edge_up) elif polygon.get_label() == 'edge_down': painter.setPen(color_edge_down) elif polygon.get_label() == 'background': painter.setPen(color_background) else: painter.setPen(color) else: painter.setPen(color_current) for point in polygon.get_points(): if False == first: painter.drawLine(QtCore.QPointF(point[0],point[1]) * self.scaleFactor, QtCore.QPointF(last_point[0],last_point[1]) * self.scaleFactor) last_point = point first = False if (self.parent().get_display_mode() != 'image' or self.current_polygon_index != index ) and polygon.get_type() == 'polygon' and len(polygon.get_points()) : painter.drawLine(QtCore.QPointF(last_point[0],last_point[1]) * self.scaleFactor, QtCore.QPointF(polygon.get_points()[0][0],polygon.get_points()[0][1]) * self.scaleFactor) else: for point in polygon.get_points(): painter.drawEllipse(QtCore.QRectF(point[0] * self.scaleFactor-3,point[1] * self.scaleFactor-3,6,6)) elif self.parent().get_display_mode() == 'intensities': color = QtGui.QColor(255,0,255) painter.setPen(color) for point in self.ground_plane_points: painter.drawEllipse(QtCore.QRectF(point[0] * self.scaleFactor-3,point[1] * self.scaleFactor-3,6,6)) painter.end() def mousePressEvent(self,event): if self.hasFocus(): if self.parent().get_display_mode() == 'image': if event.button() == QtCore.Qt.LeftButton: #print 'coords:', x,' ',y point = (event.x() / self.scaleFactor, event.y() / self.scaleFactor) self.polygons[self.current_polygon_index].add_point(point) self.update() self.emit(QtCore.SIGNAL("sigPolyChanged"), self.polygons, self.current_polygon_index) if event.button() == QtCore.Qt.RightButton: if False == self.polygons[self.current_polygon_index].is_empty(): self.polygons[self.current_polygon_index].delete_last_point() self.update() self.emit(QtCore.SIGNAL("sigPolyChanged"), self.polygons, self.current_polygon_index) elif self.parent().get_display_mode() == 'intensities': point = (event.x() / self.scaleFactor, event.y() / self.scaleFactor) print 'point:', point if True == self.parent().processor.check_3d_plane_point(point): self.ground_plane_points.append(point) if len(self.ground_plane_points) < 3: self.update() else: self.emit(QtCore.SIGNAL("sigDefineGroundPlane"), self.ground_plane_points) self.ground_plane_points = [] elif self.parent().get_display_mode() == 'features': point = (event.x() / self.scaleFactor, event.y() / self.scaleFactor) if True == self.parent().processor.check_3d_plane_point(point): print 'point:', point point3d = self.parent().processor.get_3d_point(point) print 'point3d',point3d index = self.parent().processor.get_3d_point_index_in_unrotated(point3d) self.parent().processor.load_data(self.parent().current_dataset.id) self.parent().processor.process_raw_data() self.parent().processor.features.prepare([index]) self.parent().processor.feature_type = 'gaussian_histograms' fv = self.parent().processor.features.get_featurevector(index,0) print 'fv',fv self.parent().processor.display_featurevector(fv) #reload intensity data for next click self.parent().processor.load_data(self.parent().current_dataset.id) self.parent().processor.process_intensities() #print 'fv:', self.parent().processor.get_point_featurevector(index, self.parent().processor.pts3d_int) #print 'WARNING: THIS IS NOT WORKING YET BECAUSE OF MISSING INTENSITY INDEX MAPPING FOR GRAZEEFFCT REMOVED PTS' else: self.setFocus() def mouseDoubleClickEvent(self,event): if self.parent().get_display_mode() == 'image': if event.button() == QtCore.Qt.LeftButton: self.start_new_polygon() self.update() self.emit(QtCore.SIGNAL("sigPolyChanged"), self.polygons, self.current_polygon_index) def start_new_polygon(self): if False == self.polygons[self.current_polygon_index].is_empty(): # if self.current_polygon_index == len(self.polygons) - 1: self.polygons.append(label_object.label_object()) #last one, append new self.current_polygon_index = len(self.polygons) - 1 print "new poly index: ", self.current_polygon_index def delete_empty_polygon(self): if True == self.polygons[self.current_polygon_index].is_empty(): #and it isn't the only one: if 1 != len(self.polygons): del self.polygons[self.current_polygon_index] if 0 != self.current_polygon_index: self.current_polygon_index -= 1 print "new poly index: ", self.current_polygon_index return True return False def keyPressEvent(self, event): key = event.key() if key == QtCore.Qt.Key_Right: print 'right' if self.current_polygon_index < len(self.polygons) - 1: self.delete_empty_polygon() self.current_polygon_index += 1 print "czurrent poly index: ", self.current_polygon_index else: self.start_new_polygon() self.parent().slot_update_polygon_labels() self.update() self.emit(QtCore.SIGNAL("sigPolyChanged"), self.polygons, self.current_polygon_index) elif key == QtCore.Qt.Key_Left: print 'left' if self.current_polygon_index > 0: if False == self.delete_empty_polygon(): self.current_polygon_index -= 1 print "current poly index: ", self.current_polygon_index self.update() self.emit(QtCore.SIGNAL("sigPolyChanged"), self.polygons, self.current_polygon_index) elif key == QtCore.Qt.Key_O: print 'o' self.emit(QtCore.SIGNAL("sigPolyLabelChanged"), self.current_polygon_index, 'object') elif key == QtCore.Qt.Key_S: print 's' self.emit(QtCore.SIGNAL("sigPolyLabelChanged"), self.current_polygon_index, 'surface') elif key == QtCore.Qt.Key_R: print 'r' self.emit(QtCore.SIGNAL("sigPolyLabelChanged"), self.current_polygon_index, 'roi') elif key == QtCore.Qt.Key_B: print 'b' self.emit(QtCore.SIGNAL("sigPolyLabelChanged"), self.current_polygon_index, 'background') elif key == QtCore.Qt.Key_E: print 'e' self.emit(QtCore.SIGNAL("sigPolyLabelChanged"), self.current_polygon_index, 'edge') elif key == QtCore.Qt.Key_U: print 'u' self.emit(QtCore.SIGNAL("sigPolyLabelChanged"), self.current_polygon_index, 'edge_up') elif key == QtCore.Qt.Key_D: print 'd' self.emit(QtCore.SIGNAL("sigPolyLabelChanged"), self.current_polygon_index, 'edge_down') elif key == QtCore.Qt.Key_Plus: print '+' self.setScaleFactor(self.scaleFactor * 1.25) self.update() elif key == QtCore.Qt.Key_Minus: print '-' self.setScaleFactor(self.scaleFactor * 0.8) self.update() else: QtGui.QWidget.keyPressEvent(self, event) def get_polygons(self): return self.polygons def get_current_polygon_index(self): return self.current_polygon_index if __name__ == "__main__": app = QtGui.QApplication(sys.argv) labeling_tool = labeling_tool('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling');# labeling_tool.show() sys.exit(app.exec_())
ajibawa-2023/Python-Code-Large/train/row_99713
671
993
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Import_L30_C0", "label": "roslib import roslib", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.0302, 0.001, 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; roslib.load_manifest('laser_camera_segmentation')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L30_C15", "label": "load_manifest()", "type": "expression", "loc": [30, 30], "level": 0, "parent": null, "vector": [8, 0, 0.0302, 0.001, 0, 0.66, 0.0588, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('laser_camera_segmentation')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:ImportFrom_L32_C0", "label": "from opencv.highgui import cvLoadImage", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.0322, 0.001, 0, 0.66, 0.1176, 453, 0, 1, 0, 0, 453, 0, 0], "semantic": {"name": "opencv.highgui", "arg_names": [], "import_names": ["cvLoadImage"], "rhs_call_name": "", "annotation": ""}, "snippet": "from opencv.highgui import cvLoadImage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Import_L34_C0", "label": "sys import sys", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0342, 0.001, 0, 0.66, 0.1765, 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_99713:Import_L35_C0", "label": "opencv.cv import cv", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.0352, 0.001, 0, 0.66, 0.2353, 718, 0, 1, 0, 0, 718, 0, 0], "semantic": {"name": "opencv.cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import opencv.cv as cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Import_L36_C0", "label": "opencv.highgui import hg", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.0363, 0.001, 0, 0.66, 0.2941, 453, 0, 1, 0, 0, 453, 0, 0], "semantic": {"name": "opencv.highgui", "arg_names": [], "import_names": ["hg"], "rhs_call_name": "", "annotation": ""}, "snippet": "import opencv.highgui as hg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:ImportFrom_L38_C0", "label": "from PyQt4 import QtGui, QtCore", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.0383, 0.001, 0, 0.66, 0.3529, 154, 0, 2, 0, 0, 154, 0, 0], "semantic": {"name": "PyQt4", "arg_names": [], "import_names": ["QtGui", "QtCore"], "rhs_call_name": "", "annotation": ""}, "snippet": "from PyQt4 import QtGui, QtCore"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Import_L40_C0", "label": "shutil import shutil", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.0403, 0.001, 0, 0.66, 0.4118, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "shutil", "arg_names": [], "import_names": ["shutil"], "rhs_call_name": "", "annotation": ""}, "snippet": "import shutil #file operations"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Import_L41_C0", "label": "os import os", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.0413, 0.001, 0, 0.66, 0.4706, 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_99713:ImportFrom_L44_C0", "label": "from dumpObj import dumpObj", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.0443, 0.001, 0, 0.66, 0.5294, 903, 0, 1, 0, 0, 903, 0, 0], "semantic": {"name": "dumpObj", "arg_names": [], "import_names": ["dumpObj"], "rhs_call_name": "", "annotation": ""}, "snippet": "from dumpObj import dumpObj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:ImportFrom_L46_C0", "label": "from labeling import label_object, scan_dataset, scans_database", "type": "import", "loc": [46, 46], "level": 0, "parent": null, "vector": [1, 0, 0.0463, 0.001, 0, 0.66, 0.5882, 948, 0, 3, 0, 0, 948, 0, 0], "semantic": {"name": "labeling", "arg_names": [], "import_names": ["label_object", "scan_dataset", "scans_database"], "rhs_call_name": "", "annotation": ""}, "snippet": "from labeling import label_object, scan_dataset, scans_database"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Import_L50_C0", "label": "laser_camera_segmentation.scanner import scanner", "type": "import", "loc": [50, 50], "level": 0, "parent": null, "vector": [1, 0, 0.0504, 0.001, 0, 0.66, 0.6471, 414, 0, 1, 0, 0, 414, 0, 0], "semantic": {"name": "laser_camera_segmentation.scanner", "arg_names": [], "import_names": ["scanner"], "rhs_call_name": "", "annotation": ""}, "snippet": "import laser_camera_segmentation.scanner as scanner "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Import_L51_C0", "label": "laser_camera_segmentation.processor import processor", "type": "import", "loc": [51, 51], "level": 0, "parent": null, "vector": [1, 0, 0.0514, 0.001, 0, 0.66, 0.7059, 235, 0, 1, 0, 0, 235, 0, 0], "semantic": {"name": "laser_camera_segmentation.processor", "arg_names": [], "import_names": ["processor"], "rhs_call_name": "", "annotation": ""}, "snippet": "import laser_camera_segmentation.processor as processor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Import_L52_C0", "label": "laser_camera_segmentation.configuration import configuration", "type": "import", "loc": [52, 52], "level": 0, "parent": null, "vector": [1, 0, 0.0524, 0.001, 0, 0.66, 0.7647, 995, 0, 1, 0, 0, 995, 0, 0], "semantic": {"name": "laser_camera_segmentation.configuration", "arg_names": [], "import_names": ["configuration"], "rhs_call_name": "", "annotation": ""}, "snippet": "import laser_camera_segmentation.configuration as configuration"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Import_L53_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [53, 53], "level": 0, "parent": null, "vector": [1, 0, 0.0534, 0.001, 0, 0.66, 0.8235, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "label": "labeling_tool", "type": "class", "loc": [56, 729], "level": 0, "parent": null, "vector": [3, 0, 0.3953, 0.6788, 0, 0.66, 0.8824, 408, 0, 39, 0, 0, 246, 0, 99], "semantic": {"name": "labeling_tool", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class labeling_tool(QtGui.QWidget):\n \n draw_widget = None\n display_mode = 'image'\n \n display_3d_type = 'height'\n \n def __init__(self, path, parent=None):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L58_C4", "label": "draw_widget =", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [14, 1, 0.0584, 0.001, 1, 0.45, 0.0, 636, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "draw_widget", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " draw_widget = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L59_C4", "label": "display_mode =", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [14, 1, 0.0594, 0.001, 1, 0.45, 0.0244, 530, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "display_mode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " display_mode = 'image'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L61_C4", "label": "display_3d_type =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [14, 1, 0.0614, 0.001, 1, 0.45, 0.0488, 368, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "display_3d_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " display_3d_type = 'height'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "label": "__init__", "type": "function", "loc": [63, 297], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.1813, 0.2367, 1, 0.45, 0.0732, 555, 0, 3, 0, 0, 0, 0, 99], "semantic": {"name": "__init__", "arg_names": ["self", "path", "parent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, path, parent=None):\n \n self.init_in_progress = True\n \n self.path = path\n \n # load configs for taking scans, etc:\n self.config = configuration.configuration(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L65_C8", "label": "self.init_in_progress =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.0655, 0.001, 2, 0.55, 0.0, 140, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.init_in_progress", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.init_in_progress = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L67_C8", "label": "self.path =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.0675, 0.001, 2, 0.55, 0.0062, 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_99713:Assign_L70_C8", "label": "self.config = configuration()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.0705, 0.001, 2, 0.55, 0.0123, 663, 3, 1, 0, 0, 627, 10, 1], "semantic": {"name": "self.config", "arg_names": [], "import_names": [], "rhs_call_name": "configuration", "annotation": ""}, "snippet": " self.config = configuration.configuration(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L72_C8", "label": "self.scanner =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.0725, 0.001, 2, 0.55, 0.0185, 509, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.scanner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.scanner = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L73_C8", "label": "self.processor =", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.0735, 0.001, 2, 0.55, 0.0247, 855, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.processor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.processor = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L76_C8", "label": "self.scans_database = scans_database()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.0765, 0.001, 2, 0.55, 0.0309, 180, 3, 0, 0, 0, 332, 10, 1], "semantic": {"name": "self.scans_database", "arg_names": [], "import_names": [], "rhs_call_name": "scans_database", "annotation": ""}, "snippet": " self.scans_database = scans_database.scans_database()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L77_C8", "label": "load()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.0775, 0.001, 2, 0.55, 0.037, 37, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": " self.scans_database.load(path,'database.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L80_C8", "label": "self.current_dataset = get_dataset()", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.0806, 0.001, 2, 0.55, 0.0432, 782, 3, 1, 0, 0, 941, 10, 1], "semantic": {"name": "self.current_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "get_dataset", "annotation": ""}, "snippet": " self.current_dataset = self.scans_database.get_dataset(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L82_C8", "label": "__init__()", "type": "expression", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.0826, 0.001, 2, 0.55, 0.0494, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " QtGui.QWidget.__init__(self, parent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L83_C8", "label": "setWindowTitle()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.0836, 0.001, 2, 0.55, 0.0556, 38, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setWindowTitle", "arg_names": [], "import_names": [], "rhs_call_name": "setWindowTitle", "annotation": ""}, "snippet": " self.setWindowTitle('labeling tool')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L86_C8", "label": "left_layout = QVBoxLayout()", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.0866, 0.001, 2, 0.55, 0.0617, 625, 3, 0, 0, 0, 282, 10, 1], "semantic": {"name": "left_layout", "arg_names": [], "import_names": [], "rhs_call_name": "QVBoxLayout", "annotation": ""}, "snippet": " left_layout = QtGui.QVBoxLayout()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L87_C8", "label": "self.draw_widget = draw_widget()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.0876, 0.001, 2, 0.55, 0.0679, 967, 3, 3, 0, 0, 636, 10, 2], "semantic": {"name": "self.draw_widget", "arg_names": [], "import_names": [], "rhs_call_name": "draw_widget", "annotation": ""}, "snippet": " self.draw_widget = draw_widget(self.current_dataset.polygons, self.scans_database.get_path() + '/' + self.current_dataset.image_filename, self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L89_C8", "label": "title_layout = QHBoxLayout()", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.0896, 0.001, 2, 0.55, 0.0741, 874, 3, 0, 0, 0, 792, 10, 1], "semantic": {"name": "title_layout", "arg_names": [], "import_names": [], "rhs_call_name": "QHBoxLayout", "annotation": ""}, "snippet": " title_layout = QtGui.QHBoxLayout()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L91_C8", "label": "take_scan_button = QPushButton()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.0916, 0.001, 2, 0.55, 0.0802, 512, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "take_scan_button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " take_scan_button = QtGui.QPushButton('Scan')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L92_C8", "label": "setMaximumWidth()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.0926, 0.001, 2, 0.55, 0.0864, 668, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setMaximumWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setMaximumWidth", "annotation": ""}, "snippet": " take_scan_button.setMaximumWidth(50)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L93_C8", "label": "addWidget()", "type": "expression", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.0937, 0.001, 2, 0.55, 0.0926, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " title_layout.addWidget(take_scan_button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L94_C8", "label": "connect()", "type": "expression", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.0947, 0.001, 2, 0.55, 0.0988, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(take_scan_button, QtCore.SIGNAL('clicked()'), self.slot_take_scan ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L96_C8", "label": "take_artag_image_button = QPushButton()", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.0967, 0.001, 2, 0.55, 0.1049, 684, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "take_artag_image_button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " take_artag_image_button = QtGui.QPushButton('ARTag')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L97_C8", "label": "setMaximumWidth()", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.0977, 0.001, 2, 0.55, 0.1111, 668, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setMaximumWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setMaximumWidth", "annotation": ""}, "snippet": " take_artag_image_button.setMaximumWidth(50)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L98_C8", "label": "addWidget()", "type": "expression", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.0987, 0.001, 2, 0.55, 0.1173, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " title_layout.addWidget(take_artag_image_button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L99_C8", "label": "connect()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.0997, 0.001, 2, 0.55, 0.1235, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(take_artag_image_button, QtCore.SIGNAL('clicked()'), self.slot_take_artag_image ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L101_C8", "label": "button = QPushButton()", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.1017, 0.001, 2, 0.55, 0.1296, 95, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " button = QtGui.QPushButton('Import Img')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L102_C8", "label": "addWidget()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1027, 0.001, 2, 0.55, 0.1358, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " title_layout.addWidget(button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L103_C8", "label": "connect()", "type": "expression", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1037, 0.001, 2, 0.55, 0.142, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(button, QtCore.SIGNAL('clicked()'), self.slot_import_image ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L105_C8", "label": "label = QLabel()", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.1057, 0.001, 2, 0.55, 0.1481, 811, 3, 1, 0, 0, 495, 10, 1], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "QLabel", "annotation": ""}, "snippet": " label = QtGui.QLabel(\"View: \")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L106_C8", "label": "addWidget()", "type": "expression", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1067, 0.001, 2, 0.55, 0.1543, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " title_layout.addWidget(label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L107_C8", "label": "self.display_3d_button = QPushButton()", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.1078, 0.001, 2, 0.55, 0.1605, 811, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.display_3d_button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.display_3d_button = QtGui.QPushButton('3D')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L108_C8", "label": "setMaximumWidth()", "type": "expression", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1088, 0.001, 2, 0.55, 0.1667, 668, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setMaximumWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setMaximumWidth", "annotation": ""}, "snippet": " self.display_3d_button.setMaximumWidth(40)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L109_C8", "label": "addWidget()", "type": "expression", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1098, 0.001, 2, 0.55, 0.1728, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " title_layout.addWidget(self.display_3d_button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L110_C8", "label": "connect()", "type": "expression", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1108, 0.001, 2, 0.55, 0.179, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(self.display_3d_button, QtCore.SIGNAL('clicked()'), self.slot_display_3d )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L112_C8", "label": "combobox = QComboBox()", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.1128, 0.001, 2, 0.55, 0.1852, 460, 3, 0, 0, 0, 556, 10, 1], "semantic": {"name": "combobox", "arg_names": [], "import_names": [], "rhs_call_name": "QComboBox", "annotation": ""}, "snippet": " combobox = QtGui.QComboBox()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L113_C8", "label": "addItem()", "type": "expression", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1138, 0.001, 2, 0.55, 0.1914, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"Height\", QtCore.QVariant(\"height\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L114_C8", "label": "addItem()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1148, 0.001, 2, 0.55, 0.1975, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"Intensities\", QtCore.QVariant(\"intensities\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L116_C8", "label": "addItem()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1168, 0.001, 2, 0.55, 0.2037, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"Labels\", QtCore.QVariant(\"labels\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L117_C8", "label": "addItem()", "type": "expression", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1178, 0.001, 2, 0.55, 0.2099, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"Classifier range\", QtCore.QVariant(\"range\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L118_C8", "label": "addItem()", "type": "expression", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1188, 0.001, 2, 0.55, 0.216, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"Classifier color\", QtCore.QVariant(\"color\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L119_C8", "label": "addItem()", "type": "expression", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1198, 0.001, 2, 0.55, 0.2222, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"Classifier all\", QtCore.QVariant(\"all\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L120_C8", "label": "addItem()", "type": "expression", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1208, 0.001, 2, 0.55, 0.2284, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"Classifier all+post\", QtCore.QVariant(\"all_post\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L121_C8", "label": "addItem()", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1219, 0.001, 2, 0.55, 0.2346, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"Baseline algo\", QtCore.QVariant(\"baseline\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L122_C8", "label": "addItem()", "type": "expression", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1229, 0.001, 2, 0.55, 0.2407, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"h\", QtCore.QVariant(\"h\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L123_C8", "label": "addItem()", "type": "expression", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1239, 0.001, 2, 0.55, 0.2469, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"s\", QtCore.QVariant(\"s\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L124_C8", "label": "addItem()", "type": "expression", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1249, 0.001, 2, 0.55, 0.2531, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"v\", QtCore.QVariant(\"v\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L125_C8", "label": "connect()", "type": "expression", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1259, 0.001, 2, 0.55, 0.2593, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(combobox, QtCore.SIGNAL('currentIndexChanged(int)'), self.slot_update_display_3d_type) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L126_C8", "label": "addWidget()", "type": "expression", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1269, 0.001, 2, 0.55, 0.2654, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " title_layout.addWidget(combobox)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L127_C8", "label": "self.display_3d_type_combobox =", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.1279, 0.001, 2, 0.55, 0.2716, 882, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.display_3d_type_combobox", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.display_3d_type_combobox = combobox; "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L130_C8", "label": "self.display_3d_spheres_button = QPushButton()", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.1309, 0.001, 2, 0.55, 0.2778, 6, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.display_3d_spheres_button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.display_3d_spheres_button = QtGui.QPushButton('3D_Spheres')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L131_C8", "label": "addWidget()", "type": "expression", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1319, 0.001, 2, 0.55, 0.284, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " title_layout.addWidget(self.display_3d_spheres_button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L132_C8", "label": "connect()", "type": "expression", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1329, 0.001, 2, 0.55, 0.2901, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(self.display_3d_spheres_button, QtCore.SIGNAL('clicked()'), self.slot_display_3d_spheres ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L133_C8", "label": "self.display_intensity_button = QPushButton()", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.1339, 0.001, 2, 0.55, 0.2963, 740, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.display_intensity_button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.display_intensity_button = QtGui.QPushButton('Intensity')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L134_C8", "label": "setMaximumWidth()", "type": "expression", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1349, 0.001, 2, 0.55, 0.3025, 668, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setMaximumWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setMaximumWidth", "annotation": ""}, "snippet": " self.display_intensity_button.setMaximumWidth(50)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L135_C8", "label": "addWidget()", "type": "expression", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.136, 0.001, 2, 0.55, 0.3086, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " title_layout.addWidget(self.display_intensity_button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L136_C8", "label": "connect()", "type": "expression", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.137, 0.001, 2, 0.55, 0.3148, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(self.display_intensity_button, QtCore.SIGNAL('clicked()'), self.slot_display_intensity ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L137_C8", "label": "self.display_features_button = QPushButton()", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.138, 0.001, 2, 0.55, 0.321, 750, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.display_features_button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.display_features_button = QtGui.QPushButton('Features')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L138_C8", "label": "addWidget()", "type": "expression", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.139, 0.001, 2, 0.55, 0.3272, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " title_layout.addWidget(self.display_features_button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L139_C8", "label": "setMaximumWidth()", "type": "expression", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.14, 0.001, 2, 0.55, 0.3333, 668, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setMaximumWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setMaximumWidth", "annotation": ""}, "snippet": " self.display_features_button.setMaximumWidth(50)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L140_C8", "label": "connect()", "type": "expression", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.141, 0.001, 2, 0.55, 0.3395, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(self.display_features_button, QtCore.SIGNAL('clicked()'), self.slot_display_features ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L141_C8", "label": "self.display_labels_button = QPushButton()", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.142, 0.001, 2, 0.55, 0.3457, 713, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.display_labels_button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.display_labels_button = QtGui.QPushButton('Labels')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L142_C8", "label": "addWidget()", "type": "expression", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.143, 0.001, 2, 0.55, 0.3519, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " title_layout.addWidget(self.display_labels_button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L143_C8", "label": "setMaximumWidth()", "type": "expression", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.144, 0.001, 2, 0.55, 0.358, 668, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setMaximumWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setMaximumWidth", "annotation": ""}, "snippet": " self.display_labels_button.setMaximumWidth(50)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L144_C8", "label": "connect()", "type": "expression", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.145, 0.001, 2, 0.55, 0.3642, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(self.display_labels_button, QtCore.SIGNAL('clicked()'), self.slot_display_labels ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L145_C8", "label": "self.display_stats_button = QPushButton()", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.146, 0.001, 2, 0.55, 0.3704, 608, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.display_stats_button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.display_stats_button = QtGui.QPushButton('Stats')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L146_C8", "label": "addWidget()", "type": "expression", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.147, 0.001, 2, 0.55, 0.3765, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " title_layout.addWidget(self.display_stats_button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L147_C8", "label": "setMaximumWidth()", "type": "expression", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.148, 0.001, 2, 0.55, 0.3827, 668, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setMaximumWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setMaximumWidth", "annotation": ""}, "snippet": " self.display_stats_button.setMaximumWidth(50)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L148_C8", "label": "connect()", "type": "expression", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.149, 0.001, 2, 0.55, 0.3889, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(self.display_stats_button, QtCore.SIGNAL('clicked()'), self.slot_display_stats ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L149_C8", "label": "self.display_global_stats_button = QPushButton()", "type": "assigned_variable", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.1501, 0.001, 2, 0.55, 0.3951, 510, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.display_global_stats_button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.display_global_stats_button = QtGui.QPushButton('Global Stats')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L150_C8", "label": "addWidget()", "type": "expression", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1511, 0.001, 2, 0.55, 0.4012, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " title_layout.addWidget(self.display_global_stats_button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L151_C8", "label": "setMaximumWidth()", "type": "expression", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1521, 0.001, 2, 0.55, 0.4074, 668, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setMaximumWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setMaximumWidth", "annotation": ""}, "snippet": " self.display_global_stats_button.setMaximumWidth(50)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L152_C8", "label": "connect()", "type": "expression", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1531, 0.001, 2, 0.55, 0.4136, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(self.display_global_stats_button, QtCore.SIGNAL('clicked()'), self.slot_display_global_stats ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L154_C8", "label": "self.line_edits =", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.1551, 0.001, 2, 0.55, 0.4198, 438, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.line_edits", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.line_edits = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L156_C8", "label": "add_line_edit()", "type": "expression", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1571, 0.001, 2, 0.55, 0.4259, 56, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "add_line_edit", "arg_names": [], "import_names": [], "rhs_call_name": "add_line_edit", "annotation": ""}, "snippet": " self.add_line_edit('Title:',title_layout,'title')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L159_C8", "label": "first_dataset_button = QPushButton()", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.1601, 0.001, 2, 0.55, 0.4321, 970, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "first_dataset_button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " first_dataset_button = QtGui.QPushButton('<<')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L160_C8", "label": "setMaximumWidth()", "type": "expression", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1611, 0.001, 2, 0.55, 0.4383, 668, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setMaximumWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setMaximumWidth", "annotation": ""}, "snippet": " first_dataset_button.setMaximumWidth(30)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L161_C8", "label": "addWidget()", "type": "expression", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1621, 0.001, 2, 0.55, 0.4444, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " title_layout.addWidget(first_dataset_button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L162_C8", "label": "connect()", "type": "expression", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1631, 0.001, 2, 0.55, 0.4506, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(first_dataset_button, QtCore.SIGNAL('clicked()'), self.slot_first_dataset )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L163_C8", "label": "prev_dataset_button = QPushButton()", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.1641, 0.001, 2, 0.55, 0.4568, 870, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "prev_dataset_button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " prev_dataset_button = QtGui.QPushButton('<')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L164_C8", "label": "setMaximumWidth()", "type": "expression", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1652, 0.001, 2, 0.55, 0.463, 668, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setMaximumWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setMaximumWidth", "annotation": ""}, "snippet": " prev_dataset_button.setMaximumWidth(30)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L165_C8", "label": "addWidget()", "type": "expression", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1662, 0.001, 2, 0.55, 0.4691, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " title_layout.addWidget(prev_dataset_button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L166_C8", "label": "connect()", "type": "expression", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1672, 0.001, 2, 0.55, 0.4753, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(prev_dataset_button, QtCore.SIGNAL('clicked()'), self.slot_prev_dataset )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L167_C8", "label": "next_dataset_button = QPushButton()", "type": "assigned_variable", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.1682, 0.001, 2, 0.55, 0.4815, 171, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "next_dataset_button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " next_dataset_button = QtGui.QPushButton('>')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L168_C8", "label": "setMaximumWidth()", "type": "expression", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1692, 0.001, 2, 0.55, 0.4877, 668, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setMaximumWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setMaximumWidth", "annotation": ""}, "snippet": " next_dataset_button.setMaximumWidth(30)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L169_C8", "label": "addWidget()", "type": "expression", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1702, 0.001, 2, 0.55, 0.4938, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " title_layout.addWidget(next_dataset_button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L170_C8", "label": "connect()", "type": "expression", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1712, 0.001, 2, 0.55, 0.5, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(next_dataset_button, QtCore.SIGNAL('clicked()'), self.slot_next_dataset )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L171_C8", "label": "last_dataset_button = QPushButton()", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.1722, 0.001, 2, 0.55, 0.5062, 656, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "last_dataset_button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " last_dataset_button = QtGui.QPushButton('>>')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L172_C8", "label": "setMaximumWidth()", "type": "expression", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1732, 0.001, 2, 0.55, 0.5123, 668, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setMaximumWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setMaximumWidth", "annotation": ""}, "snippet": " last_dataset_button.setMaximumWidth(30)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L173_C8", "label": "addWidget()", "type": "expression", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1742, 0.001, 2, 0.55, 0.5185, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " title_layout.addWidget(last_dataset_button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L174_C8", "label": "connect()", "type": "expression", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1752, 0.001, 2, 0.55, 0.5247, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(last_dataset_button, QtCore.SIGNAL('clicked()'), self.slot_last_dataset ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L176_C8", "label": "save_button = QPushButton()", "type": "assigned_variable", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.1772, 0.001, 2, 0.55, 0.5309, 317, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "save_button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " save_button = QtGui.QPushButton('Save')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L177_C8", "label": "addWidget()", "type": "expression", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1782, 0.001, 2, 0.55, 0.537, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " title_layout.addWidget(save_button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L178_C8", "label": "setMaximumWidth()", "type": "expression", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1793, 0.001, 2, 0.55, 0.5432, 668, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setMaximumWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setMaximumWidth", "annotation": ""}, "snippet": " save_button.setMaximumWidth(50)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L179_C8", "label": "connect()", "type": "expression", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1803, 0.001, 2, 0.55, 0.5494, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(save_button, QtCore.SIGNAL('clicked()'), self.slot_save )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L181_C8", "label": "delete_button = QPushButton()", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.1823, 0.001, 2, 0.55, 0.5556, 267, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "delete_button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " delete_button = QtGui.QPushButton('Delete')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L182_C8", "label": "addWidget()", "type": "expression", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1833, 0.001, 2, 0.55, 0.5617, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " title_layout.addWidget(delete_button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L183_C8", "label": "setMaximumWidth()", "type": "expression", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1843, 0.001, 2, 0.55, 0.5679, 668, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setMaximumWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setMaximumWidth", "annotation": ""}, "snippet": " delete_button.setMaximumWidth(50)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L184_C8", "label": "connect()", "type": "expression", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1853, 0.001, 2, 0.55, 0.5741, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(delete_button, QtCore.SIGNAL('clicked()'), self.slot_delete ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L187_C8", "label": "connect()", "type": "expression", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1883, 0.001, 2, 0.55, 0.5802, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(self.draw_widget, QtCore.SIGNAL('sigPolyChanged'), self.slot_update_polygons)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L188_C8", "label": "connect()", "type": "expression", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1893, 0.001, 2, 0.55, 0.5864, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(self.draw_widget, QtCore.SIGNAL('sigPolyLabelChanged'), self.slot_update_polygon_label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L189_C8", "label": "connect()", "type": "expression", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1903, 0.001, 2, 0.55, 0.5926, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(self.draw_widget, QtCore.SIGNAL('sigDefineGroundPlane'), self.slot_define_ground_plane)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L191_C8", "label": "addLayout()", "type": "expression", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1923, 0.001, 2, 0.55, 0.5988, 293, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addLayout", "arg_names": [], "import_names": [], "rhs_call_name": "addLayout", "annotation": ""}, "snippet": " left_layout.addLayout(title_layout)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L194_C8", "label": "row2_layout = QHBoxLayout()", "type": "assigned_variable", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.1954, 0.001, 2, 0.55, 0.6049, 928, 3, 0, 0, 0, 792, 10, 1], "semantic": {"name": "row2_layout", "arg_names": [], "import_names": [], "rhs_call_name": "QHBoxLayout", "annotation": ""}, "snippet": " row2_layout = QtGui.QHBoxLayout()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L195_C8", "label": "addLayout()", "type": "expression", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.1964, 0.001, 2, 0.55, 0.6111, 293, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addLayout", "arg_names": [], "import_names": [], "rhs_call_name": "addLayout", "annotation": ""}, "snippet": " left_layout.addLayout(row2_layout)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L198_C8", "label": "label = QLabel()", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.1994, 0.001, 2, 0.55, 0.6173, 811, 3, 1, 0, 0, 495, 10, 1], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "QLabel", "annotation": ""}, "snippet": " label = QtGui.QLabel(\"Id:\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L199_C8", "label": "addWidget()", "type": "expression", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2004, 0.001, 2, 0.55, 0.6235, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " row2_layout.addWidget(label) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L200_C8", "label": "self.id_label = QLabel()", "type": "assigned_variable", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.2014, 0.001, 2, 0.55, 0.6296, 590, 3, 1, 0, 0, 495, 10, 1], "semantic": {"name": "self.id_label", "arg_names": [], "import_names": [], "rhs_call_name": "QLabel", "annotation": ""}, "snippet": " self.id_label = QtGui.QLabel(\"\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L201_C8", "label": "addWidget()", "type": "expression", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2024, 0.001, 2, 0.55, 0.6358, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " row2_layout.addWidget(self.id_label) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L203_C8", "label": "add_line_edit()", "type": "expression", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2044, 0.001, 2, 0.55, 0.642, 56, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "add_line_edit", "arg_names": [], "import_names": [], "rhs_call_name": "add_line_edit", "annotation": ""}, "snippet": " self.add_line_edit('Surface: ID:',row2_layout,'surface_id')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L204_C8", "label": "add_line_edit()", "type": "expression", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2054, 0.001, 2, 0.55, 0.6481, 56, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "add_line_edit", "arg_names": [], "import_names": [], "rhs_call_name": "add_line_edit", "annotation": ""}, "snippet": " self.add_line_edit('Height',row2_layout,'surface_height')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L207_C8", "label": "label = QLabel()", "type": "assigned_variable", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.2085, 0.001, 2, 0.55, 0.6543, 811, 3, 1, 0, 0, 495, 10, 1], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "QLabel", "annotation": ""}, "snippet": " label = QtGui.QLabel(\"Type: \")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L208_C8", "label": "addWidget()", "type": "expression", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2095, 0.001, 2, 0.55, 0.6605, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " row2_layout.addWidget(label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L209_C8", "label": "combobox = QComboBox()", "type": "assigned_variable", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.2105, 0.001, 2, 0.55, 0.6667, 460, 3, 0, 0, 0, 556, 10, 1], "semantic": {"name": "combobox", "arg_names": [], "import_names": [], "rhs_call_name": "QComboBox", "annotation": ""}, "snippet": " combobox = QtGui.QComboBox()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L210_C8", "label": "addItem()", "type": "expression", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2115, 0.001, 2, 0.55, 0.6728, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"Table Office\", QtCore.QVariant(\"table_office\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L211_C8", "label": "addItem()", "type": "expression", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2125, 0.001, 2, 0.55, 0.679, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"Table Dorm\", QtCore.QVariant(\"table_dorm\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L212_C8", "label": "addItem()", "type": "expression", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2135, 0.001, 2, 0.55, 0.6852, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"Table House\", QtCore.QVariant(\"table_house\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L213_C8", "label": "addItem()", "type": "expression", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2145, 0.001, 2, 0.55, 0.6914, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"Shelf Office\", QtCore.QVariant(\"shelf_office\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L214_C8", "label": "addItem()", "type": "expression", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2155, 0.001, 2, 0.55, 0.6975, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"Shelf Dorm\", QtCore.QVariant(\"shelf_dorm\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L215_C8", "label": "addItem()", "type": "expression", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2165, 0.001, 2, 0.55, 0.7037, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"Shelf House\", QtCore.QVariant(\"shelf_house\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L216_C8", "label": "connect()", "type": "expression", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2175, 0.001, 2, 0.55, 0.7099, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(combobox, QtCore.SIGNAL('currentIndexChanged(int)'), self.slot_update_surface_type) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L217_C8", "label": "addWidget()", "type": "expression", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2185, 0.001, 2, 0.55, 0.716, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " row2_layout.addWidget(combobox)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L218_C8", "label": "self.surface_type_combobox =", "type": "assigned_variable", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.2195, 0.001, 2, 0.55, 0.7222, 962, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.surface_type_combobox", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.surface_type_combobox = combobox;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L220_C8", "label": "add_line_edit()", "type": "expression", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2216, 0.001, 2, 0.55, 0.7284, 56, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "add_line_edit", "arg_names": [], "import_names": [], "rhs_call_name": "add_line_edit", "annotation": ""}, "snippet": " self.add_line_edit('Camera: Height:',row2_layout,'camera_height')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L221_C8", "label": "add_line_edit()", "type": "expression", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2226, 0.001, 2, 0.55, 0.7346, 56, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "add_line_edit", "arg_names": [], "import_names": [], "rhs_call_name": "add_line_edit", "annotation": ""}, "snippet": " self.add_line_edit('Camera: Angle:',row2_layout,'camera_angle')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L225_C8", "label": "row3_layout = QHBoxLayout()", "type": "assigned_variable", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.2266, 0.001, 2, 0.55, 0.7407, 667, 3, 0, 0, 0, 792, 10, 1], "semantic": {"name": "row3_layout", "arg_names": [], "import_names": [], "rhs_call_name": "QHBoxLayout", "annotation": ""}, "snippet": " row3_layout = QtGui.QHBoxLayout()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L226_C8", "label": "addLayout()", "type": "expression", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2276, 0.001, 2, 0.55, 0.7469, 293, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addLayout", "arg_names": [], "import_names": [], "rhs_call_name": "addLayout", "annotation": ""}, "snippet": " left_layout.addLayout(row3_layout)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L229_C8", "label": "button = QPushButton()", "type": "assigned_variable", "loc": [229, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.2306, 0.001, 2, 0.55, 0.7531, 95, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " button = QtGui.QPushButton(\"&gen'n'save features\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L230_C8", "label": "addWidget()", "type": "expression", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2316, 0.001, 2, 0.55, 0.7593, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " row3_layout.addWidget(button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L231_C8", "label": "connect()", "type": "expression", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2326, 0.001, 2, 0.55, 0.7654, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(button, QtCore.SIGNAL('clicked()'), self.slot_generate_save_features ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L233_C8", "label": "checkbox = QCheckBox()", "type": "assigned_variable", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.2346, 0.001, 2, 0.55, 0.7716, 706, 3, 1, 0, 0, 246, 10, 1], "semantic": {"name": "checkbox", "arg_names": [], "import_names": [], "rhs_call_name": "QCheckBox", "annotation": ""}, "snippet": " checkbox = QtGui.QCheckBox('&Training Set')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L234_C8", "label": "addWidget()", "type": "expression", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2356, 0.001, 2, 0.55, 0.7778, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " row3_layout.addWidget(checkbox)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L235_C8", "label": "connect()", "type": "expression", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2367, 0.001, 2, 0.55, 0.784, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(checkbox, QtCore.SIGNAL('stateChanged(int)'), self.slot_update_training_set) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L236_C8", "label": "self.checkbox_training_set =", "type": "assigned_variable", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.2377, 0.001, 2, 0.55, 0.7901, 898, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.checkbox_training_set", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.checkbox_training_set = checkbox"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L238_C8", "label": "checkbox = QCheckBox()", "type": "assigned_variable", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.2397, 0.001, 2, 0.55, 0.7963, 706, 3, 1, 0, 0, 246, 10, 1], "semantic": {"name": "checkbox", "arg_names": [], "import_names": [], "rhs_call_name": "QCheckBox", "annotation": ""}, "snippet": " checkbox = QtGui.QCheckBox('Te&st Set')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L239_C8", "label": "addWidget()", "type": "expression", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2407, 0.001, 2, 0.55, 0.8025, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " row3_layout.addWidget(checkbox)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L240_C8", "label": "connect()", "type": "expression", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2417, 0.001, 2, 0.55, 0.8086, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(checkbox, QtCore.SIGNAL('stateChanged(int)'), self.slot_update_test_set)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L241_C8", "label": "self.checkbox_test_set =", "type": "assigned_variable", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.2427, 0.001, 2, 0.55, 0.8148, 372, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.checkbox_test_set", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.checkbox_test_set = checkbox "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L243_C8", "label": "checkbox = QCheckBox()", "type": "assigned_variable", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.2447, 0.001, 2, 0.55, 0.821, 706, 3, 1, 0, 0, 246, 10, 1], "semantic": {"name": "checkbox", "arg_names": [], "import_names": [], "rhs_call_name": "QCheckBox", "annotation": ""}, "snippet": " checkbox = QtGui.QCheckBox('Labels, Groundp. checked')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L244_C8", "label": "addWidget()", "type": "expression", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2457, 0.001, 2, 0.55, 0.8272, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " row3_layout.addWidget(checkbox)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L245_C8", "label": "connect()", "type": "expression", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2467, 0.001, 2, 0.55, 0.8333, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(checkbox, QtCore.SIGNAL('stateChanged(int)'), self.slot_update_is_labeled)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L246_C8", "label": "self.checkbox_is_labeled =", "type": "assigned_variable", "loc": [246, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.2477, 0.001, 2, 0.55, 0.8395, 442, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.checkbox_is_labeled", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.checkbox_is_labeled = checkbox "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L248_C8", "label": "button = QPushButton()", "type": "assigned_variable", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.2497, 0.001, 2, 0.55, 0.8457, 95, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " button = QtGui.QPushButton(\"Train'n'save Classifiers (training set)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L249_C8", "label": "addWidget()", "type": "expression", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2508, 0.001, 2, 0.55, 0.8519, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " row3_layout.addWidget(button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L250_C8", "label": "connect()", "type": "expression", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2518, 0.001, 2, 0.55, 0.858, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(button, QtCore.SIGNAL('clicked()'), self.slot_train_and_save_Classifiers )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L252_C8", "label": "button = QPushButton()", "type": "assigned_variable", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.2538, 0.001, 2, 0.55, 0.8642, 95, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " button = QtGui.QPushButton('Test Classifiers (on current)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L253_C8", "label": "addWidget()", "type": "expression", "loc": [253, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2548, 0.001, 2, 0.55, 0.8704, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " row3_layout.addWidget(button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L254_C8", "label": "connect()", "type": "expression", "loc": [254, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2558, 0.001, 2, 0.55, 0.8765, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(button, QtCore.SIGNAL('clicked()'), self.slot_test_Classifiers )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L256_C8", "label": "button = QPushButton()", "type": "assigned_variable", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.2578, 0.001, 2, 0.55, 0.8827, 95, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " button = QtGui.QPushButton('Test Classifiers (on testset)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L257_C8", "label": "addWidget()", "type": "expression", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2588, 0.001, 2, 0.55, 0.8889, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " row3_layout.addWidget(button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L258_C8", "label": "connect()", "type": "expression", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2598, 0.001, 2, 0.55, 0.8951, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(button, QtCore.SIGNAL('clicked()'), self.slot_test_Classifiers_on_testset ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L260_C8", "label": "button = QPushButton()", "type": "assigned_variable", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.2618, 0.001, 2, 0.55, 0.9012, 95, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " button = QtGui.QPushButton('Load Classifiers')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L261_C8", "label": "addWidget()", "type": "expression", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2628, 0.001, 2, 0.55, 0.9074, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " row3_layout.addWidget(button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L262_C8", "label": "connect()", "type": "expression", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2638, 0.001, 2, 0.55, 0.9136, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(button, QtCore.SIGNAL('clicked()'), self.slot_load_Classifiers )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L270_C8", "label": "addWidget()", "type": "expression", "loc": [270, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2719, 0.001, 2, 0.55, 0.9198, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " left_layout.addWidget(self.draw_widget)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L273_C8", "label": "self.right_layout = QVBoxLayout()", "type": "assigned_variable", "loc": [273, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.2749, 0.001, 2, 0.55, 0.9259, 683, 3, 0, 0, 0, 282, 10, 1], "semantic": {"name": "self.right_layout", "arg_names": [], "import_names": [], "rhs_call_name": "QVBoxLayout", "annotation": ""}, "snippet": " self.right_layout = QtGui.QVBoxLayout()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L274_C8", "label": "setAlignment()", "type": "expression", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2759, 0.001, 2, 0.55, 0.9321, 346, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setAlignment", "arg_names": [], "import_names": [], "rhs_call_name": "setAlignment", "annotation": ""}, "snippet": " self.right_layout.setAlignment(QtCore.Qt.AlignTop)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L276_C8", "label": "self.outer_layout = QHBoxLayout()", "type": "assigned_variable", "loc": [276, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.2779, 0.001, 2, 0.55, 0.9383, 969, 3, 0, 0, 0, 792, 10, 1], "semantic": {"name": "self.outer_layout", "arg_names": [], "import_names": [], "rhs_call_name": "QHBoxLayout", "annotation": ""}, "snippet": " self.outer_layout = QtGui.QHBoxLayout()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L277_C8", "label": "addLayout()", "type": "expression", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.279, 0.001, 2, 0.55, 0.9444, 293, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addLayout", "arg_names": [], "import_names": [], "rhs_call_name": "addLayout", "annotation": ""}, "snippet": " self.outer_layout.addLayout(left_layout)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L278_C8", "label": "addLayout()", "type": "expression", "loc": [278, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.28, 0.001, 2, 0.55, 0.9506, 293, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addLayout", "arg_names": [], "import_names": [], "rhs_call_name": "addLayout", "annotation": ""}, "snippet": " self.outer_layout.addLayout(self.right_layout)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L282_C8", "label": "self.polygon_comboboxes =", "type": "assigned_variable", "loc": [282, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.284, 0.001, 2, 0.55, 0.9568, 864, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.polygon_comboboxes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.polygon_comboboxes = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L283_C8", "label": "add_polygon_combobox()", "type": "expression", "loc": [283, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.285, 0.001, 2, 0.55, 0.963, 59, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "add_polygon_combobox", "arg_names": [], "import_names": [], "rhs_call_name": "add_polygon_combobox", "annotation": ""}, "snippet": " self.add_polygon_combobox()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L285_C8", "label": "slot_update_polygons()", "type": "expression", "loc": [285, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.287, 0.001, 2, 0.55, 0.9691, 576, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "slot_update_polygons", "arg_names": [], "import_names": [], "rhs_call_name": "slot_update_polygons", "annotation": ""}, "snippet": " self.slot_update_polygons(self.current_dataset.polygons,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L288_C8", "label": "setLayout()", "type": "expression", "loc": [288, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.29, 0.001, 2, 0.55, 0.9753, 375, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setLayout", "arg_names": [], "import_names": [], "rhs_call_name": "setLayout", "annotation": ""}, "snippet": " self.setLayout(self.outer_layout)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L291_C8", "label": "resize()", "type": "expression", "loc": [291, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2931, 0.001, 2, 0.55, 0.9815, 834, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "resize", "arg_names": [], "import_names": [], "rhs_call_name": "resize", "annotation": ""}, "snippet": " self.resize(900, 700) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L292_C8", "label": "load_values_from_dataset()", "type": "expression", "loc": [292, 292], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2941, 0.001, 2, 0.55, 0.9877, 632, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load_values_from_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "load_values_from_dataset", "annotation": ""}, "snippet": " self.load_values_from_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L294_C8", "label": "self.init_in_progress =", "type": "assigned_variable", "loc": [294, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [14, 2, 0.2961, 0.001, 2, 0.55, 0.9938, 140, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.init_in_progress", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.init_in_progress = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L297_C8", "label": "slot_last_dataset()", "type": "expression", "loc": [297, 297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "vector": [8, 2, 0.2991, 0.001, 2, 0.55, 1.0, 765, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "slot_last_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "slot_last_dataset", "annotation": ""}, "snippet": " self.slot_last_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L300_C4", "label": "slot_update_training_set", "type": "function", "loc": [300, 304], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.3041, 0.005, 1, 0.45, 0.0976, 931, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "slot_update_training_set", "arg_names": ["self", "checkState"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_update_training_set(self, checkState):\n if checkState:\n self.current_dataset.is_training_set = True\n else:\n self.current_dataset.is_training_set = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L301_C8", "label": "if", "type": "if", "loc": [301, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L300_C4", "vector": [4, 2, 0.3046, 0.004, 2, 0.6, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if checkState:\n self.current_dataset.is_training_set = True\n else:\n self.current_dataset.is_training_set = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L302_C12", "label": "self.current_dataset.is_training_set =", "type": "assigned_variable", "loc": [302, 302], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L301_C8", "vector": [14, 3, 0.3041, 0.001, 3, 0.38, 0.0, 303, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.current_dataset.is_training_set", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_dataset.is_training_set = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L304_C12", "label": "self.current_dataset.is_training_set =", "type": "assigned_variable", "loc": [304, 304], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L301_C8", "vector": [14, 3, 0.3061, 0.001, 3, 0.38, 1.0, 303, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.current_dataset.is_training_set", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_dataset.is_training_set = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L306_C4", "label": "slot_update_test_set", "type": "function", "loc": [306, 310], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.3102, 0.005, 1, 0.45, 0.122, 991, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "slot_update_test_set", "arg_names": ["self", "checkState"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_update_test_set(self, checkState):\n if checkState:\n self.current_dataset.is_test_set = True\n else:\n self.current_dataset.is_test_set = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L307_C8", "label": "if", "type": "if", "loc": [307, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L306_C4", "vector": [4, 2, 0.3107, 0.004, 2, 0.91, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if checkState:\n self.current_dataset.is_test_set = True\n else:\n self.current_dataset.is_test_set = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L308_C12", "label": "self.current_dataset.is_test_set =", "type": "assigned_variable", "loc": [308, 308], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L307_C8", "vector": [14, 3, 0.3102, 0.001, 3, 0.71, 0.0, 975, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.current_dataset.is_test_set", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_dataset.is_test_set = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L310_C12", "label": "self.current_dataset.is_test_set =", "type": "assigned_variable", "loc": [310, 310], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L307_C8", "vector": [14, 3, 0.3122, 0.001, 3, 0.71, 1.0, 975, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.current_dataset.is_test_set", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_dataset.is_test_set = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L312_C4", "label": "slot_update_is_labeled", "type": "function", "loc": [312, 316], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.3162, 0.005, 1, 0.45, 0.1463, 560, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "slot_update_is_labeled", "arg_names": ["self", "checkState"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_update_is_labeled(self, checkState):\n if checkState:\n self.current_dataset.is_labeled = True\n else:\n self.current_dataset.is_labeled = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L313_C8", "label": "if", "type": "if", "loc": [313, 316], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L312_C4", "vector": [4, 2, 0.3167, 0.004, 2, 0.65, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if checkState:\n self.current_dataset.is_labeled = True\n else:\n self.current_dataset.is_labeled = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L314_C12", "label": "self.current_dataset.is_labeled =", "type": "assigned_variable", "loc": [314, 314], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L313_C8", "vector": [14, 3, 0.3162, 0.001, 3, 0.99, 0.0, 562, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.current_dataset.is_labeled", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_dataset.is_labeled = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L316_C12", "label": "self.current_dataset.is_labeled =", "type": "assigned_variable", "loc": [316, 316], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L313_C8", "vector": [14, 3, 0.3182, 0.001, 3, 0.99, 1.0, 562, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.current_dataset.is_labeled", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_dataset.is_labeled = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L318_C4", "label": "closeEvent", "type": "function", "loc": [318, 320], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.3212, 0.003, 1, 0.45, 0.1707, 238, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "closeEvent", "arg_names": ["self", "x"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def closeEvent(self, x):\n print(\"Exit: saving database...\")\n self.slot_save() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L319_C8", "label": "print()", "type": "expression", "loc": [319, 319], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L318_C4", "vector": [8, 2, 0.3212, 0.001, 2, 0.86, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Exit: saving database...\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L320_C8", "label": "slot_save()", "type": "expression", "loc": [320, 320], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L318_C4", "vector": [8, 2, 0.3223, 0.001, 2, 0.86, 1.0, 522, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "slot_save", "arg_names": [], "import_names": [], "rhs_call_name": "slot_save", "annotation": ""}, "snippet": " self.slot_save() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L322_C4", "label": "slot_import_image", "type": "function", "loc": [322, 337], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.3318, 0.0161, 1, 0.45, 0.1951, 756, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "slot_import_image", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_import_image(self):\n fileName = QtGui.QFileDialog.getOpenFileName(self,\"Open Image\", self.path, \"Image Files (*.png)\")\n print(\"Import image into new dataset:\" + fileName)\n \n name = ut.formatted_time()\n \n new_dataset = scan_dataset.scan_dataset()\n new_dataset.id = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L323_C8", "label": "fileName = getOpenFileName()", "type": "assigned_variable", "loc": [323, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L322_C4", "vector": [14, 2, 0.3253, 0.001, 2, 0.74, 0.0, 282, 3, 4, 0, 0, 709, 10, 1], "semantic": {"name": "fileName", "arg_names": [], "import_names": [], "rhs_call_name": "getOpenFileName", "annotation": ""}, "snippet": " fileName = QtGui.QFileDialog.getOpenFileName(self,\"Open Image\", self.path, \"Image Files (*.png)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L324_C8", "label": "print()", "type": "expression", "loc": [324, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L322_C4", "vector": [8, 2, 0.3263, 0.001, 2, 0.74, 0.125, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Import image into new dataset:\" + fileName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L326_C8", "label": "name = formatted_time()", "type": "assigned_variable", "loc": [326, 326], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L322_C4", "vector": [14, 2, 0.3283, 0.001, 2, 0.74, 0.25, 57, 3, 0, 0, 0, 353, 10, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "formatted_time", "annotation": ""}, "snippet": " name = ut.formatted_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L328_C8", "label": "new_dataset = scan_dataset()", "type": "assigned_variable", "loc": [328, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L322_C4", "vector": [14, 2, 0.3303, 0.001, 2, 0.74, 0.375, 146, 3, 0, 0, 0, 727, 10, 1], "semantic": {"name": "new_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "scan_dataset", "annotation": ""}, "snippet": " new_dataset = scan_dataset.scan_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L329_C8", "label": "new_dataset.id =", "type": "assigned_variable", "loc": [329, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L322_C4", "vector": [14, 2, 0.3313, 0.001, 2, 0.74, 0.5, 229, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "new_dataset.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_dataset.id = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L330_C8", "label": "new_dataset.image_filename =", "type": "assigned_variable", "loc": [330, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L322_C4", "vector": [14, 2, 0.3323, 0.001, 2, 0.74, 0.625, 750, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "new_dataset.image_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_dataset.image_filename = 'data/'+name+'_image.png'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L331_C8", "label": "copy()", "type": "expression", "loc": [331, 331], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L322_C4", "vector": [8, 2, 0.3333, 0.001, 2, 0.74, 0.75, 739, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "copy", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " shutil.copy(fileName,self.path+'/'+new_dataset.image_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L333_C8", "label": "add_dataset()", "type": "expression", "loc": [333, 333], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L322_C4", "vector": [8, 2, 0.3353, 0.001, 2, 0.74, 0.875, 326, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "add_dataset", "annotation": ""}, "snippet": " self.scans_database.add_dataset(new_dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:While_L336_C8", "label": "while", "type": "while", "loc": [336, 337], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L322_C4", "vector": [5, 2, 0.3389, 0.002, 2, 0.74, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True == self.slot_next_dataset():\n pass "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L340_C4", "label": "add_line_edit", "type": "function", "loc": [340, 348], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.3464, 0.0091, 1, 0.45, 0.2195, 56, 0, 4, 1, 0, 0, 0, 8], "semantic": {"name": "add_line_edit", "arg_names": ["self", "label", "layout", "variable"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_line_edit(self,label, layout, variable):\n label = QtGui.QLabel(label)\n line_edit = QtGui.QLineEdit()\n line_edit.setMinimumWidth(80)\n self.line_edits.append((line_edit,variable))\n layout.addWidget(label)\n layout.addWidget(line_edit)\n self.connect(line_edit, QtCore.SIGNAL('textEdited (const QString&)'), self.slot_line_edit_changed ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L341_C8", "label": "label = QLabel()", "type": "assigned_variable", "loc": [341, 341], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L340_C4", "vector": [14, 2, 0.3434, 0.001, 2, 0.32, 0.0, 811, 3, 1, 0, 0, 495, 10, 1], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "QLabel", "annotation": ""}, "snippet": " label = QtGui.QLabel(label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L342_C8", "label": "line_edit = QLineEdit()", "type": "assigned_variable", "loc": [342, 342], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L340_C4", "vector": [14, 2, 0.3444, 0.001, 2, 0.32, 0.1429, 632, 3, 0, 0, 0, 755, 10, 1], "semantic": {"name": "line_edit", "arg_names": [], "import_names": [], "rhs_call_name": "QLineEdit", "annotation": ""}, "snippet": " line_edit = QtGui.QLineEdit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L343_C8", "label": "setMinimumWidth()", "type": "expression", "loc": [343, 343], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L340_C4", "vector": [8, 2, 0.3454, 0.001, 2, 0.32, 0.2857, 812, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setMinimumWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setMinimumWidth", "annotation": ""}, "snippet": " line_edit.setMinimumWidth(80)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L344_C8", "label": "append()", "type": "expression", "loc": [344, 344], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L340_C4", "vector": [8, 2, 0.3464, 0.001, 2, 0.32, 0.4286, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.line_edits.append((line_edit,variable))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L345_C8", "label": "addWidget()", "type": "expression", "loc": [345, 345], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L340_C4", "vector": [8, 2, 0.3474, 0.001, 2, 0.32, 0.5714, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " layout.addWidget(label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L346_C8", "label": "addWidget()", "type": "expression", "loc": [346, 346], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L340_C4", "vector": [8, 2, 0.3484, 0.001, 2, 0.32, 0.7143, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " layout.addWidget(line_edit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L347_C8", "label": "connect()", "type": "expression", "loc": [347, 347], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L340_C4", "vector": [8, 2, 0.3494, 0.001, 2, 0.32, 0.8571, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(line_edit, QtCore.SIGNAL('textEdited (const QString&)'), self.slot_line_edit_changed ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L348_C8", "label": "return", "type": "return", "loc": [348, 348], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L340_C4", "vector": [13, 2, 0.3505, 0.001, 2, 0.32, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return line_edit "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L350_C4", "label": "slot_line_edit_changed", "type": "function", "loc": [350, 355], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.355, 0.006, 1, 0.45, 0.2439, 941, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "slot_line_edit_changed", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_line_edit_changed(self,text):\n if True == self.init_in_progress:\n return\n \n for (line_edit, variable) in self.line_edits:\n self.current_dataset.dict[variable] = str(line_edit.text())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L351_C8", "label": "if", "type": "if", "loc": [351, 352], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L350_C4", "vector": [4, 2, 0.354, 0.002, 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 True == self.init_in_progress:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L352_C12", "label": "return", "type": "return", "loc": [352, 352], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L351_C8", "vector": [13, 3, 0.3545, 0.001, 3, 0.1, 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_99713:For_L354_C8", "label": "for line_edit, variable", "type": "for", "loc": [354, 355], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L350_C4", "vector": [6, 2, 0.357, 0.002, 2, 0.49, 1.0, 86, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "line_edit, variable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for (line_edit, variable) in self.line_edits:\n self.current_dataset.dict[variable] = str(line_edit.text())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L355_C12", "label": " = str()", "type": "assigned_variable", "loc": [355, 355], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L354_C8", "vector": [14, 3, 0.3575, 0.001, 3, 0.35, 0.0, 0, 3, 1, 0, 0, 52, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "str", "annotation": ""}, "snippet": " self.current_dataset.dict[variable] = str(line_edit.text())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L357_C4", "label": "slot_next_dataset", "type": "function", "loc": [357, 363], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.3625, 0.007, 1, 0.45, 0.2683, 370, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "slot_next_dataset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_next_dataset(self):\n dataset = self.scans_database.get_next_dataset()\n if False != dataset:\n self.current_dataset = dataset\n self.load_values_from_dataset()\n return True\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L358_C8", "label": "dataset = get_next_dataset()", "type": "assigned_variable", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L357_C4", "vector": [14, 2, 0.3605, 0.001, 2, 0.16, 0.0, 603, 3, 0, 0, 0, 672, 10, 1], "semantic": {"name": "dataset", "arg_names": [], "import_names": [], "rhs_call_name": "get_next_dataset", "annotation": ""}, "snippet": " dataset = self.scans_database.get_next_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L359_C8", "label": "if", "type": "if", "loc": [359, 362], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L357_C4", "vector": [4, 2, 0.363, 0.004, 2, 0.16, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False != dataset:\n self.current_dataset = dataset\n self.load_values_from_dataset()\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L360_C12", "label": "self.current_dataset =", "type": "assigned_variable", "loc": [360, 360], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L359_C8", "vector": [14, 3, 0.3625, 0.001, 3, 0.38, 0.0, 782, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.current_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_dataset = dataset"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L361_C12", "label": "load_values_from_dataset()", "type": "expression", "loc": [361, 361], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L359_C8", "vector": [8, 3, 0.3635, 0.001, 3, 0.38, 0.5, 632, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load_values_from_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "load_values_from_dataset", "annotation": ""}, "snippet": " self.load_values_from_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L362_C12", "label": "return", "type": "return", "loc": [362, 362], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L359_C8", "vector": [13, 3, 0.3646, 0.001, 3, 0.38, 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_99713:Return_L363_C8", "label": "return", "type": "return", "loc": [363, 363], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L357_C4", "vector": [13, 2, 0.3656, 0.001, 2, 0.16, 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_99713:FunctionDef_L365_C4", "label": "slot_prev_dataset", "type": "function", "loc": [365, 371], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.3706, 0.007, 1, 0.45, 0.2927, 337, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "slot_prev_dataset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_prev_dataset(self):\n dataset = self.scans_database.get_prev_dataset()\n if False != dataset:\n self.current_dataset = dataset\n self.load_values_from_dataset()\n return True\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L366_C8", "label": "dataset = get_prev_dataset()", "type": "assigned_variable", "loc": [366, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L365_C4", "vector": [14, 2, 0.3686, 0.001, 2, 0.21, 0.0, 603, 3, 0, 0, 0, 58, 10, 1], "semantic": {"name": "dataset", "arg_names": [], "import_names": [], "rhs_call_name": "get_prev_dataset", "annotation": ""}, "snippet": " dataset = self.scans_database.get_prev_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L367_C8", "label": "if", "type": "if", "loc": [367, 370], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L365_C4", "vector": [4, 2, 0.3711, 0.004, 2, 0.21, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False != dataset:\n self.current_dataset = dataset\n self.load_values_from_dataset()\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L368_C12", "label": "self.current_dataset =", "type": "assigned_variable", "loc": [368, 368], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L367_C8", "vector": [14, 3, 0.3706, 0.001, 3, 0.68, 0.0, 782, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.current_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_dataset = dataset"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L369_C12", "label": "load_values_from_dataset()", "type": "expression", "loc": [369, 369], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L367_C8", "vector": [8, 3, 0.3716, 0.001, 3, 0.68, 0.5, 632, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load_values_from_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "load_values_from_dataset", "annotation": ""}, "snippet": " self.load_values_from_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L370_C12", "label": "return", "type": "return", "loc": [370, 370], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L367_C8", "vector": [13, 3, 0.3726, 0.001, 3, 0.68, 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_99713:Return_L371_C8", "label": "return", "type": "return", "loc": [371, 371], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L365_C4", "vector": [13, 2, 0.3736, 0.001, 2, 0.21, 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_99713:FunctionDef_L373_C4", "label": "slot_first_dataset", "type": "function", "loc": [373, 379], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.3787, 0.007, 1, 0.45, 0.3171, 938, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "slot_first_dataset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_first_dataset(self):\n dataset = self.scans_database.get_first_dataset()\n if False != dataset:\n self.current_dataset = dataset\n self.load_values_from_dataset()\n return True\n return False "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L374_C8", "label": "dataset = get_first_dataset()", "type": "assigned_variable", "loc": [374, 374], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L373_C4", "vector": [14, 2, 0.3766, 0.001, 2, 0.5, 0.0, 603, 3, 0, 0, 0, 189, 10, 1], "semantic": {"name": "dataset", "arg_names": [], "import_names": [], "rhs_call_name": "get_first_dataset", "annotation": ""}, "snippet": " dataset = self.scans_database.get_first_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L375_C8", "label": "if", "type": "if", "loc": [375, 378], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L373_C4", "vector": [4, 2, 0.3792, 0.004, 2, 0.5, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False != dataset:\n self.current_dataset = dataset\n self.load_values_from_dataset()\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L376_C12", "label": "self.current_dataset =", "type": "assigned_variable", "loc": [376, 376], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L375_C8", "vector": [14, 3, 0.3787, 0.001, 3, 0.87, 0.0, 782, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.current_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_dataset = dataset"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L377_C12", "label": "load_values_from_dataset()", "type": "expression", "loc": [377, 377], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L375_C8", "vector": [8, 3, 0.3797, 0.001, 3, 0.87, 0.5, 632, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load_values_from_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "load_values_from_dataset", "annotation": ""}, "snippet": " self.load_values_from_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L378_C12", "label": "return", "type": "return", "loc": [378, 378], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L375_C8", "vector": [13, 3, 0.3807, 0.001, 3, 0.87, 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_99713:Return_L379_C8", "label": "return", "type": "return", "loc": [379, 379], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L373_C4", "vector": [13, 2, 0.3817, 0.001, 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 False "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L381_C4", "label": "slot_last_dataset", "type": "function", "loc": [381, 387], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.3867, 0.007, 1, 0.45, 0.3415, 765, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "slot_last_dataset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_last_dataset(self):\n dataset = self.scans_database.get_last_dataset()\n if False != dataset:\n self.current_dataset = dataset\n self.load_values_from_dataset()\n return True\n return False "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L382_C8", "label": "dataset = get_last_dataset()", "type": "assigned_variable", "loc": [382, 382], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L381_C4", "vector": [14, 2, 0.3847, 0.001, 2, 0.56, 0.0, 603, 3, 0, 0, 0, 863, 10, 1], "semantic": {"name": "dataset", "arg_names": [], "import_names": [], "rhs_call_name": "get_last_dataset", "annotation": ""}, "snippet": " dataset = self.scans_database.get_last_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L383_C8", "label": "if", "type": "if", "loc": [383, 386], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L381_C4", "vector": [4, 2, 0.3872, 0.004, 2, 0.56, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False != dataset:\n self.current_dataset = dataset\n self.load_values_from_dataset()\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L384_C12", "label": "self.current_dataset =", "type": "assigned_variable", "loc": [384, 384], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L383_C8", "vector": [14, 3, 0.3867, 0.001, 3, 0.61, 0.0, 782, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.current_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_dataset = dataset"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L385_C12", "label": "load_values_from_dataset()", "type": "expression", "loc": [385, 385], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L383_C8", "vector": [8, 3, 0.3877, 0.001, 3, 0.61, 0.5, 632, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load_values_from_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "load_values_from_dataset", "annotation": ""}, "snippet": " self.load_values_from_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L386_C12", "label": "return", "type": "return", "loc": [386, 386], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L383_C8", "vector": [13, 3, 0.3887, 0.001, 3, 0.61, 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_99713:Return_L387_C8", "label": "return", "type": "return", "loc": [387, 387], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L381_C4", "vector": [13, 2, 0.3897, 0.001, 2, 0.56, 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_99713:FunctionDef_L390_C4", "label": "load_values_from_dataset", "type": "function", "loc": [390, 442], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.4189, 0.0534, 1, 0.45, 0.3659, 632, 0, 1, 0, 0, 0, 0, 32], "semantic": {"name": "load_values_from_dataset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def load_values_from_dataset(self):\n self.init_in_progress = True\n \n self.id_label.setText(self.current_dataset.id)\n \n for (line_edit, variable) in self.line_edits:\n line_edit.setText(self.current_dataset.dict[variable])\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L391_C8", "label": "self.init_in_progress =", "type": "assigned_variable", "loc": [391, 391], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "vector": [14, 2, 0.3938, 0.001, 2, 0.34, 0.0, 140, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.init_in_progress", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.init_in_progress = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L393_C8", "label": "setText()", "type": "expression", "loc": [393, 393], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "vector": [8, 2, 0.3958, 0.001, 2, 0.34, 0.0625, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.id_label.setText(self.current_dataset.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L395_C8", "label": "for line_edit, variable", "type": "for", "loc": [395, 396], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "vector": [6, 2, 0.3983, 0.002, 2, 0.34, 0.125, 86, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "line_edit, variable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for (line_edit, variable) in self.line_edits:\n line_edit.setText(self.current_dataset.dict[variable])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L396_C12", "label": "setText()", "type": "expression", "loc": [396, 396], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L395_C8", "vector": [8, 3, 0.3988, 0.001, 3, 0.91, 0.0, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " line_edit.setText(self.current_dataset.dict[variable])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L398_C8", "label": "for index, box", "type": "for", "loc": [398, 404], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "vector": [6, 2, 0.4038, 0.007, 2, 0.34, 0.1875, 860, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "index, box", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index, box in enumerate(self.polygon_comboboxes):\n if index < len(self.current_dataset.polygons):\n print(str(index) + \" load label:\" + self.current_dataset.polygons[index].get_label())\n boxindex = box.findData(QtCore.QVariant(self.current_dataset.polygons[index].get_label()))\n box.setCurrentIndex(boxindex)\n else: #set default to first:\n box.setCurrentIndex(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L399_C12", "label": "if", "type": "if", "loc": [399, 404], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L398_C8", "vector": [4, 3, 0.4043, 0.006, 3, 0.49, 0.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if index < len(self.current_dataset.polygons):\n print(str(index) + \" load label:\" + self.current_dataset.polygons[index].get_label())\n boxindex = box.findData(QtCore.QVariant(self.current_dataset.polygons[index].get_label()))\n box.setCurrentIndex(boxindex)\n else: #set default to first:\n box.setCurrentIndex(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L400_C16", "label": "print()", "type": "expression", "loc": [400, 400], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L399_C12", "vector": [8, 4, 0.4028, 0.001, 4, 0.31, 0.0, 535, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(str(index) + \" load label:\" + self.current_dataset.polygons[index].get_label())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L401_C16", "label": "boxindex = findData()", "type": "assigned_variable", "loc": [401, 401], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L399_C12", "vector": [14, 4, 0.4038, 0.001, 4, 0.31, 0.3333, 489, 3, 1, 0, 0, 916, 10, 3], "semantic": {"name": "boxindex", "arg_names": [], "import_names": [], "rhs_call_name": "findData", "annotation": ""}, "snippet": " boxindex = box.findData(QtCore.QVariant(self.current_dataset.polygons[index].get_label()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L402_C16", "label": "setCurrentIndex()", "type": "expression", "loc": [402, 402], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L399_C12", "vector": [8, 4, 0.4048, 0.001, 4, 0.31, 0.6667, 142, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setCurrentIndex", "arg_names": [], "import_names": [], "rhs_call_name": "setCurrentIndex", "annotation": ""}, "snippet": " box.setCurrentIndex(boxindex)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L404_C16", "label": "setCurrentIndex()", "type": "expression", "loc": [404, 404], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L399_C12", "vector": [8, 4, 0.4068, 0.001, 4, 0.31, 1.0, 142, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setCurrentIndex", "arg_names": [], "import_names": [], "rhs_call_name": "setCurrentIndex", "annotation": ""}, "snippet": " box.setCurrentIndex(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L407_C8", "label": "box =", "type": "assigned_variable", "loc": [407, 407], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "vector": [14, 2, 0.4099, 0.001, 2, 0.34, 0.25, 918, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "box", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " box = self.surface_type_combobox"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L408_C8", "label": "boxindex = findData()", "type": "assigned_variable", "loc": [408, 408], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "vector": [14, 2, 0.4109, 0.001, 2, 0.34, 0.3125, 489, 3, 1, 0, 0, 916, 10, 2], "semantic": {"name": "boxindex", "arg_names": [], "import_names": [], "rhs_call_name": "findData", "annotation": ""}, "snippet": " boxindex = box.findData(QtCore.QVariant(self.current_dataset.surface_type))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L409_C8", "label": "setCurrentIndex()", "type": "expression", "loc": [409, 409], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "vector": [8, 2, 0.4119, 0.001, 2, 0.34, 0.375, 142, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setCurrentIndex", "arg_names": [], "import_names": [], "rhs_call_name": "setCurrentIndex", "annotation": ""}, "snippet": " box.setCurrentIndex(boxindex)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L411_C8", "label": "print()", "type": "expression", "loc": [411, 411], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "vector": [8, 2, 0.4139, 0.001, 2, 0.34, 0.4375, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(self.current_dataset.is_training_set)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L412_C8", "label": "if", "type": "if", "loc": [412, 415], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "vector": [4, 2, 0.4164, 0.004, 2, 0.34, 0.5, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.current_dataset.is_training_set:\n self.checkbox_training_set.setCheckState(QtCore.Qt.Checked)\n else:\n self.checkbox_training_set.setCheckState(QtCore.Qt.Unchecked)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L413_C12", "label": "setCheckState()", "type": "expression", "loc": [413, 413], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L412_C8", "vector": [8, 3, 0.4159, 0.001, 3, 0.6, 0.0, 964, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setCheckState", "arg_names": [], "import_names": [], "rhs_call_name": "setCheckState", "annotation": ""}, "snippet": " self.checkbox_training_set.setCheckState(QtCore.Qt.Checked)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L415_C12", "label": "setCheckState()", "type": "expression", "loc": [415, 415], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L412_C8", "vector": [8, 3, 0.4179, 0.001, 3, 0.6, 1.0, 964, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setCheckState", "arg_names": [], "import_names": [], "rhs_call_name": "setCheckState", "annotation": ""}, "snippet": " self.checkbox_training_set.setCheckState(QtCore.Qt.Unchecked)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L417_C8", "label": "if", "type": "if", "loc": [417, 420], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "vector": [4, 2, 0.4215, 0.004, 2, 0.34, 0.5625, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.current_dataset.is_test_set:\n self.checkbox_test_set.setCheckState(QtCore.Qt.Checked)\n else:\n self.checkbox_test_set.setCheckState(QtCore.Qt.Unchecked)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L418_C12", "label": "setCheckState()", "type": "expression", "loc": [418, 418], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L417_C8", "vector": [8, 3, 0.4209, 0.001, 3, 0.2, 0.0, 964, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setCheckState", "arg_names": [], "import_names": [], "rhs_call_name": "setCheckState", "annotation": ""}, "snippet": " self.checkbox_test_set.setCheckState(QtCore.Qt.Checked)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L420_C12", "label": "setCheckState()", "type": "expression", "loc": [420, 420], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L417_C8", "vector": [8, 3, 0.423, 0.001, 3, 0.2, 1.0, 964, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setCheckState", "arg_names": [], "import_names": [], "rhs_call_name": "setCheckState", "annotation": ""}, "snippet": " self.checkbox_test_set.setCheckState(QtCore.Qt.Unchecked)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L422_C8", "label": "if", "type": "if", "loc": [422, 425], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "vector": [4, 2, 0.4265, 0.004, 2, 0.34, 0.625, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.current_dataset.is_labeled:\n self.checkbox_is_labeled.setCheckState(QtCore.Qt.Checked)\n else:\n self.checkbox_is_labeled.setCheckState(QtCore.Qt.Unchecked)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L423_C12", "label": "setCheckState()", "type": "expression", "loc": [423, 423], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L422_C8", "vector": [8, 3, 0.426, 0.001, 3, 0.76, 0.0, 964, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setCheckState", "arg_names": [], "import_names": [], "rhs_call_name": "setCheckState", "annotation": ""}, "snippet": " self.checkbox_is_labeled.setCheckState(QtCore.Qt.Checked)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L425_C12", "label": "setCheckState()", "type": "expression", "loc": [425, 425], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L422_C8", "vector": [8, 3, 0.428, 0.001, 3, 0.76, 1.0, 964, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setCheckState", "arg_names": [], "import_names": [], "rhs_call_name": "setCheckState", "annotation": ""}, "snippet": " self.checkbox_is_labeled.setCheckState(QtCore.Qt.Unchecked)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L428_C8", "label": "print()", "type": "expression", "loc": [428, 428], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "vector": [8, 2, 0.431, 0.001, 2, 0.34, 0.6875, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(self.current_dataset.scan_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L429_C8", "label": "if", "type": "if", "loc": [429, 436], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "vector": [4, 2, 0.4355, 0.0081, 2, 0.34, 0.75, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if '' == self.current_dataset.scan_filename:\n self.display_3d_button.setEnabled(False)\n self.display_3d_spheres_button.setEnabled(False)\n self.display_intensity_button.setEnabled(False)\n else:\n self.display_3d_button.setEnabled(True)\n self.display_3d_spheres_button.setEnabled(True)\n self.display_intensity_button.setEnabled(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L430_C12", "label": "setEnabled()", "type": "expression", "loc": [430, 430], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L429_C8", "vector": [8, 3, 0.433, 0.001, 3, 0.45, 0.0, 503, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setEnabled", "arg_names": [], "import_names": [], "rhs_call_name": "setEnabled", "annotation": ""}, "snippet": " self.display_3d_button.setEnabled(False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L431_C12", "label": "setEnabled()", "type": "expression", "loc": [431, 431], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L429_C8", "vector": [8, 3, 0.434, 0.001, 3, 0.45, 0.2, 503, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setEnabled", "arg_names": [], "import_names": [], "rhs_call_name": "setEnabled", "annotation": ""}, "snippet": " self.display_3d_spheres_button.setEnabled(False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L432_C12", "label": "setEnabled()", "type": "expression", "loc": [432, 432], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L429_C8", "vector": [8, 3, 0.435, 0.001, 3, 0.45, 0.4, 503, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setEnabled", "arg_names": [], "import_names": [], "rhs_call_name": "setEnabled", "annotation": ""}, "snippet": " self.display_intensity_button.setEnabled(False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L434_C12", "label": "setEnabled()", "type": "expression", "loc": [434, 434], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L429_C8", "vector": [8, 3, 0.4371, 0.001, 3, 0.45, 0.6, 503, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setEnabled", "arg_names": [], "import_names": [], "rhs_call_name": "setEnabled", "annotation": ""}, "snippet": " self.display_3d_button.setEnabled(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L435_C12", "label": "setEnabled()", "type": "expression", "loc": [435, 435], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L429_C8", "vector": [8, 3, 0.4381, 0.001, 3, 0.45, 0.8, 503, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setEnabled", "arg_names": [], "import_names": [], "rhs_call_name": "setEnabled", "annotation": ""}, "snippet": " self.display_3d_spheres_button.setEnabled(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L436_C12", "label": "setEnabled()", "type": "expression", "loc": [436, 436], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L429_C8", "vector": [8, 3, 0.4391, 0.001, 3, 0.45, 1.0, 503, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setEnabled", "arg_names": [], "import_names": [], "rhs_call_name": "setEnabled", "annotation": ""}, "snippet": " self.display_intensity_button.setEnabled(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L438_C8", "label": "self.display_mode =", "type": "assigned_variable", "loc": [438, 438], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "vector": [14, 2, 0.4411, 0.001, 2, 0.34, 0.8125, 825, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.display_mode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.display_mode = 'image'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L439_C8", "label": "set_polygons()", "type": "expression", "loc": [439, 439], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "vector": [8, 2, 0.4421, 0.001, 2, 0.34, 0.875, 601, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_polygons", "arg_names": [], "import_names": [], "rhs_call_name": "set_polygons", "annotation": ""}, "snippet": " self.draw_widget.set_polygons(self.current_dataset.polygons)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L440_C8", "label": "set_image()", "type": "expression", "loc": [440, 440], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "vector": [8, 2, 0.4431, 0.001, 2, 0.34, 0.9375, 942, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_image", "arg_names": [], "import_names": [], "rhs_call_name": "set_image", "annotation": ""}, "snippet": " self.draw_widget.set_image(self.scans_database.get_path() + '/' + self.current_dataset.image_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L442_C8", "label": "self.init_in_progress =", "type": "assigned_variable", "loc": [442, 442], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "vector": [14, 2, 0.4451, 0.001, 2, 0.34, 1.0, 140, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.init_in_progress", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.init_in_progress = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L444_C4", "label": "slot_take_artag_image", "type": "function", "loc": [444, 458], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.4542, 0.0151, 1, 0.45, 0.3902, 68, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "slot_take_artag_image", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_take_artag_image(self):\n if False == self.scanner:\n self.scanner = scanner.scanner(self.config)\n if False == self.processor:\n self.processor = processor.processor(self.config)\n \n img = self.scanner.take_artag_image()\n self.current_dataset.image_artag_filename = self.scanner.save_artag_image(self.current_dataset.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L445_C8", "label": "if", "type": "if", "loc": [445, 446], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L444_C4", "vector": [4, 2, 0.4486, 0.002, 2, 0.14, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False == self.scanner:\n self.scanner = scanner.scanner(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L446_C12", "label": "self.scanner = scanner()", "type": "assigned_variable", "loc": [446, 446], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L445_C8", "vector": [14, 3, 0.4491, 0.001, 3, 0.91, 0.0, 509, 3, 1, 0, 0, 802, 10, 1], "semantic": {"name": "self.scanner", "arg_names": [], "import_names": [], "rhs_call_name": "scanner", "annotation": ""}, "snippet": " self.scanner = scanner.scanner(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L447_C8", "label": "if", "type": "if", "loc": [447, 448], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L444_C4", "vector": [4, 2, 0.4507, 0.002, 2, 0.14, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False == self.processor:\n self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L448_C12", "label": "self.processor = processor()", "type": "assigned_variable", "loc": [448, 448], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L447_C8", "vector": [14, 3, 0.4512, 0.001, 3, 0.1, 0.0, 855, 3, 1, 0, 0, 177, 10, 1], "semantic": {"name": "self.processor", "arg_names": [], "import_names": [], "rhs_call_name": "processor", "annotation": ""}, "snippet": " self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L450_C8", "label": "img = take_artag_image()", "type": "assigned_variable", "loc": [450, 450], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L444_C4", "vector": [14, 2, 0.4532, 0.001, 2, 0.14, 0.4, 200, 3, 0, 0, 0, 561, 10, 1], "semantic": {"name": "img", "arg_names": [], "import_names": [], "rhs_call_name": "take_artag_image", "annotation": ""}, "snippet": " img = self.scanner.take_artag_image()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L451_C8", "label": "self.current_dataset.image_artag_filename = save_artag_image()", "type": "assigned_variable", "loc": [451, 451], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L444_C4", "vector": [14, 2, 0.4542, 0.001, 2, 0.14, 0.6, 413, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "self.current_dataset.image_artag_filename", "arg_names": [], "import_names": [], "rhs_call_name": "save_artag_image", "annotation": ""}, "snippet": " self.current_dataset.image_artag_filename = self.scanner.save_artag_image(self.current_dataset.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L453_C8", "label": "slot_save()", "type": "expression", "loc": [453, 453], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L444_C4", "vector": [8, 2, 0.4562, 0.001, 2, 0.14, 0.8, 522, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "slot_save", "arg_names": [], "import_names": [], "rhs_call_name": "slot_save", "annotation": ""}, "snippet": " self.slot_save() #save for consistency with files"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L455_C8", "label": "if", "type": "if", "loc": [455, 458], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L444_C4", "vector": [4, 2, 0.4597, 0.004, 2, 0.14, 1.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.processor.read_artag(img).any():\n print(\"SUCCESS in reading ARTag\")\n else:\n print(\"FAILURE in reading ARTag - try again!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L456_C12", "label": "print()", "type": "expression", "loc": [456, 456], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L455_C8", "vector": [8, 3, 0.4592, 0.001, 3, 0.72, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"SUCCESS in reading ARTag\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L458_C12", "label": "print()", "type": "expression", "loc": [458, 458], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L455_C8", "vector": [8, 3, 0.4612, 0.001, 3, 0.72, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"FAILURE in reading ARTag - try again!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L462_C4", "label": "slot_take_scan", "type": "function", "loc": [462, 485], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.4768, 0.0242, 1, 0.45, 0.4146, 894, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "slot_take_scan", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_take_scan(self):\n \n #save database, let scanner add dataset, reload it then\n self.slot_save()\n \n if False == self.scanner:\n self.scanner = scanner.scanner(self.config)\n if False == self.processor:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L465_C8", "label": "slot_save()", "type": "expression", "loc": [465, 465], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L462_C4", "vector": [8, 2, 0.4683, 0.001, 2, 0.18, 0.0, 522, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "slot_save", "arg_names": [], "import_names": [], "rhs_call_name": "slot_save", "annotation": ""}, "snippet": " self.slot_save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L467_C8", "label": "if", "type": "if", "loc": [467, 468], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L462_C4", "vector": [4, 2, 0.4708, 0.002, 2, 0.18, 0.1429, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False == self.scanner:\n self.scanner = scanner.scanner(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L468_C12", "label": "self.scanner = scanner()", "type": "assigned_variable", "loc": [468, 468], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L467_C8", "vector": [14, 3, 0.4713, 0.001, 3, 0.15, 0.0, 509, 3, 1, 0, 0, 802, 10, 1], "semantic": {"name": "self.scanner", "arg_names": [], "import_names": [], "rhs_call_name": "scanner", "annotation": ""}, "snippet": " self.scanner = scanner.scanner(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L469_C8", "label": "if", "type": "if", "loc": [469, 470], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L462_C4", "vector": [4, 2, 0.4728, 0.002, 2, 0.18, 0.2857, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False == self.processor:\n self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L470_C12", "label": "self.processor = processor()", "type": "assigned_variable", "loc": [470, 470], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L469_C8", "vector": [14, 3, 0.4733, 0.001, 3, 0.8, 0.0, 855, 3, 1, 0, 0, 177, 10, 1], "semantic": {"name": "self.processor", "arg_names": [], "import_names": [], "rhs_call_name": "processor", "annotation": ""}, "snippet": " self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L472_C8", "label": "name = formatted_time()", "type": "assigned_variable", "loc": [472, 472], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L462_C4", "vector": [14, 2, 0.4753, 0.001, 2, 0.18, 0.4286, 57, 3, 0, 0, 0, 353, 10, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "formatted_time", "annotation": ""}, "snippet": " name = ut.formatted_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L473_C8", "label": "capture_and_save()", "type": "expression", "loc": [473, 473], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L462_C4", "vector": [8, 2, 0.4763, 0.001, 2, 0.18, 0.5714, 272, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "capture_and_save", "arg_names": [], "import_names": [], "rhs_call_name": "capture_and_save", "annotation": ""}, "snippet": " self.scanner.capture_and_save(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L479_C8", "label": "print()", "type": "expression", "loc": [479, 479], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L462_C4", "vector": [8, 2, 0.4824, 0.001, 2, 0.18, 0.7143, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('scan ' + name + ' taken')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L481_C8", "label": "load()", "type": "expression", "loc": [481, 481], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L462_C4", "vector": [8, 2, 0.4844, 0.001, 2, 0.18, 0.8571, 37, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": " self.scans_database.load(self.path,'database.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:While_L484_C8", "label": "while", "type": "while", "loc": [484, 485], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L462_C4", "vector": [5, 2, 0.4879, 0.002, 2, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True == self.slot_next_dataset():\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L487_C4", "label": "slot_display_intensity", "type": "function", "loc": [487, 510], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.502, 0.0242, 1, 0.45, 0.439, 844, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "slot_display_intensity", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_display_intensity(self):\n if self.display_mode != 'intensities':\n if False == self.processor:\n self.processor = processor.processor(self.config)\n \n #reset ground plane:\n self.current_dataset.ground_plane_normal = ''\n self.current_dataset.ground_plane_three_points = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "label": "if", "type": "if", "loc": [488, 510], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L487_C4", "vector": [4, 2, 0.5025, 0.0232, 2, 0.51, 0.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.display_mode != 'intensities':\n if False == self.processor:\n self.processor = processor.processor(self.config)\n \n #reset ground plane:\n self.current_dataset.ground_plane_normal = ''\n self.current_dataset.ground_plane_three_points = ''\n self.slot_save() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L489_C12", "label": "if", "type": "if", "loc": [489, 490], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "vector": [4, 3, 0.493, 0.002, 3, 0.67, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False == self.processor:\n self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L490_C16", "label": "self.processor = processor()", "type": "assigned_variable", "loc": [490, 490], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L489_C12", "vector": [14, 4, 0.4935, 0.001, 4, 0.7, 0.0, 855, 3, 1, 0, 0, 177, 10, 1], "semantic": {"name": "self.processor", "arg_names": [], "import_names": [], "rhs_call_name": "processor", "annotation": ""}, "snippet": " self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L493_C12", "label": "self.current_dataset.ground_plane_normal =", "type": "assigned_variable", "loc": [493, 493], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "vector": [14, 3, 0.4965, 0.001, 3, 0.67, 0.1, 730, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.current_dataset.ground_plane_normal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_dataset.ground_plane_normal = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L494_C12", "label": "self.current_dataset.ground_plane_three_points =", "type": "assigned_variable", "loc": [494, 494], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "vector": [14, 3, 0.4975, 0.001, 3, 0.67, 0.2, 913, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.current_dataset.ground_plane_three_points", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_dataset.ground_plane_three_points = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L495_C12", "label": "slot_save()", "type": "expression", "loc": [495, 495], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "vector": [8, 3, 0.4985, 0.001, 3, 0.67, 0.3, 522, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "slot_save", "arg_names": [], "import_names": [], "rhs_call_name": "slot_save", "annotation": ""}, "snippet": " self.slot_save() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L498_C12", "label": "load_data()", "type": "expression", "loc": [498, 498], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "vector": [8, 3, 0.5015, 0.001, 3, 0.67, 0.4, 477, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_data", "arg_names": [], "import_names": [], "rhs_call_name": "load_data", "annotation": ""}, "snippet": " self.processor.load_data(self.current_dataset.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L499_C12", "label": "process_intensities()", "type": "expression", "loc": [499, 499], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "vector": [8, 3, 0.5025, 0.001, 3, 0.67, 0.5, 581, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "process_intensities", "arg_names": [], "import_names": [], "rhs_call_name": "process_intensities", "annotation": ""}, "snippet": " self.processor.process_intensities()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L500_C12", "label": "filename = save_intensity_image()", "type": "assigned_variable", "loc": [500, 500], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "vector": [14, 3, 0.5035, 0.001, 3, 0.67, 0.6, 275, 3, 1, 0, 0, 571, 10, 1], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "save_intensity_image", "annotation": ""}, "snippet": " filename = self.processor.save_intensity_image(self.current_dataset.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L504_C12", "label": "self.display_mode =", "type": "assigned_variable", "loc": [504, 504], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "vector": [14, 3, 0.5076, 0.001, 3, 0.67, 0.7, 825, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.display_mode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.display_mode = 'intensities'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L505_C12", "label": "set_image()", "type": "expression", "loc": [505, 505], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "vector": [8, 3, 0.5086, 0.001, 3, 0.67, 0.8, 942, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_image", "arg_names": [], "import_names": [], "rhs_call_name": "set_image", "annotation": ""}, "snippet": " self.draw_widget.set_image(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L509_C12", "label": "self.display_mode =", "type": "assigned_variable", "loc": [509, 509], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "vector": [14, 3, 0.5126, 0.001, 3, 0.67, 0.9, 825, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.display_mode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.display_mode = 'image'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L510_C12", "label": "set_image()", "type": "expression", "loc": [510, 510], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "vector": [8, 3, 0.5136, 0.001, 3, 0.67, 1.0, 942, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_image", "arg_names": [], "import_names": [], "rhs_call_name": "set_image", "annotation": ""}, "snippet": " self.draw_widget.set_image(self.scans_database.get_path() + '/' + self.current_dataset.image_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L512_C4", "label": "slot_display_features", "type": "function", "loc": [512, 526], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.5227, 0.0151, 1, 0.45, 0.4634, 72, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "slot_display_features", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_display_features(self):\n if self.display_mode != 'features':\n if False == self.processor:\n self.processor = processor.processor(self.config)\n \n self.processor.load_data(self.current_dataset.id)\n self.processor.process_intensities()\n filename = self.processor.save_intensity_image(self.current_dataset.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L513_C8", "label": "if", "type": "if", "loc": [513, 526], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L512_C4", "vector": [4, 2, 0.5232, 0.0141, 2, 0.46, 0.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.display_mode != 'features':\n if False == self.processor:\n self.processor = processor.processor(self.config)\n \n self.processor.load_data(self.current_dataset.id)\n self.processor.process_intensities()\n filename = self.processor.save_intensity_image(self.current_dataset.id)\n self.display_mode = 'features'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L514_C12", "label": "if", "type": "if", "loc": [514, 515], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L513_C8", "vector": [4, 3, 0.5181, 0.002, 3, 0.5, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False == self.processor:\n self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L515_C16", "label": "self.processor = processor()", "type": "assigned_variable", "loc": [515, 515], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L514_C12", "vector": [14, 4, 0.5186, 0.001, 4, 0.26, 0.0, 855, 3, 1, 0, 0, 177, 10, 1], "semantic": {"name": "self.processor", "arg_names": [], "import_names": [], "rhs_call_name": "processor", "annotation": ""}, "snippet": " self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L517_C12", "label": "load_data()", "type": "expression", "loc": [517, 517], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L513_C8", "vector": [8, 3, 0.5206, 0.001, 3, 0.5, 0.1429, 477, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_data", "arg_names": [], "import_names": [], "rhs_call_name": "load_data", "annotation": ""}, "snippet": " self.processor.load_data(self.current_dataset.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L518_C12", "label": "process_intensities()", "type": "expression", "loc": [518, 518], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L513_C8", "vector": [8, 3, 0.5217, 0.001, 3, 0.5, 0.2857, 581, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "process_intensities", "arg_names": [], "import_names": [], "rhs_call_name": "process_intensities", "annotation": ""}, "snippet": " self.processor.process_intensities()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L519_C12", "label": "filename = save_intensity_image()", "type": "assigned_variable", "loc": [519, 519], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L513_C8", "vector": [14, 3, 0.5227, 0.001, 3, 0.5, 0.4286, 275, 3, 1, 0, 0, 571, 10, 1], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "save_intensity_image", "annotation": ""}, "snippet": " filename = self.processor.save_intensity_image(self.current_dataset.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L520_C12", "label": "self.display_mode =", "type": "assigned_variable", "loc": [520, 520], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L513_C8", "vector": [14, 3, 0.5237, 0.001, 3, 0.5, 0.5714, 825, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.display_mode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.display_mode = 'features'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L521_C12", "label": "set_image()", "type": "expression", "loc": [521, 521], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L513_C8", "vector": [8, 3, 0.5247, 0.001, 3, 0.5, 0.7143, 942, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_image", "arg_names": [], "import_names": [], "rhs_call_name": "set_image", "annotation": ""}, "snippet": " self.draw_widget.set_image(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L525_C12", "label": "self.display_mode =", "type": "assigned_variable", "loc": [525, 525], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L513_C8", "vector": [14, 3, 0.5287, 0.001, 3, 0.5, 0.8571, 825, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.display_mode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.display_mode = 'image'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L526_C12", "label": "set_image()", "type": "expression", "loc": [526, 526], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L513_C8", "vector": [8, 3, 0.5297, 0.001, 3, 0.5, 1.0, 942, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_image", "arg_names": [], "import_names": [], "rhs_call_name": "set_image", "annotation": ""}, "snippet": " self.draw_widget.set_image(self.scans_database.get_path() + '/' + self.current_dataset.image_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L529_C4", "label": "slot_display_labels", "type": "function", "loc": [529, 543], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.5398, 0.0151, 1, 0.45, 0.4878, 562, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "slot_display_labels", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_display_labels(self):\n if self.display_mode != 'labels':\n if False == self.processor:\n self.processor = processor.processor(self.config)\n \n self.processor.load_data(self.current_dataset.id)\n self.processor.process_labels(self.display_3d_type)\n filename = self.processor.save_labels_image(self.display_3d_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L530_C8", "label": "if", "type": "if", "loc": [530, 543], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L529_C4", "vector": [4, 2, 0.5403, 0.0141, 2, 0.13, 0.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.display_mode != 'labels':\n if False == self.processor:\n self.processor = processor.processor(self.config)\n \n self.processor.load_data(self.current_dataset.id)\n self.processor.process_labels(self.display_3d_type)\n filename = self.processor.save_labels_image(self.display_3d_type)\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L531_C12", "label": "if", "type": "if", "loc": [531, 532], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L530_C8", "vector": [4, 3, 0.5352, 0.002, 3, 0.76, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False == self.processor:\n self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L532_C16", "label": "self.processor = processor()", "type": "assigned_variable", "loc": [532, 532], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L531_C12", "vector": [14, 4, 0.5358, 0.001, 4, 0.4, 0.0, 855, 3, 1, 0, 0, 177, 10, 1], "semantic": {"name": "self.processor", "arg_names": [], "import_names": [], "rhs_call_name": "processor", "annotation": ""}, "snippet": " self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L534_C12", "label": "load_data()", "type": "expression", "loc": [534, 534], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L530_C8", "vector": [8, 3, 0.5378, 0.001, 3, 0.76, 0.1429, 477, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_data", "arg_names": [], "import_names": [], "rhs_call_name": "load_data", "annotation": ""}, "snippet": " self.processor.load_data(self.current_dataset.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L535_C12", "label": "process_labels()", "type": "expression", "loc": [535, 535], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L530_C8", "vector": [8, 3, 0.5388, 0.001, 3, 0.76, 0.2857, 909, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "process_labels", "arg_names": [], "import_names": [], "rhs_call_name": "process_labels", "annotation": ""}, "snippet": " self.processor.process_labels(self.display_3d_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L536_C12", "label": "filename = save_labels_image()", "type": "assigned_variable", "loc": [536, 536], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L530_C8", "vector": [14, 3, 0.5398, 0.001, 3, 0.76, 0.4286, 275, 3, 1, 0, 0, 915, 10, 1], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "save_labels_image", "annotation": ""}, "snippet": " filename = self.processor.save_labels_image(self.display_3d_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L538_C12", "label": "set_image()", "type": "expression", "loc": [538, 538], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L530_C8", "vector": [8, 3, 0.5418, 0.001, 3, 0.76, 0.5714, 942, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_image", "arg_names": [], "import_names": [], "rhs_call_name": "set_image", "annotation": ""}, "snippet": " self.draw_widget.set_image(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L539_C12", "label": "self.display_mode =", "type": "assigned_variable", "loc": [539, 539], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L530_C8", "vector": [14, 3, 0.5428, 0.001, 3, 0.76, 0.7143, 825, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.display_mode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.display_mode = 'labels'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L542_C12", "label": "set_image()", "type": "expression", "loc": [542, 542], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L530_C8", "vector": [8, 3, 0.5458, 0.001, 3, 0.76, 0.8571, 942, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_image", "arg_names": [], "import_names": [], "rhs_call_name": "set_image", "annotation": ""}, "snippet": " self.draw_widget.set_image(self.scans_database.get_path() + '/' + self.current_dataset.image_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L543_C12", "label": "self.display_mode =", "type": "assigned_variable", "loc": [543, 543], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L530_C8", "vector": [14, 3, 0.5468, 0.001, 3, 0.76, 1.0, 825, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.display_mode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.display_mode = 'image' "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L545_C4", "label": "slot_display_stats", "type": "function", "loc": [545, 550], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.5514, 0.006, 1, 0.45, 0.5122, 397, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "slot_display_stats", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_display_stats(self):\n if False == self.processor:\n self.processor = processor.processor(self.config)\n \n self.processor.load_data(self.current_dataset.id)\n self.processor.display_stats()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L546_C8", "label": "if", "type": "if", "loc": [546, 547], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L545_C4", "vector": [4, 2, 0.5504, 0.002, 2, 0.83, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False == self.processor:\n self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L547_C12", "label": "self.processor = processor()", "type": "assigned_variable", "loc": [547, 547], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L546_C8", "vector": [14, 3, 0.5509, 0.001, 3, 0.82, 0.0, 855, 3, 1, 0, 0, 177, 10, 1], "semantic": {"name": "self.processor", "arg_names": [], "import_names": [], "rhs_call_name": "processor", "annotation": ""}, "snippet": " self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L549_C8", "label": "load_data()", "type": "expression", "loc": [549, 549], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L545_C4", "vector": [8, 2, 0.5529, 0.001, 2, 0.83, 0.5, 477, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_data", "arg_names": [], "import_names": [], "rhs_call_name": "load_data", "annotation": ""}, "snippet": " self.processor.load_data(self.current_dataset.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L550_C8", "label": "display_stats()", "type": "expression", "loc": [550, 550], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L545_C4", "vector": [8, 2, 0.5539, 0.001, 2, 0.83, 1.0, 985, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "display_stats", "arg_names": [], "import_names": [], "rhs_call_name": "display_stats", "annotation": ""}, "snippet": " self.processor.display_stats()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L552_C4", "label": "slot_display_global_stats", "type": "function", "loc": [552, 557], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.5584, 0.006, 1, 0.45, 0.5366, 674, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "slot_display_global_stats", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_display_global_stats(self):\n if False == self.processor:\n self.processor = processor.processor(self.config)\n \n self.processor.load_data(self.current_dataset.id)\n self.processor.display_stats(True) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L553_C8", "label": "if", "type": "if", "loc": [553, 554], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L552_C4", "vector": [4, 2, 0.5574, 0.002, 2, 0.97, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False == self.processor:\n self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L554_C12", "label": "self.processor = processor()", "type": "assigned_variable", "loc": [554, 554], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L553_C8", "vector": [14, 3, 0.5579, 0.001, 3, 0.26, 0.0, 855, 3, 1, 0, 0, 177, 10, 1], "semantic": {"name": "self.processor", "arg_names": [], "import_names": [], "rhs_call_name": "processor", "annotation": ""}, "snippet": " self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L556_C8", "label": "load_data()", "type": "expression", "loc": [556, 556], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L552_C4", "vector": [8, 2, 0.5599, 0.001, 2, 0.97, 0.5, 477, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_data", "arg_names": [], "import_names": [], "rhs_call_name": "load_data", "annotation": ""}, "snippet": " self.processor.load_data(self.current_dataset.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L557_C8", "label": "display_stats()", "type": "expression", "loc": [557, 557], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L552_C4", "vector": [8, 2, 0.5609, 0.001, 2, 0.97, 1.0, 985, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "display_stats", "arg_names": [], "import_names": [], "rhs_call_name": "display_stats", "annotation": ""}, "snippet": " self.processor.display_stats(True) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L560_C4", "label": "slot_display_3d_spheres", "type": "function", "loc": [560, 561], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.5645, 0.002, 1, 0.45, 0.561, 952, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "slot_display_3d_spheres", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_display_3d_spheres(self): \n self.slot_display_3d(True) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L561_C8", "label": "slot_display_3d()", "type": "expression", "loc": [561, 561], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L560_C4", "vector": [8, 2, 0.565, 0.001, 2, 0.9, 0.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "slot_display_3d", "arg_names": [], "import_names": [], "rhs_call_name": "slot_display_3d", "annotation": ""}, "snippet": " self.slot_display_3d(True) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L563_C4", "label": "slot_display_3d", "type": "function", "loc": [563, 575], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.573, 0.0131, 1, 0.45, 0.5854, 241, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "slot_display_3d", "arg_names": ["self", "spheres"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_display_3d(self, spheres = False):\n\n if False == self.processor: \n self.processor = processor.processor(self.config)\n \n #save data first so the processor can load it:\n self.slot_save() \n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L565_C8", "label": "if", "type": "if", "loc": [565, 566], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L563_C4", "vector": [4, 2, 0.5695, 0.002, 2, 0.24, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False == self.processor: \n self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L566_C12", "label": "self.processor = processor()", "type": "assigned_variable", "loc": [566, 566], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L565_C8", "vector": [14, 3, 0.57, 0.001, 3, 0.23, 0.0, 855, 3, 1, 0, 0, 177, 10, 1], "semantic": {"name": "self.processor", "arg_names": [], "import_names": [], "rhs_call_name": "processor", "annotation": ""}, "snippet": " self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L569_C8", "label": "slot_save()", "type": "expression", "loc": [569, 569], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L563_C4", "vector": [8, 2, 0.573, 0.001, 2, 0.24, 0.25, 522, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "slot_save", "arg_names": [], "import_names": [], "rhs_call_name": "slot_save", "annotation": ""}, "snippet": " self.slot_save() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L571_C8", "label": "load_data()", "type": "expression", "loc": [571, 571], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L563_C4", "vector": [8, 2, 0.575, 0.001, 2, 0.24, 0.5, 477, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_data", "arg_names": [], "import_names": [], "rhs_call_name": "load_data", "annotation": ""}, "snippet": " self.processor.load_data(self.current_dataset.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L573_C8", "label": "process_raw_data()", "type": "expression", "loc": [573, 573], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L563_C4", "vector": [8, 2, 0.577, 0.001, 2, 0.24, 0.75, 553, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "process_raw_data", "arg_names": [], "import_names": [], "rhs_call_name": "process_raw_data", "annotation": ""}, "snippet": " self.processor.process_raw_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L575_C8", "label": "display_3d()", "type": "expression", "loc": [575, 575], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L563_C4", "vector": [8, 2, 0.5791, 0.001, 2, 0.24, 1.0, 989, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "display_3d", "arg_names": [], "import_names": [], "rhs_call_name": "display_3d", "annotation": ""}, "snippet": " self.processor.display_3d(self.display_3d_type, spheres)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L577_C4", "label": "slot_train_and_save_Classifiers", "type": "function", "loc": [577, 586], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.5856, 0.0101, 1, 0.45, 0.6098, 348, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "slot_train_and_save_Classifiers", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_train_and_save_Classifiers(self):\n\n if False == self.processor: \n self.processor = processor.processor(self.config)\n \n #save data first so the processor can load it:\n self.slot_save() \n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L579_C8", "label": "if", "type": "if", "loc": [579, 580], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L577_C4", "vector": [4, 2, 0.5836, 0.002, 2, 0.64, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False == self.processor: \n self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L580_C12", "label": "self.processor = processor()", "type": "assigned_variable", "loc": [580, 580], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L579_C8", "vector": [14, 3, 0.5841, 0.001, 3, 0.8, 0.0, 855, 3, 1, 0, 0, 177, 10, 1], "semantic": {"name": "self.processor", "arg_names": [], "import_names": [], "rhs_call_name": "processor", "annotation": ""}, "snippet": " self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L583_C8", "label": "slot_save()", "type": "expression", "loc": [583, 583], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L577_C4", "vector": [8, 2, 0.5871, 0.001, 2, 0.64, 0.3333, 522, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "slot_save", "arg_names": [], "import_names": [], "rhs_call_name": "slot_save", "annotation": ""}, "snippet": " self.slot_save() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L585_C8", "label": "load_data()", "type": "expression", "loc": [585, 585], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L577_C4", "vector": [8, 2, 0.5891, 0.001, 2, 0.64, 0.6667, 477, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_data", "arg_names": [], "import_names": [], "rhs_call_name": "load_data", "annotation": ""}, "snippet": " self.processor.load_data(self.current_dataset.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L586_C8", "label": "train_and_save_Classifiers()", "type": "expression", "loc": [586, 586], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L577_C4", "vector": [8, 2, 0.5901, 0.001, 2, 0.64, 1.0, 169, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "train_and_save_Classifiers", "arg_names": [], "import_names": [], "rhs_call_name": "train_and_save_Classifiers", "annotation": ""}, "snippet": " self.processor.train_and_save_Classifiers() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L588_C4", "label": "slot_generate_save_features", "type": "function", "loc": [588, 597], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.5967, 0.0101, 1, 0.45, 0.6341, 986, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "slot_generate_save_features", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_generate_save_features(self):\n\n if False == self.processor: \n self.processor = processor.processor(self.config)\n \n #save data first so the processor can load it:\n self.slot_save() \n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L590_C8", "label": "if", "type": "if", "loc": [590, 591], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L588_C4", "vector": [4, 2, 0.5947, 0.002, 2, 0.03, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False == self.processor: \n self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L591_C12", "label": "self.processor = processor()", "type": "assigned_variable", "loc": [591, 591], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L590_C8", "vector": [14, 3, 0.5952, 0.001, 3, 0.03, 0.0, 855, 3, 1, 0, 0, 177, 10, 1], "semantic": {"name": "self.processor", "arg_names": [], "import_names": [], "rhs_call_name": "processor", "annotation": ""}, "snippet": " self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L594_C8", "label": "slot_save()", "type": "expression", "loc": [594, 594], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L588_C4", "vector": [8, 2, 0.5982, 0.001, 2, 0.03, 0.3333, 522, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "slot_save", "arg_names": [], "import_names": [], "rhs_call_name": "slot_save", "annotation": ""}, "snippet": " self.slot_save() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L596_C8", "label": "load_data()", "type": "expression", "loc": [596, 596], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L588_C4", "vector": [8, 2, 0.6002, 0.001, 2, 0.03, 0.6667, 477, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_data", "arg_names": [], "import_names": [], "rhs_call_name": "load_data", "annotation": ""}, "snippet": " self.processor.load_data(self.current_dataset.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L597_C8", "label": "generate_save_features()", "type": "expression", "loc": [597, 597], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L588_C4", "vector": [8, 2, 0.6012, 0.001, 2, 0.03, 1.0, 994, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "generate_save_features", "arg_names": [], "import_names": [], "rhs_call_name": "generate_save_features", "annotation": ""}, "snippet": " self.processor.generate_save_features() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L600_C4", "label": "slot_test_Classifiers", "type": "function", "loc": [600, 606], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.6073, 0.007, 1, 0.45, 0.6585, 575, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "slot_test_Classifiers", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_test_Classifiers(self):\n if False == self.processor: \n self.processor = processor.processor(self.config)\n self.slot_save() #save data first so the processor can load it:\n self.processor.load_data(self.current_dataset.id)\n self.processor.train_and_save_Classifiers()\n self.processor.test_Classifiers() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L601_C8", "label": "if", "type": "if", "loc": [601, 602], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L600_C4", "vector": [4, 2, 0.6057, 0.002, 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 False == self.processor: \n self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L602_C12", "label": "self.processor = processor()", "type": "assigned_variable", "loc": [602, 602], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L601_C8", "vector": [14, 3, 0.6062, 0.001, 3, 0.97, 0.0, 855, 3, 1, 0, 0, 177, 10, 1], "semantic": {"name": "self.processor", "arg_names": [], "import_names": [], "rhs_call_name": "processor", "annotation": ""}, "snippet": " self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L603_C8", "label": "slot_save()", "type": "expression", "loc": [603, 603], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L600_C4", "vector": [8, 2, 0.6073, 0.001, 2, 0.5, 0.25, 522, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "slot_save", "arg_names": [], "import_names": [], "rhs_call_name": "slot_save", "annotation": ""}, "snippet": " self.slot_save() #save data first so the processor can load it:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L604_C8", "label": "load_data()", "type": "expression", "loc": [604, 604], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L600_C4", "vector": [8, 2, 0.6083, 0.001, 2, 0.5, 0.5, 477, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_data", "arg_names": [], "import_names": [], "rhs_call_name": "load_data", "annotation": ""}, "snippet": " self.processor.load_data(self.current_dataset.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L605_C8", "label": "train_and_save_Classifiers()", "type": "expression", "loc": [605, 605], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L600_C4", "vector": [8, 2, 0.6093, 0.001, 2, 0.5, 0.75, 169, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "train_and_save_Classifiers", "arg_names": [], "import_names": [], "rhs_call_name": "train_and_save_Classifiers", "annotation": ""}, "snippet": " self.processor.train_and_save_Classifiers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L606_C8", "label": "test_Classifiers()", "type": "expression", "loc": [606, 606], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L600_C4", "vector": [8, 2, 0.6103, 0.001, 2, 0.5, 1.0, 794, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "test_Classifiers", "arg_names": [], "import_names": [], "rhs_call_name": "test_Classifiers", "annotation": ""}, "snippet": " self.processor.test_Classifiers() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L608_C4", "label": "slot_test_Classifiers_on_testset", "type": "function", "loc": [608, 614], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.6153, 0.007, 1, 0.45, 0.6829, 443, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "slot_test_Classifiers_on_testset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_test_Classifiers_on_testset(self):\n if False == self.processor: \n self.processor = processor.processor(self.config)\n self.slot_save() #save data first so the processor can load it:\n self.processor.load_data(self.current_dataset.id)\n self.processor.train_and_save_Classifiers()\n self.processor.test_classifiers_on_testset() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L609_C8", "label": "if", "type": "if", "loc": [609, 610], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L608_C4", "vector": [4, 2, 0.6138, 0.002, 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 False == self.processor: \n self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L610_C12", "label": "self.processor = processor()", "type": "assigned_variable", "loc": [610, 610], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L609_C8", "vector": [14, 3, 0.6143, 0.001, 3, 0.17, 0.0, 855, 3, 1, 0, 0, 177, 10, 1], "semantic": {"name": "self.processor", "arg_names": [], "import_names": [], "rhs_call_name": "processor", "annotation": ""}, "snippet": " self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L611_C8", "label": "slot_save()", "type": "expression", "loc": [611, 611], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L608_C4", "vector": [8, 2, 0.6153, 0.001, 2, 0.82, 0.25, 522, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "slot_save", "arg_names": [], "import_names": [], "rhs_call_name": "slot_save", "annotation": ""}, "snippet": " self.slot_save() #save data first so the processor can load it:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L612_C8", "label": "load_data()", "type": "expression", "loc": [612, 612], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L608_C4", "vector": [8, 2, 0.6163, 0.001, 2, 0.82, 0.5, 477, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_data", "arg_names": [], "import_names": [], "rhs_call_name": "load_data", "annotation": ""}, "snippet": " self.processor.load_data(self.current_dataset.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L613_C8", "label": "train_and_save_Classifiers()", "type": "expression", "loc": [613, 613], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L608_C4", "vector": [8, 2, 0.6173, 0.001, 2, 0.82, 0.75, 169, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "train_and_save_Classifiers", "arg_names": [], "import_names": [], "rhs_call_name": "train_and_save_Classifiers", "annotation": ""}, "snippet": " self.processor.train_and_save_Classifiers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L614_C8", "label": "test_classifiers_on_testset()", "type": "expression", "loc": [614, 614], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L608_C4", "vector": [8, 2, 0.6183, 0.001, 2, 0.82, 1.0, 38, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "test_classifiers_on_testset", "arg_names": [], "import_names": [], "rhs_call_name": "test_classifiers_on_testset", "annotation": ""}, "snippet": " self.processor.test_classifiers_on_testset() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L616_C4", "label": "slot_load_Classifiers", "type": "function", "loc": [616, 619], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.6219, 0.004, 1, 0.45, 0.7073, 736, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "slot_load_Classifiers", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_load_Classifiers(self):\n if False == self.processor: \n self.processor = processor.processor(self.config)\n self.processor.load_Classifiers() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L617_C8", "label": "if", "type": "if", "loc": [617, 618], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L616_C4", "vector": [4, 2, 0.6219, 0.002, 2, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False == self.processor: \n self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L618_C12", "label": "self.processor = processor()", "type": "assigned_variable", "loc": [618, 618], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L617_C8", "vector": [14, 3, 0.6224, 0.001, 3, 0.13, 0.0, 855, 3, 1, 0, 0, 177, 10, 1], "semantic": {"name": "self.processor", "arg_names": [], "import_names": [], "rhs_call_name": "processor", "annotation": ""}, "snippet": " self.processor = processor.processor(self.config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L619_C8", "label": "load_Classifiers()", "type": "expression", "loc": [619, 619], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L616_C4", "vector": [8, 2, 0.6234, 0.001, 2, 0.85, 1.0, 173, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load_Classifiers", "arg_names": [], "import_names": [], "rhs_call_name": "load_Classifiers", "annotation": ""}, "snippet": " self.processor.load_Classifiers() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L621_C4", "label": "slot_save_Classifier", "type": "function", "loc": [621, 625], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.6274, 0.005, 1, 0.45, 0.7317, 238, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "slot_save_Classifier", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_save_Classifier(self):\n if False == self.processor: \n print('ERROR: no processor object exists -> no Classifier to save!')\n return\n self.processor.save_Classifier() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L622_C8", "label": "if", "type": "if", "loc": [622, 624], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L621_C4", "vector": [4, 2, 0.6274, 0.003, 2, 0.98, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False == self.processor: \n print('ERROR: no processor object exists -> no Classifier to save!')\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L623_C12", "label": "print()", "type": "expression", "loc": [623, 623], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L622_C8", "vector": [8, 3, 0.6274, 0.001, 3, 0.22, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('ERROR: no processor object exists -> no Classifier to save!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L624_C12", "label": "return", "type": "return", "loc": [624, 624], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L622_C8", "vector": [13, 3, 0.6284, 0.001, 3, 0.22, 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_99713:Expr_L625_C8", "label": "save_Classifier()", "type": "expression", "loc": [625, 625], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L621_C4", "vector": [8, 2, 0.6294, 0.001, 2, 0.98, 1.0, 329, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "save_Classifier", "arg_names": [], "import_names": [], "rhs_call_name": "save_Classifier", "annotation": ""}, "snippet": " self.processor.save_Classifier() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "label": "add_polygon_combobox", "type": "function", "loc": [627, 641], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.6385, 0.0151, 1, 0.45, 0.7561, 59, 0, 1, 0, 0, 0, 0, 21], "semantic": {"name": "add_polygon_combobox", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_polygon_combobox(self):\n combobox = QtGui.QComboBox()\n combobox.addItem(\"Object\", QtCore.QVariant(\"object\"))\n combobox.addItem(\"Surface\", QtCore.QVariant(\"surface\"))\n combobox.addItem(\"Region of Interest (ROI)\", QtCore.QVariant(\"roi\"))\n combobox.addItem(\"Background\", QtCore.QVariant(\"background\"))\n combobox.addItem(\"Visible Surface-Edge\", QtCore.QVariant(\"edge\"))\n combobox.addItem(\"Wall-Surface-Edge\", QtCore.QVariant(\"edge_up\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L628_C8", "label": "combobox = QComboBox()", "type": "assigned_variable", "loc": [628, 628], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "vector": [14, 2, 0.6324, 0.001, 2, 0.59, 0.0, 460, 3, 0, 0, 0, 556, 10, 1], "semantic": {"name": "combobox", "arg_names": [], "import_names": [], "rhs_call_name": "QComboBox", "annotation": ""}, "snippet": " combobox = QtGui.QComboBox()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L629_C8", "label": "addItem()", "type": "expression", "loc": [629, 629], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "vector": [8, 2, 0.6334, 0.001, 2, 0.59, 0.0833, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"Object\", QtCore.QVariant(\"object\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L630_C8", "label": "addItem()", "type": "expression", "loc": [630, 630], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "vector": [8, 2, 0.6344, 0.001, 2, 0.59, 0.1667, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"Surface\", QtCore.QVariant(\"surface\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L631_C8", "label": "addItem()", "type": "expression", "loc": [631, 631], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "vector": [8, 2, 0.6354, 0.001, 2, 0.59, 0.25, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"Region of Interest (ROI)\", QtCore.QVariant(\"roi\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L632_C8", "label": "addItem()", "type": "expression", "loc": [632, 632], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "vector": [8, 2, 0.6365, 0.001, 2, 0.59, 0.3333, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"Background\", QtCore.QVariant(\"background\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L633_C8", "label": "addItem()", "type": "expression", "loc": [633, 633], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "vector": [8, 2, 0.6375, 0.001, 2, 0.59, 0.4167, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"Visible Surface-Edge\", QtCore.QVariant(\"edge\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L634_C8", "label": "addItem()", "type": "expression", "loc": [634, 634], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "vector": [8, 2, 0.6385, 0.001, 2, 0.59, 0.5, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"Wall-Surface-Edge\", QtCore.QVariant(\"edge_up\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L635_C8", "label": "addItem()", "type": "expression", "loc": [635, 635], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "vector": [8, 2, 0.6395, 0.001, 2, 0.59, 0.5833, 670, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " combobox.addItem(\"Downward-Surface-Edge\", QtCore.QVariant(\"edge_down\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L636_C8", "label": "setCurrentIndex()", "type": "expression", "loc": [636, 636], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "vector": [8, 2, 0.6405, 0.001, 2, 0.59, 0.6667, 142, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setCurrentIndex", "arg_names": [], "import_names": [], "rhs_call_name": "setCurrentIndex", "annotation": ""}, "snippet": " combobox.setCurrentIndex(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L638_C8", "label": "connect()", "type": "expression", "loc": [638, 638], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "vector": [8, 2, 0.6425, 0.001, 2, 0.59, 0.75, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect(combobox, QtCore.SIGNAL('currentIndexChanged(int)'), self.slot_update_polygon_labels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L639_C8", "label": "append()", "type": "expression", "loc": [639, 639], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "vector": [8, 2, 0.6435, 0.001, 2, 0.59, 0.8333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.polygon_comboboxes.append(combobox)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L640_C8", "label": "addWidget()", "type": "expression", "loc": [640, 640], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "vector": [8, 2, 0.6445, 0.001, 2, 0.59, 0.9167, 653, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " self.right_layout.addWidget(combobox, QtCore.Qt.AlignTop)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L641_C8", "label": "slot_update_polygon_labels()", "type": "expression", "loc": [641, 641], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "vector": [8, 2, 0.6455, 0.001, 2, 0.59, 1.0, 63, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "slot_update_polygon_labels", "arg_names": [], "import_names": [], "rhs_call_name": "slot_update_polygon_labels", "annotation": ""}, "snippet": " self.slot_update_polygon_labels()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L644_C4", "label": "slot_delete", "type": "function", "loc": [644, 655], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.6541, 0.0121, 1, 0.45, 0.7805, 588, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "slot_delete", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_delete(self):\n #delete scan-files:\n if os.path.isfile(self.current_dataset.scan_filename):\n os.remove(self.path + '/' + self.current_dataset.scan_filename);\n if os.path.isfile(self.current_dataset.image_filename):\n os.remove(self.path + '/' + self.current_dataset.image_filename);\n if os.path.isfile(self.current_dataset.image_artag_filename):\n os.remove(self.path + '/' + self.current_dataset.image_artag_filename); "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L646_C8", "label": "if", "type": "if", "loc": [646, 647], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L644_C4", "vector": [4, 2, 0.6511, 0.002, 2, 0.79, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.isfile(self.current_dataset.scan_filename):\n os.remove(self.path + '/' + self.current_dataset.scan_filename);"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L647_C12", "label": "remove()", "type": "expression", "loc": [647, 647], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L646_C8", "vector": [8, 3, 0.6516, 0.001, 3, 0.93, 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(self.path + '/' + self.current_dataset.scan_filename);"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L648_C8", "label": "if", "type": "if", "loc": [648, 649], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L644_C4", "vector": [4, 2, 0.6531, 0.002, 2, 0.79, 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(self.current_dataset.image_filename):\n os.remove(self.path + '/' + self.current_dataset.image_filename);"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L649_C12", "label": "remove()", "type": "expression", "loc": [649, 649], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L648_C8", "vector": [8, 3, 0.6536, 0.001, 3, 0.79, 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(self.path + '/' + self.current_dataset.image_filename);"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L650_C8", "label": "if", "type": "if", "loc": [650, 651], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L644_C4", "vector": [4, 2, 0.6551, 0.002, 2, 0.79, 0.4, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.isfile(self.current_dataset.image_artag_filename):\n os.remove(self.path + '/' + self.current_dataset.image_artag_filename); "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L651_C12", "label": "remove()", "type": "expression", "loc": [651, 651], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L650_C8", "vector": [8, 3, 0.6556, 0.001, 3, 0.18, 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(self.path + '/' + self.current_dataset.image_artag_filename); "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L653_C8", "label": "self.current_dataset = delete_current_dataset()", "type": "assigned_variable", "loc": [653, 653], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L644_C4", "vector": [14, 2, 0.6576, 0.001, 2, 0.79, 0.6, 782, 3, 0, 0, 0, 145, 10, 1], "semantic": {"name": "self.current_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "delete_current_dataset", "annotation": ""}, "snippet": " self.current_dataset = self.scans_database.delete_current_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L654_C8", "label": "load_values_from_dataset()", "type": "expression", "loc": [654, 654], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L644_C4", "vector": [8, 2, 0.6586, 0.001, 2, 0.79, 0.8, 632, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load_values_from_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "load_values_from_dataset", "annotation": ""}, "snippet": " self.load_values_from_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L655_C8", "label": "slot_save()", "type": "expression", "loc": [655, 655], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L644_C4", "vector": [8, 2, 0.6596, 0.001, 2, 0.79, 1.0, 522, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "slot_save", "arg_names": [], "import_names": [], "rhs_call_name": "slot_save", "annotation": ""}, "snippet": " self.slot_save() #save for consistency with files"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L657_C4", "label": "slot_save", "type": "function", "loc": [657, 662], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.6641, 0.006, 1, 0.45, 0.8049, 522, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "slot_save", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_save(self):\n dumpObj(self.current_dataset)\n #for poly in self.draw_widget.get_polygons():\n # dumpObj(poly)\n #self.slot_update_polygons(self.draw_widget.get_polygons(), 1)\n self.scans_database.save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L658_C8", "label": "dumpObj()", "type": "expression", "loc": [658, 658], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L657_C4", "vector": [8, 2, 0.6626, 0.001, 2, 0.11, 0.0, 903, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "dumpObj", "arg_names": [], "import_names": [], "rhs_call_name": "dumpObj", "annotation": ""}, "snippet": " dumpObj(self.current_dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L662_C8", "label": "save()", "type": "expression", "loc": [662, 662], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L657_C4", "vector": [8, 2, 0.6667, 0.001, 2, 0.11, 1.0, 928, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "save", "arg_names": [], "import_names": [], "rhs_call_name": "save", "annotation": ""}, "snippet": " self.scans_database.save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L664_C4", "label": "slot_update_surface_type", "type": "function", "loc": [664, 668], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.6707, 0.005, 1, 0.45, 0.8293, 416, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "slot_update_surface_type", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_update_surface_type(self):\n if True == self.init_in_progress:\n return \n box = self.surface_type_combobox\n self.current_dataset.surface_type = str(box.itemData(box.currentIndex()).toString())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L665_C8", "label": "if", "type": "if", "loc": [665, 666], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L664_C4", "vector": [4, 2, 0.6702, 0.002, 2, 0.86, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if True == self.init_in_progress:\n return "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L666_C12", "label": "return", "type": "return", "loc": [666, 666], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L665_C8", "vector": [13, 3, 0.6707, 0.001, 3, 0.82, 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_99713:Assign_L667_C8", "label": "box =", "type": "assigned_variable", "loc": [667, 667], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L664_C4", "vector": [14, 2, 0.6717, 0.001, 2, 0.86, 0.5, 918, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "box", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " box = self.surface_type_combobox"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L668_C8", "label": "self.current_dataset.surface_type = str()", "type": "assigned_variable", "loc": [668, 668], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L664_C4", "vector": [14, 2, 0.6727, 0.001, 2, 0.86, 1.0, 52, 3, 1, 0, 0, 52, 10, 4], "semantic": {"name": "self.current_dataset.surface_type", "arg_names": [], "import_names": [], "rhs_call_name": "str", "annotation": ""}, "snippet": " self.current_dataset.surface_type = str(box.itemData(box.currentIndex()).toString())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L670_C4", "label": "slot_update_display_3d_type", "type": "function", "loc": [670, 674], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.6767, 0.005, 1, 0.45, 0.8537, 7, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "slot_update_display_3d_type", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_update_display_3d_type(self):\n if True == self.init_in_progress:\n return \n box = self.display_3d_type_combobox\n self.display_3d_type = str(box.itemData(box.currentIndex()).toString()) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L671_C8", "label": "if", "type": "if", "loc": [671, 672], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L670_C4", "vector": [4, 2, 0.6762, 0.002, 2, 0.68, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if True == self.init_in_progress:\n return "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L672_C12", "label": "return", "type": "return", "loc": [672, 672], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L671_C8", "vector": [13, 3, 0.6767, 0.001, 3, 0.16, 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_99713:Assign_L673_C8", "label": "box =", "type": "assigned_variable", "loc": [673, 673], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L670_C4", "vector": [14, 2, 0.6777, 0.001, 2, 0.68, 0.5, 918, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "box", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " box = self.display_3d_type_combobox"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L674_C8", "label": "self.display_3d_type = str()", "type": "assigned_variable", "loc": [674, 674], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L670_C4", "vector": [14, 2, 0.6788, 0.001, 2, 0.68, 1.0, 745, 3, 1, 0, 0, 52, 10, 4], "semantic": {"name": "self.display_3d_type", "arg_names": [], "import_names": [], "rhs_call_name": "str", "annotation": ""}, "snippet": " self.display_3d_type = str(box.itemData(box.currentIndex()).toString()) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L676_C4", "label": "slot_update_polygon_label", "type": "function", "loc": [676, 684], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.6848, 0.0091, 1, 0.45, 0.878, 181, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "slot_update_polygon_label", "arg_names": ["self", "index", "label"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_update_polygon_label(self, index, label):\n if True == self.init_in_progress:\n return \n \n box = self.polygon_comboboxes[index]\n boxindex = box.findData(QtCore.QVariant(label))\n box.setCurrentIndex(boxindex) \n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L677_C8", "label": "if", "type": "if", "loc": [677, 678], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L676_C4", "vector": [4, 2, 0.6823, 0.002, 2, 0.78, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if True == self.init_in_progress:\n return "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L678_C12", "label": "return", "type": "return", "loc": [678, 678], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L677_C8", "vector": [13, 3, 0.6828, 0.001, 3, 0.6, 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_99713:Assign_L680_C8", "label": "box =", "type": "assigned_variable", "loc": [680, 680], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L676_C4", "vector": [14, 2, 0.6848, 0.001, 2, 0.78, 0.25, 918, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "box", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " box = self.polygon_comboboxes[index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L681_C8", "label": "boxindex = findData()", "type": "assigned_variable", "loc": [681, 681], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L676_C4", "vector": [14, 2, 0.6858, 0.001, 2, 0.78, 0.5, 489, 3, 1, 0, 0, 916, 10, 2], "semantic": {"name": "boxindex", "arg_names": [], "import_names": [], "rhs_call_name": "findData", "annotation": ""}, "snippet": " boxindex = box.findData(QtCore.QVariant(label))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L682_C8", "label": "setCurrentIndex()", "type": "expression", "loc": [682, 682], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L676_C4", "vector": [8, 2, 0.6868, 0.001, 2, 0.78, 0.75, 142, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setCurrentIndex", "arg_names": [], "import_names": [], "rhs_call_name": "setCurrentIndex", "annotation": ""}, "snippet": " box.setCurrentIndex(boxindex) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L684_C8", "label": "update()", "type": "expression", "loc": [684, 684], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L676_C4", "vector": [8, 2, 0.6888, 0.001, 2, 0.78, 1.0, 637, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.draw_widget.update() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L686_C4", "label": "slot_update_polygon_labels", "type": "function", "loc": [686, 695], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.6954, 0.0101, 1, 0.45, 0.9024, 63, 0, 1, 0, 0, 0, 0, 14], "semantic": {"name": "slot_update_polygon_labels", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_update_polygon_labels(self):\n if True == self.init_in_progress:\n return \n \n for index, box in enumerate(self.polygon_comboboxes):\n if index < len(self.current_dataset.polygons):\n self.current_dataset.polygons[index].set_label(str(box.itemData(box.currentIndex()).toString()))\n print(str(index) + \" xx \" + str(box.itemData(box.currentIndex()).toString()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L687_C8", "label": "if", "type": "if", "loc": [687, 688], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L686_C4", "vector": [4, 2, 0.6923, 0.002, 2, 0.16, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if True == self.init_in_progress:\n return "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L688_C12", "label": "return", "type": "return", "loc": [688, 688], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L687_C8", "vector": [13, 3, 0.6928, 0.001, 3, 0.55, 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_99713:For_L690_C8", "label": "for index, box", "type": "for", "loc": [690, 693], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L686_C4", "vector": [6, 2, 0.6964, 0.004, 2, 0.16, 0.5, 860, 3, 0, 0, 0, 0, 0, 13], "semantic": {"name": "index, box", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index, box in enumerate(self.polygon_comboboxes):\n if index < len(self.current_dataset.polygons):\n self.current_dataset.polygons[index].set_label(str(box.itemData(box.currentIndex()).toString()))\n print(str(index) + \" xx \" + str(box.itemData(box.currentIndex()).toString()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L691_C12", "label": "if", "type": "if", "loc": [691, 693], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L690_C8", "vector": [4, 3, 0.6969, 0.003, 3, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if index < len(self.current_dataset.polygons):\n self.current_dataset.polygons[index].set_label(str(box.itemData(box.currentIndex()).toString()))\n print(str(index) + \" xx \" + str(box.itemData(box.currentIndex()).toString()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L692_C16", "label": "set_label()", "type": "expression", "loc": [692, 692], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L691_C12", "vector": [8, 4, 0.6969, 0.001, 4, 0.45, 0.0, 88, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "set_label", "arg_names": [], "import_names": [], "rhs_call_name": "set_label", "annotation": ""}, "snippet": " self.current_dataset.polygons[index].set_label(str(box.itemData(box.currentIndex()).toString()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L693_C16", "label": "print()", "type": "expression", "loc": [693, 693], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L691_C12", "vector": [8, 4, 0.6979, 0.001, 4, 0.45, 1.0, 535, 3, 1, 0, 0, 0, 0, 6], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(str(index) + \" xx \" + str(box.itemData(box.currentIndex()).toString()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L695_C8", "label": "update()", "type": "expression", "loc": [695, 695], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L686_C4", "vector": [8, 2, 0.6999, 0.001, 2, 0.16, 1.0, 637, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.draw_widget.update() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L697_C4", "label": "slot_update_polygons", "type": "function", "loc": [697, 708], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.7075, 0.0121, 1, 0.45, 0.9268, 576, 0, 3, 0, 0, 0, 0, 8], "semantic": {"name": "slot_update_polygons", "arg_names": ["self", "polygons", "current_index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_update_polygons(self, polygons, current_index):\n\n while len(self.polygon_comboboxes) < len(polygons):\n self.add_polygon_combobox()\n\n #self.polygon_comboboxes[self.current_polygon_index].x()\n for index, box in enumerate(self.polygon_comboboxes):\n if index < len(polygons):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:While_L699_C8", "label": "while", "type": "while", "loc": [699, 700], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L697_C4", "vector": [5, 2, 0.7044, 0.002, 2, 0.32, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while len(self.polygon_comboboxes) < len(polygons):\n self.add_polygon_combobox()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L700_C12", "label": "add_polygon_combobox()", "type": "expression", "loc": [700, 700], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:While_L699_C8", "vector": [8, 3, 0.7049, 0.001, 3, 0.84, 0.0, 59, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "add_polygon_combobox", "arg_names": [], "import_names": [], "rhs_call_name": "add_polygon_combobox", "annotation": ""}, "snippet": " self.add_polygon_combobox()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L703_C8", "label": "for index, box", "type": "for", "loc": [703, 707], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L697_C4", "vector": [6, 2, 0.71, 0.005, 2, 0.32, 0.5, 860, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "index, box", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index, box in enumerate(self.polygon_comboboxes):\n if index < len(polygons):\n self.polygon_comboboxes[index].show()\n else:\n self.polygon_comboboxes[index].hide() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L704_C12", "label": "if", "type": "if", "loc": [704, 707], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L703_C8", "vector": [4, 3, 0.7105, 0.004, 3, 0.82, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if index < len(polygons):\n self.polygon_comboboxes[index].show()\n else:\n self.polygon_comboboxes[index].hide() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L705_C16", "label": "show()", "type": "expression", "loc": [705, 705], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L704_C12", "vector": [8, 4, 0.71, 0.001, 4, 0.14, 0.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " self.polygon_comboboxes[index].show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L707_C16", "label": "hide()", "type": "expression", "loc": [707, 707], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L704_C12", "vector": [8, 4, 0.712, 0.001, 4, 0.14, 1.0, 434, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "hide", "arg_names": [], "import_names": [], "rhs_call_name": "hide", "annotation": ""}, "snippet": " self.polygon_comboboxes[index].hide() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L708_C8", "label": "update()", "type": "expression", "loc": [708, 708], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L697_C4", "vector": [8, 2, 0.713, 0.001, 2, 0.32, 1.0, 637, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.update()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L710_C4", "label": "paintEvent", "type": "function", "loc": [710, 721], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.7205, 0.0121, 1, 0.45, 0.9512, 838, 0, 2, 0, 0, 0, 0, 12], "semantic": {"name": "paintEvent", "arg_names": ["self", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def paintEvent(self, event):\n painter = QtGui.QPainter()\n painter.begin(self)\n \n x = self.polygon_comboboxes[self.draw_widget.get_current_polygon_index()].x() \n y = self.polygon_comboboxes[self.draw_widget.get_current_polygon_index()].y() \n color = QtGui.QColor(255,0,0)\n painter.setPen(color)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L711_C8", "label": "painter = QPainter()", "type": "assigned_variable", "loc": [711, 711], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L710_C4", "vector": [14, 2, 0.716, 0.001, 2, 0.65, 0.0, 481, 3, 0, 0, 0, 972, 10, 1], "semantic": {"name": "painter", "arg_names": [], "import_names": [], "rhs_call_name": "QPainter", "annotation": ""}, "snippet": " painter = QtGui.QPainter()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L712_C8", "label": "begin()", "type": "expression", "loc": [712, 712], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L710_C4", "vector": [8, 2, 0.717, 0.001, 2, 0.65, 0.125, 969, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "begin", "arg_names": [], "import_names": [], "rhs_call_name": "begin", "annotation": ""}, "snippet": " painter.begin(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L714_C8", "label": "x = x()", "type": "assigned_variable", "loc": [714, 714], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L710_C4", "vector": [14, 2, 0.719, 0.001, 2, 0.65, 0.25, 190, 3, 0, 0, 0, 190, 10, 2], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "x", "annotation": ""}, "snippet": " x = self.polygon_comboboxes[self.draw_widget.get_current_polygon_index()].x() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L715_C8", "label": "y = y()", "type": "assigned_variable", "loc": [715, 715], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L710_C4", "vector": [14, 2, 0.72, 0.001, 2, 0.65, 0.375, 304, 3, 0, 0, 0, 304, 10, 2], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "y", "annotation": ""}, "snippet": " y = self.polygon_comboboxes[self.draw_widget.get_current_polygon_index()].y() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L716_C8", "label": "color = QColor()", "type": "assigned_variable", "loc": [716, 716], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L710_C4", "vector": [14, 2, 0.721, 0.001, 2, 0.65, 0.5, 776, 3, 3, 0, 0, 787, 10, 1], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "QColor", "annotation": ""}, "snippet": " color = QtGui.QColor(255,0,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L717_C8", "label": "setPen()", "type": "expression", "loc": [717, 717], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L710_C4", "vector": [8, 2, 0.7221, 0.001, 2, 0.65, 0.625, 129, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setPen", "arg_names": [], "import_names": [], "rhs_call_name": "setPen", "annotation": ""}, "snippet": " painter.setPen(color)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L718_C8", "label": "setBrush()", "type": "expression", "loc": [718, 718], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L710_C4", "vector": [8, 2, 0.7231, 0.001, 2, 0.65, 0.75, 254, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " painter.setBrush(color)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L719_C8", "label": "drawEllipse()", "type": "expression", "loc": [719, 719], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L710_C4", "vector": [8, 2, 0.7241, 0.001, 2, 0.65, 0.875, 708, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "drawEllipse", "arg_names": [], "import_names": [], "rhs_call_name": "drawEllipse", "annotation": ""}, "snippet": " painter.drawEllipse(QtCore.QRectF(x-8,y+8,6,6))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L721_C8", "label": "end()", "type": "expression", "loc": [721, 721], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L710_C4", "vector": [8, 2, 0.7261, 0.001, 2, 0.65, 1.0, 128, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "end", "annotation": ""}, "snippet": " painter.end()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L723_C4", "label": "get_display_mode", "type": "function", "loc": [723, 724], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.7286, 0.002, 1, 0.45, 0.9756, 57, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_display_mode", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_display_mode(self):\n return self.display_mode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L724_C8", "label": "return", "type": "return", "loc": [724, 724], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L723_C4", "vector": [13, 2, 0.7291, 0.001, 2, 0.74, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.display_mode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L726_C4", "label": "slot_define_ground_plane", "type": "function", "loc": [726, 729], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "vector": [2, 1, 0.7326, 0.004, 1, 0.45, 1.0, 338, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "slot_define_ground_plane", "arg_names": ["self", "ground_plane_points"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def slot_define_ground_plane(self, ground_plane_points):\n #assumes that intensity image is loaded in processor!\n (self.current_dataset.ground_plane_normal, self.current_dataset.ground_plane_three_points) = self.processor.get_3d_plane_normal(ground_plane_points)\n self.slot_display_intensity() #switch back to image mode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L728_C8", "label": " = get_3d_plane_normal()", "type": "assigned_variable", "loc": [728, 728], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L726_C4", "vector": [14, 2, 0.7331, 0.001, 2, 0.71, 0.0, 0, 3, 1, 0, 0, 679, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "get_3d_plane_normal", "annotation": ""}, "snippet": " (self.current_dataset.ground_plane_normal, self.current_dataset.ground_plane_three_points) = self.processor.get_3d_plane_normal(ground_plane_points)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L729_C8", "label": "slot_display_intensity()", "type": "expression", "loc": [729, 729], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L726_C4", "vector": [8, 2, 0.7341, 0.001, 2, 0.71, 1.0, 844, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "slot_display_intensity", "arg_names": [], "import_names": [], "rhs_call_name": "slot_display_intensity", "annotation": ""}, "snippet": " self.slot_display_intensity() #switch back to image mode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "label": "draw_widget", "type": "class", "loc": [731, 982], "level": 0, "parent": null, "vector": [3, 0, 0.8625, 0.2538, 0, 0.66, 0.9412, 636, 0, 13, 0, 0, 289, 0, 99], "semantic": {"name": "draw_widget", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class draw_widget(QtGui.QLabel):\n \n \n ground_plane_points = []\n \n def __init__(self,polygons, image_filename, parent=None):\n QtGui.QWidget.__init__(self, parent)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L734_C4", "label": "ground_plane_points =", "type": "assigned_variable", "loc": [734, 734], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "vector": [14, 1, 0.7392, 0.001, 1, 0.83, 0.0, 523, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ground_plane_points", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ground_plane_points = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L736_C4", "label": "__init__", "type": "function", "loc": [736, 750], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "vector": [2, 1, 0.7482, 0.0151, 1, 0.83, 0.0769, 555, 0, 4, 0, 0, 0, 0, 7], "semantic": {"name": "__init__", "arg_names": ["self", "polygons", "image_filename", "parent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self,polygons, image_filename, parent=None):\n QtGui.QWidget.__init__(self, parent)\n\n self.scaleFactor = False #init is done later\n\n self.setBackgroundRole(QtGui.QPalette.Base)\n #self.setSizePolicy(QtGui.QSizePolicy.Ignored, QtGui.QSizePolicy.Ignored)\n self.setSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L737_C8", "label": "__init__()", "type": "expression", "loc": [737, 737], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L736_C4", "vector": [8, 2, 0.7422, 0.001, 2, 0.2, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " QtGui.QWidget.__init__(self, parent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L739_C8", "label": "self.scaleFactor =", "type": "assigned_variable", "loc": [739, 739], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L736_C4", "vector": [14, 2, 0.7442, 0.001, 2, 0.2, 0.1429, 603, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.scaleFactor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.scaleFactor = False #init is done later"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L741_C8", "label": "setBackgroundRole()", "type": "expression", "loc": [741, 741], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L736_C4", "vector": [8, 2, 0.7462, 0.001, 2, 0.2, 0.2857, 482, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setBackgroundRole", "arg_names": [], "import_names": [], "rhs_call_name": "setBackgroundRole", "annotation": ""}, "snippet": " self.setBackgroundRole(QtGui.QPalette.Base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L743_C8", "label": "setSizePolicy()", "type": "expression", "loc": [743, 743], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L736_C4", "vector": [8, 2, 0.7482, 0.001, 2, 0.2, 0.4286, 289, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "setSizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "setSizePolicy", "annotation": ""}, "snippet": " self.setSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L744_C8", "label": "setScaledContents()", "type": "expression", "loc": [744, 744], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L736_C4", "vector": [8, 2, 0.7492, 0.001, 2, 0.2, 0.5714, 929, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setScaledContents", "arg_names": [], "import_names": [], "rhs_call_name": "setScaledContents", "annotation": ""}, "snippet": " self.setScaledContents(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L747_C8", "label": "set_polygons()", "type": "expression", "loc": [747, 747], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L736_C4", "vector": [8, 2, 0.7523, 0.001, 2, 0.2, 0.7143, 601, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_polygons", "arg_names": [], "import_names": [], "rhs_call_name": "set_polygons", "annotation": ""}, "snippet": " self.set_polygons(polygons)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L748_C8", "label": "set_image()", "type": "expression", "loc": [748, 748], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L736_C4", "vector": [8, 2, 0.7533, 0.001, 2, 0.2, 0.8571, 942, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_image", "arg_names": [], "import_names": [], "rhs_call_name": "set_image", "annotation": ""}, "snippet": " self.set_image(image_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L750_C8", "label": "setScaleFactor()", "type": "expression", "loc": [750, 750], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L736_C4", "vector": [8, 2, 0.7553, 0.001, 2, 0.2, 1.0, 230, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setScaleFactor", "arg_names": [], "import_names": [], "rhs_call_name": "setScaleFactor", "annotation": ""}, "snippet": " self.setScaleFactor(0.8)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L752_C4", "label": "setScaleFactor", "type": "function", "loc": [752, 754], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "vector": [2, 1, 0.7583, 0.003, 1, 0.83, 0.1538, 230, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "setScaleFactor", "arg_names": ["self", "f"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setScaleFactor(self, f):\n self.scaleFactor = f\n self.updateImageSize()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L753_C8", "label": "self.scaleFactor =", "type": "assigned_variable", "loc": [753, 753], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L752_C4", "vector": [14, 2, 0.7583, 0.001, 2, 0.15, 0.0, 603, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.scaleFactor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.scaleFactor = f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L754_C8", "label": "updateImageSize()", "type": "expression", "loc": [754, 754], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L752_C4", "vector": [8, 2, 0.7593, 0.001, 2, 0.15, 1.0, 15, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "updateImageSize", "arg_names": [], "import_names": [], "rhs_call_name": "updateImageSize", "annotation": ""}, "snippet": " self.updateImageSize()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L756_C4", "label": "updateImageSize", "type": "function", "loc": [756, 770], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "vector": [2, 1, 0.7684, 0.0151, 1, 0.83, 0.2308, 15, 0, 1, 0, 0, 0, 0, 18], "semantic": {"name": "updateImageSize", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def updateImageSize(self):\n if self.parent().get_display_mode() == 'intensities' or self.parent().get_display_mode() == 'features':\n self.scaleFactor = 1 \n else:\n self.scaleFactor = 0.8 \n self.parent().resize(900, 700) \n \n self.setMinimumHeight(self.image.height() * self.scaleFactor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L757_C8", "label": "if", "type": "if", "loc": [757, 761], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L756_C4", "vector": [4, 2, 0.7644, 0.005, 2, 0.31, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.parent().get_display_mode() == 'intensities' or self.parent().get_display_mode() == 'features':\n self.scaleFactor = 1 \n else:\n self.scaleFactor = 0.8 \n self.parent().resize(900, 700) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L758_C12", "label": "self.scaleFactor =", "type": "assigned_variable", "loc": [758, 758], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L757_C8", "vector": [14, 3, 0.7633, 0.001, 3, 0.32, 0.0, 603, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.scaleFactor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.scaleFactor = 1 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L760_C12", "label": "self.scaleFactor =", "type": "assigned_variable", "loc": [760, 760], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L757_C8", "vector": [14, 3, 0.7654, 0.001, 3, 0.32, 0.5, 603, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.scaleFactor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.scaleFactor = 0.8 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L761_C12", "label": "resize()", "type": "expression", "loc": [761, 761], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L757_C8", "vector": [8, 3, 0.7664, 0.001, 3, 0.32, 1.0, 834, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "resize", "arg_names": [], "import_names": [], "rhs_call_name": "resize", "annotation": ""}, "snippet": " self.parent().resize(900, 700) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L763_C8", "label": "setMinimumHeight()", "type": "expression", "loc": [763, 763], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L756_C4", "vector": [8, 2, 0.7684, 0.001, 2, 0.31, 0.1429, 293, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setMinimumHeight", "arg_names": [], "import_names": [], "rhs_call_name": "setMinimumHeight", "annotation": ""}, "snippet": " self.setMinimumHeight(self.image.height() * self.scaleFactor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L764_C8", "label": "setMinimumWidth()", "type": "expression", "loc": [764, 764], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L756_C4", "vector": [8, 2, 0.7694, 0.001, 2, 0.31, 0.2857, 812, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setMinimumWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setMinimumWidth", "annotation": ""}, "snippet": " self.setMinimumWidth(self.image.width() * self.scaleFactor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L765_C8", "label": "setMaximumHeight()", "type": "expression", "loc": [765, 765], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L756_C4", "vector": [8, 2, 0.7704, 0.001, 2, 0.31, 0.4286, 421, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setMaximumHeight", "arg_names": [], "import_names": [], "rhs_call_name": "setMaximumHeight", "annotation": ""}, "snippet": " self.setMaximumHeight(self.image.height() * self.scaleFactor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L766_C8", "label": "setMaximumWidth()", "type": "expression", "loc": [766, 766], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L756_C4", "vector": [8, 2, 0.7714, 0.001, 2, 0.31, 0.5714, 668, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setMaximumWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setMaximumWidth", "annotation": ""}, "snippet": " self.setMaximumWidth(self.image.width() * self.scaleFactor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L768_C8", "label": "pixmap = fromImage()", "type": "assigned_variable", "loc": [768, 768], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L756_C4", "vector": [14, 2, 0.7734, 0.001, 2, 0.31, 0.7143, 535, 3, 1, 0, 0, 154, 10, 1], "semantic": {"name": "pixmap", "arg_names": [], "import_names": [], "rhs_call_name": "fromImage", "annotation": ""}, "snippet": " pixmap = QtGui.QPixmap.fromImage(self.image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L769_C8", "label": "resize()", "type": "expression", "loc": [769, 769], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L756_C4", "vector": [8, 2, 0.7744, 0.001, 2, 0.31, 0.8571, 834, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "resize", "arg_names": [], "import_names": [], "rhs_call_name": "resize", "annotation": ""}, "snippet": " self.resize(self.scaleFactor * pixmap.size());"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L770_C8", "label": "setPixmap()", "type": "expression", "loc": [770, 770], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L756_C4", "vector": [8, 2, 0.7754, 0.001, 2, 0.31, 1.0, 755, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setPixmap", "arg_names": [], "import_names": [], "rhs_call_name": "setPixmap", "annotation": ""}, "snippet": " self.setPixmap(pixmap);"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L773_C4", "label": "set_polygons", "type": "function", "loc": [773, 777], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "vector": [2, 1, 0.7805, 0.005, 1, 0.83, 0.3077, 601, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "set_polygons", "arg_names": ["self", "polygons"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_polygons(self, polygons):\n self.polygons = polygons\n self.current_polygon_index = 0\n self.update()\n self.emit(QtCore.SIGNAL(\"sigPolyChanged\"), self.polygons, self.current_polygon_index) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L774_C8", "label": "self.polygons =", "type": "assigned_variable", "loc": [774, 774], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L773_C4", "vector": [14, 2, 0.7795, 0.001, 2, 0.88, 0.0, 511, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.polygons", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.polygons = polygons"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L775_C8", "label": "self.current_polygon_index =", "type": "assigned_variable", "loc": [775, 775], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L773_C4", "vector": [14, 2, 0.7805, 0.001, 2, 0.88, 0.3333, 671, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.current_polygon_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_polygon_index = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L776_C8", "label": "update()", "type": "expression", "loc": [776, 776], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L773_C4", "vector": [8, 2, 0.7815, 0.001, 2, 0.88, 0.6667, 637, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.update()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L777_C8", "label": "emit()", "type": "expression", "loc": [777, 777], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L773_C4", "vector": [8, 2, 0.7825, 0.001, 2, 0.88, 1.0, 627, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit(QtCore.SIGNAL(\"sigPolyChanged\"), self.polygons, self.current_polygon_index) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L779_C4", "label": "set_image", "type": "function", "loc": [779, 787], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "vector": [2, 1, 0.7885, 0.0091, 1, 0.83, 0.3846, 942, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "set_image", "arg_names": ["self", "filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_image(self, filename):\n print(filename)\n if os.path.isfile(filename):\n self.image = QtGui.QImage(filename)\n else:\n self.image = QtGui.QImage('noimage.png')\n \n self.updateImageSize()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L780_C8", "label": "print()", "type": "expression", "loc": [780, 780], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L779_C4", "vector": [8, 2, 0.7855, 0.001, 2, 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(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L781_C8", "label": "if", "type": "if", "loc": [781, 784], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L779_C4", "vector": [4, 2, 0.788, 0.004, 2, 0.45, 0.3333, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.isfile(filename):\n self.image = QtGui.QImage(filename)\n else:\n self.image = QtGui.QImage('noimage.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L782_C12", "label": "self.image = QImage()", "type": "assigned_variable", "loc": [782, 782], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L781_C8", "vector": [14, 3, 0.7875, 0.001, 3, 0.0, 0.0, 219, 3, 1, 0, 0, 723, 10, 1], "semantic": {"name": "self.image", "arg_names": [], "import_names": [], "rhs_call_name": "QImage", "annotation": ""}, "snippet": " self.image = QtGui.QImage(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L784_C12", "label": "self.image = QImage()", "type": "assigned_variable", "loc": [784, 784], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L781_C8", "vector": [14, 3, 0.7895, 0.001, 3, 0.0, 1.0, 219, 3, 1, 0, 0, 723, 10, 1], "semantic": {"name": "self.image", "arg_names": [], "import_names": [], "rhs_call_name": "QImage", "annotation": ""}, "snippet": " self.image = QtGui.QImage('noimage.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L786_C8", "label": "updateImageSize()", "type": "expression", "loc": [786, 786], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L779_C4", "vector": [8, 2, 0.7915, 0.001, 2, 0.45, 0.6667, 15, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "updateImageSize", "arg_names": [], "import_names": [], "rhs_call_name": "updateImageSize", "annotation": ""}, "snippet": " self.updateImageSize()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L787_C8", "label": "update()", "type": "expression", "loc": [787, 787], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L779_C4", "vector": [8, 2, 0.7925, 0.001, 2, 0.45, 1.0, 637, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.update()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L789_C4", "label": "paintEvent", "type": "function", "loc": [789, 844], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "vector": [2, 1, 0.8223, 0.0564, 1, 0.83, 0.4615, 838, 0, 2, 0, 0, 0, 0, 56], "semantic": {"name": "paintEvent", "arg_names": ["self", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def paintEvent(self, event):\n # draw image as label-pixmap\n QtGui.QLabel.paintEvent(self,event) \n painter = QtGui.QPainter()\n painter.begin(self)\n if self.parent().get_display_mode() == 'image' or self.parent().get_display_mode() == 'labels':\n color = QtGui.QColor(0,0,255)\n color_surface = QtGui.QColor(0,255,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L791_C8", "label": "paintEvent()", "type": "expression", "loc": [791, 791], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L789_C4", "vector": [8, 2, 0.7966, 0.001, 2, 0.29, 0.0, 838, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "paintEvent", "arg_names": [], "import_names": [], "rhs_call_name": "paintEvent", "annotation": ""}, "snippet": " QtGui.QLabel.paintEvent(self,event) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L792_C8", "label": "painter = QPainter()", "type": "assigned_variable", "loc": [792, 792], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L789_C4", "vector": [14, 2, 0.7976, 0.001, 2, 0.29, 0.25, 481, 3, 0, 0, 0, 972, 10, 1], "semantic": {"name": "painter", "arg_names": [], "import_names": [], "rhs_call_name": "QPainter", "annotation": ""}, "snippet": " painter = QtGui.QPainter()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L793_C8", "label": "begin()", "type": "expression", "loc": [793, 793], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L789_C4", "vector": [8, 2, 0.7986, 0.001, 2, 0.29, 0.5, 969, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "begin", "arg_names": [], "import_names": [], "rhs_call_name": "begin", "annotation": ""}, "snippet": " painter.begin(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8", "label": "if", "type": "if", "loc": [794, 843], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L789_C4", "vector": [4, 2, 0.8243, 0.0504, 2, 0.29, 0.75, 0, 0, 0, 0, 0, 0, 0, 52], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.parent().get_display_mode() == 'image' or self.parent().get_display_mode() == 'labels':\n color = QtGui.QColor(0,0,255)\n color_surface = QtGui.QColor(0,255,0)\n color_roi = QtGui.QColor(255,255,255)\n color_edge = QtGui.QColor(255,255,0)\n color_edge_up = QtGui.QColor(255,255,255)\n color_edge_down = QtGui.QColor(255,150,255)\n color_background = QtGui.QColor(255,0,255)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L795_C12", "label": "color = QColor()", "type": "assigned_variable", "loc": [795, 795], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8", "vector": [14, 3, 0.8006, 0.001, 3, 0.27, 0.0, 776, 3, 3, 0, 0, 787, 10, 1], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "QColor", "annotation": ""}, "snippet": " color = QtGui.QColor(0,0,255)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L796_C12", "label": "color_surface = QColor()", "type": "assigned_variable", "loc": [796, 796], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8", "vector": [14, 3, 0.8016, 0.001, 3, 0.27, 0.1111, 974, 3, 3, 0, 0, 787, 10, 1], "semantic": {"name": "color_surface", "arg_names": [], "import_names": [], "rhs_call_name": "QColor", "annotation": ""}, "snippet": " color_surface = QtGui.QColor(0,255,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L797_C12", "label": "color_roi = QColor()", "type": "assigned_variable", "loc": [797, 797], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8", "vector": [14, 3, 0.8026, 0.001, 3, 0.27, 0.2222, 526, 3, 3, 0, 0, 787, 10, 1], "semantic": {"name": "color_roi", "arg_names": [], "import_names": [], "rhs_call_name": "QColor", "annotation": ""}, "snippet": " color_roi = QtGui.QColor(255,255,255)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L798_C12", "label": "color_edge = QColor()", "type": "assigned_variable", "loc": [798, 798], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8", "vector": [14, 3, 0.8036, 0.001, 3, 0.27, 0.3333, 368, 3, 3, 0, 0, 787, 10, 1], "semantic": {"name": "color_edge", "arg_names": [], "import_names": [], "rhs_call_name": "QColor", "annotation": ""}, "snippet": " color_edge = QtGui.QColor(255,255,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L799_C12", "label": "color_edge_up = QColor()", "type": "assigned_variable", "loc": [799, 799], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8", "vector": [14, 3, 0.8046, 0.001, 3, 0.27, 0.4444, 951, 3, 3, 0, 0, 787, 10, 1], "semantic": {"name": "color_edge_up", "arg_names": [], "import_names": [], "rhs_call_name": "QColor", "annotation": ""}, "snippet": " color_edge_up = QtGui.QColor(255,255,255)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L800_C12", "label": "color_edge_down = QColor()", "type": "assigned_variable", "loc": [800, 800], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8", "vector": [14, 3, 0.8056, 0.001, 3, 0.27, 0.5556, 350, 3, 3, 0, 0, 787, 10, 1], "semantic": {"name": "color_edge_down", "arg_names": [], "import_names": [], "rhs_call_name": "QColor", "annotation": ""}, "snippet": " color_edge_down = QtGui.QColor(255,150,255)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L801_C12", "label": "color_background = QColor()", "type": "assigned_variable", "loc": [801, 801], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8", "vector": [14, 3, 0.8066, 0.001, 3, 0.27, 0.6667, 730, 3, 3, 0, 0, 787, 10, 1], "semantic": {"name": "color_background", "arg_names": [], "import_names": [], "rhs_call_name": "QColor", "annotation": ""}, "snippet": " color_background = QtGui.QColor(255,0,255)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L802_C12", "label": "color_current = QColor()", "type": "assigned_variable", "loc": [802, 802], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8", "vector": [14, 3, 0.8077, 0.001, 3, 0.27, 0.7778, 275, 3, 3, 0, 0, 787, 10, 1], "semantic": {"name": "color_current", "arg_names": [], "import_names": [], "rhs_call_name": "QColor", "annotation": ""}, "snippet": " color_current = QtGui.QColor(255,0,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L804_C12", "label": "for index, polygon", "type": "for", "loc": [804, 837], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8", "vector": [6, 3, 0.8263, 0.0342, 3, 0.27, 0.8889, 86, 3, 0, 0, 0, 0, 0, 34], "semantic": {"name": "index, polygon", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index, polygon in enumerate(self.polygons):\n \n last_point = (-1,-1)\n first = True;\n if self.current_polygon_index != index or self.parent().get_display_mode() != 'image':\n if polygon.get_label() == 'surface':\n painter.setPen(color_surface)\n elif polygon.get_label() == 'roi':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L806_C16", "label": "last_point =", "type": "assigned_variable", "loc": [806, 806], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L804_C12", "vector": [14, 4, 0.8117, 0.001, 4, 0.34, 0.0, 438, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "last_point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " last_point = (-1,-1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L807_C16", "label": "first =", "type": "assigned_variable", "loc": [807, 807], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L804_C12", "vector": [14, 4, 0.8127, 0.001, 4, 0.34, 0.25, 199, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "first", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " first = True;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L808_C16", "label": "if", "type": "if", "loc": [808, 824], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L804_C12", "vector": [4, 4, 0.8218, 0.0171, 4, 0.34, 0.5, 0, 0, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.current_polygon_index != index or self.parent().get_display_mode() != 'image':\n if polygon.get_label() == 'surface':\n painter.setPen(color_surface)\n elif polygon.get_label() == 'roi':\n painter.setPen(color_roi) \n elif polygon.get_label() == 'edge':\n painter.setPen(color_edge)\n elif polygon.get_label() == 'edge_up':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L809_C20", "label": "if", "type": "if", "loc": [809, 822], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L808_C16", "vector": [4, 5, 0.8212, 0.0141, 5, 0.14, 0.0, 0, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if polygon.get_label() == 'surface':\n painter.setPen(color_surface)\n elif polygon.get_label() == 'roi':\n painter.setPen(color_roi) \n elif polygon.get_label() == 'edge':\n painter.setPen(color_edge)\n elif polygon.get_label() == 'edge_up':\n painter.setPen(color_edge_up)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L810_C24", "label": "setPen()", "type": "expression", "loc": [810, 810], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L809_C20", "vector": [8, 6, 0.8157, 0.001, 6, 0.13, 0.0, 129, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setPen", "arg_names": [], "import_names": [], "rhs_call_name": "setPen", "annotation": ""}, "snippet": " painter.setPen(color_surface)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L811_C20", "label": "if", "type": "if", "loc": [811, 822], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L809_C20", "vector": [4, 6, 0.8223, 0.0121, 6, 0.13, 1.0, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif polygon.get_label() == 'roi':\n painter.setPen(color_roi) \n elif polygon.get_label() == 'edge':\n painter.setPen(color_edge)\n elif polygon.get_label() == 'edge_up':\n painter.setPen(color_edge_up)\n elif polygon.get_label() == 'edge_down':\n painter.setPen(color_edge_down)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L812_C24", "label": "setPen()", "type": "expression", "loc": [812, 812], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L811_C20", "vector": [8, 7, 0.8177, 0.001, 7, 0.69, 0.0, 129, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setPen", "arg_names": [], "import_names": [], "rhs_call_name": "setPen", "annotation": ""}, "snippet": " painter.setPen(color_roi) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L813_C20", "label": "if", "type": "if", "loc": [813, 822], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L811_C20", "vector": [4, 7, 0.8233, 0.0101, 7, 0.69, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif polygon.get_label() == 'edge':\n painter.setPen(color_edge)\n elif polygon.get_label() == 'edge_up':\n painter.setPen(color_edge_up)\n elif polygon.get_label() == 'edge_down':\n painter.setPen(color_edge_down)\n elif polygon.get_label() == 'background':\n painter.setPen(color_background) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L814_C24", "label": "setPen()", "type": "expression", "loc": [814, 814], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L813_C20", "vector": [8, 8, 0.8197, 0.001, 8, 0.92, 0.0, 129, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setPen", "arg_names": [], "import_names": [], "rhs_call_name": "setPen", "annotation": ""}, "snippet": " painter.setPen(color_edge)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L815_C20", "label": "if", "type": "if", "loc": [815, 822], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L813_C20", "vector": [4, 8, 0.8243, 0.0081, 8, 0.92, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif polygon.get_label() == 'edge_up':\n painter.setPen(color_edge_up)\n elif polygon.get_label() == 'edge_down':\n painter.setPen(color_edge_down)\n elif polygon.get_label() == 'background':\n painter.setPen(color_background) \n else:\n painter.setPen(color)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L816_C24", "label": "setPen()", "type": "expression", "loc": [816, 816], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L815_C20", "vector": [8, 9, 0.8218, 0.001, 9, 0.21, 0.0, 129, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setPen", "arg_names": [], "import_names": [], "rhs_call_name": "setPen", "annotation": ""}, "snippet": " painter.setPen(color_edge_up)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L817_C20", "label": "if", "type": "if", "loc": [817, 822], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L815_C20", "vector": [4, 9, 0.8253, 0.006, 9, 0.21, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif polygon.get_label() == 'edge_down':\n painter.setPen(color_edge_down)\n elif polygon.get_label() == 'background':\n painter.setPen(color_background) \n else:\n painter.setPen(color)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L818_C24", "label": "setPen()", "type": "expression", "loc": [818, 818], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L817_C20", "vector": [8, 10, 0.8238, 0.001, 10, 0.92, 0.0, 129, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setPen", "arg_names": [], "import_names": [], "rhs_call_name": "setPen", "annotation": ""}, "snippet": " painter.setPen(color_edge_down)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L819_C20", "label": "if", "type": "if", "loc": [819, 822], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L817_C20", "vector": [4, 10, 0.8263, 0.004, 10, 0.92, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif polygon.get_label() == 'background':\n painter.setPen(color_background) \n else:\n painter.setPen(color)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L820_C24", "label": "setPen()", "type": "expression", "loc": [820, 820], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L819_C20", "vector": [8, 11, 0.8258, 0.001, 11, 0.08, 0.0, 129, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setPen", "arg_names": [], "import_names": [], "rhs_call_name": "setPen", "annotation": ""}, "snippet": " painter.setPen(color_background) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L822_C24", "label": "setPen()", "type": "expression", "loc": [822, 822], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L819_C20", "vector": [8, 11, 0.8278, 0.001, 11, 0.08, 1.0, 129, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setPen", "arg_names": [], "import_names": [], "rhs_call_name": "setPen", "annotation": ""}, "snippet": " painter.setPen(color)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L824_C20", "label": "setPen()", "type": "expression", "loc": [824, 824], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L808_C16", "vector": [8, 5, 0.8298, 0.001, 5, 0.14, 1.0, 129, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setPen", "arg_names": [], "import_names": [], "rhs_call_name": "setPen", "annotation": ""}, "snippet": " painter.setPen(color_current)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L826_C16", "label": "for point", "type": "for", "loc": [826, 830], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L804_C12", "vector": [6, 4, 0.8338, 0.005, 4, 0.34, 0.75, 16, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for point in polygon.get_points():\n if False == first:\n painter.drawLine(QtCore.QPointF(point[0],point[1]) * self.scaleFactor, QtCore.QPointF(last_point[0],last_point[1]) * self.scaleFactor)\n last_point = point\n first = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L827_C20", "label": "if", "type": "if", "loc": [827, 828], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L826_C16", "vector": [4, 5, 0.8333, 0.002, 5, 0.84, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False == first:\n painter.drawLine(QtCore.QPointF(point[0],point[1]) * self.scaleFactor, QtCore.QPointF(last_point[0],last_point[1]) * self.scaleFactor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L828_C24", "label": "drawLine()", "type": "expression", "loc": [828, 828], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L827_C20", "vector": [8, 6, 0.8338, 0.001, 6, 0.97, 0.0, 144, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "drawLine", "arg_names": [], "import_names": [], "rhs_call_name": "drawLine", "annotation": ""}, "snippet": " painter.drawLine(QtCore.QPointF(point[0],point[1]) * self.scaleFactor, QtCore.QPointF(last_point[0],last_point[1]) * self.scaleFactor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L829_C20", "label": "last_point =", "type": "assigned_variable", "loc": [829, 829], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L826_C16", "vector": [14, 5, 0.8348, 0.001, 5, 0.84, 0.5, 438, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "last_point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " last_point = point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L830_C20", "label": "first =", "type": "assigned_variable", "loc": [830, 830], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L826_C16", "vector": [14, 5, 0.8359, 0.001, 5, 0.84, 1.0, 199, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "first", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " first = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L833_C16", "label": "if", "type": "if", "loc": [833, 837], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L804_C12", "vector": [4, 4, 0.8409, 0.005, 4, 0.34, 1.0, 0, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.parent().get_display_mode() != 'image' or self.current_polygon_index != index ) and polygon.get_type() == 'polygon' and len(polygon.get_points()) :\n painter.drawLine(QtCore.QPointF(last_point[0],last_point[1]) * self.scaleFactor, QtCore.QPointF(polygon.get_points()[0][0],polygon.get_points()[0][1]) * self.scaleFactor)\n else:\n for point in polygon.get_points():\n painter.drawEllipse(QtCore.QRectF(point[0] * self.scaleFactor-3,point[1] * self.scaleFactor-3,6,6))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L834_C20", "label": "drawLine()", "type": "expression", "loc": [834, 834], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L833_C16", "vector": [8, 5, 0.8399, 0.001, 5, 0.27, 0.0, 144, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "drawLine", "arg_names": [], "import_names": [], "rhs_call_name": "drawLine", "annotation": ""}, "snippet": " painter.drawLine(QtCore.QPointF(last_point[0],last_point[1]) * self.scaleFactor, QtCore.QPointF(polygon.get_points()[0][0],polygon.get_points()[0][1]) * self.scaleFactor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L836_C20", "label": "for point", "type": "for", "loc": [836, 837], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L833_C16", "vector": [6, 5, 0.8424, 0.002, 5, 0.27, 1.0, 16, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for point in polygon.get_points():\n painter.drawEllipse(QtCore.QRectF(point[0] * self.scaleFactor-3,point[1] * self.scaleFactor-3,6,6))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L837_C24", "label": "drawEllipse()", "type": "expression", "loc": [837, 837], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L836_C20", "vector": [8, 6, 0.8429, 0.001, 6, 0.23, 0.0, 708, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "drawEllipse", "arg_names": [], "import_names": [], "rhs_call_name": "drawEllipse", "annotation": ""}, "snippet": " painter.drawEllipse(QtCore.QRectF(point[0] * self.scaleFactor-3,point[1] * self.scaleFactor-3,6,6))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L839_C8", "label": "if", "type": "if", "loc": [839, 843], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8", "vector": [4, 3, 0.8469, 0.005, 3, 0.27, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.parent().get_display_mode() == 'intensities':\n color = QtGui.QColor(255,0,255)\n painter.setPen(color)\n for point in self.ground_plane_points:\n painter.drawEllipse(QtCore.QRectF(point[0] * self.scaleFactor-3,point[1] * self.scaleFactor-3,6,6))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L840_C12", "label": "color = QColor()", "type": "assigned_variable", "loc": [840, 840], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L839_C8", "vector": [14, 4, 0.8459, 0.001, 4, 0.09, 0.0, 776, 3, 3, 0, 0, 787, 10, 1], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "QColor", "annotation": ""}, "snippet": " color = QtGui.QColor(255,0,255)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L841_C12", "label": "setPen()", "type": "expression", "loc": [841, 841], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L839_C8", "vector": [8, 4, 0.8469, 0.001, 4, 0.09, 0.5, 129, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setPen", "arg_names": [], "import_names": [], "rhs_call_name": "setPen", "annotation": ""}, "snippet": " painter.setPen(color)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L842_C12", "label": "for point", "type": "for", "loc": [842, 843], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L839_C8", "vector": [6, 4, 0.8484, 0.002, 4, 0.09, 1.0, 16, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for point in self.ground_plane_points:\n painter.drawEllipse(QtCore.QRectF(point[0] * self.scaleFactor-3,point[1] * self.scaleFactor-3,6,6))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L843_C16", "label": "drawEllipse()", "type": "expression", "loc": [843, 843], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L842_C12", "vector": [8, 5, 0.8489, 0.001, 5, 0.86, 0.0, 708, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "drawEllipse", "arg_names": [], "import_names": [], "rhs_call_name": "drawEllipse", "annotation": ""}, "snippet": " painter.drawEllipse(QtCore.QRectF(point[0] * self.scaleFactor-3,point[1] * self.scaleFactor-3,6,6))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L844_C8", "label": "end()", "type": "expression", "loc": [844, 844], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L789_C4", "vector": [8, 2, 0.8499, 0.001, 2, 0.29, 1.0, 128, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "end", "annotation": ""}, "snippet": " painter.end()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L847_C4", "label": "mousePressEvent", "type": "function", "loc": [847, 898], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "vector": [2, 1, 0.8787, 0.0524, 1, 0.83, 0.5385, 277, 0, 2, 0, 0, 0, 0, 59], "semantic": {"name": "mousePressEvent", "arg_names": ["self", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def mousePressEvent(self,event):\n \n if self.hasFocus():\n if self.parent().get_display_mode() == 'image':\n if event.button() == QtCore.Qt.LeftButton:\n #print 'coords:', x,' ',y\n point = (event.x() / self.scaleFactor, event.y() / self.scaleFactor)\n self.polygons[self.current_polygon_index].add_point(point)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L849_C8", "label": "if", "type": "if", "loc": [849, 898], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L847_C4", "vector": [4, 2, 0.8797, 0.0504, 2, 0.55, 0.0, 0, 3, 0, 0, 0, 0, 0, 59], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.hasFocus():\n if self.parent().get_display_mode() == 'image':\n if event.button() == QtCore.Qt.LeftButton:\n #print 'coords:', x,' ',y\n point = (event.x() / self.scaleFactor, event.y() / self.scaleFactor)\n self.polygons[self.current_polygon_index].add_point(point)\n self.update()\n self.emit(QtCore.SIGNAL(\"sigPolyChanged\"), self.polygons, self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L850_C12", "label": "if", "type": "if", "loc": [850, 893], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L849_C8", "vector": [4, 3, 0.8776, 0.0443, 3, 0.1, 0.0, 0, 0, 0, 0, 0, 0, 0, 57], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.parent().get_display_mode() == 'image':\n if event.button() == QtCore.Qt.LeftButton:\n #print 'coords:', x,' ',y\n point = (event.x() / self.scaleFactor, event.y() / self.scaleFactor)\n self.polygons[self.current_polygon_index].add_point(point)\n self.update()\n self.emit(QtCore.SIGNAL(\"sigPolyChanged\"), self.polygons, self.current_polygon_index)\n if event.button() == QtCore.Qt.RightButton:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L851_C16", "label": "if", "type": "if", "loc": [851, 856], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L850_C12", "vector": [4, 4, 0.8595, 0.006, 4, 0.7, 0.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event.button() == QtCore.Qt.LeftButton:\n #print 'coords:', x,' ',y\n point = (event.x() / self.scaleFactor, event.y() / self.scaleFactor)\n self.polygons[self.current_polygon_index].add_point(point)\n self.update()\n self.emit(QtCore.SIGNAL(\"sigPolyChanged\"), self.polygons, self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L853_C20", "label": "point =", "type": "assigned_variable", "loc": [853, 853], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L851_C16", "vector": [14, 5, 0.859, 0.001, 5, 0.6, 0.0, 16, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point = (event.x() / self.scaleFactor, event.y() / self.scaleFactor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L854_C20", "label": "add_point()", "type": "expression", "loc": [854, 854], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L851_C16", "vector": [8, 5, 0.86, 0.001, 5, 0.6, 0.3333, 692, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_point", "arg_names": [], "import_names": [], "rhs_call_name": "add_point", "annotation": ""}, "snippet": " self.polygons[self.current_polygon_index].add_point(point)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L855_C20", "label": "update()", "type": "expression", "loc": [855, 855], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L851_C16", "vector": [8, 5, 0.861, 0.001, 5, 0.6, 0.6667, 637, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.update()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L856_C20", "label": "emit()", "type": "expression", "loc": [856, 856], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L851_C16", "vector": [8, 5, 0.862, 0.001, 5, 0.6, 1.0, 627, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit(QtCore.SIGNAL(\"sigPolyChanged\"), self.polygons, self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L857_C16", "label": "if", "type": "if", "loc": [857, 861], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L850_C12", "vector": [4, 4, 0.8651, 0.005, 4, 0.7, 0.5, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event.button() == QtCore.Qt.RightButton:\n if False == self.polygons[self.current_polygon_index].is_empty():\n self.polygons[self.current_polygon_index].delete_last_point()\n self.update()\n self.emit(QtCore.SIGNAL(\"sigPolyChanged\"), self.polygons, self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L858_C20", "label": "if", "type": "if", "loc": [858, 861], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L857_C16", "vector": [4, 5, 0.8656, 0.004, 5, 0.1, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False == self.polygons[self.current_polygon_index].is_empty():\n self.polygons[self.current_polygon_index].delete_last_point()\n self.update()\n self.emit(QtCore.SIGNAL(\"sigPolyChanged\"), self.polygons, self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L859_C24", "label": "delete_last_point()", "type": "expression", "loc": [859, 859], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L858_C20", "vector": [8, 6, 0.8651, 0.001, 6, 0.25, 0.0, 897, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "delete_last_point", "arg_names": [], "import_names": [], "rhs_call_name": "delete_last_point", "annotation": ""}, "snippet": " self.polygons[self.current_polygon_index].delete_last_point()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L860_C24", "label": "update()", "type": "expression", "loc": [860, 860], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L858_C20", "vector": [8, 6, 0.8661, 0.001, 6, 0.25, 0.5, 637, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.update()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L861_C24", "label": "emit()", "type": "expression", "loc": [861, 861], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L858_C20", "vector": [8, 6, 0.8671, 0.001, 6, 0.25, 1.0, 627, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit(QtCore.SIGNAL(\"sigPolyChanged\"), self.polygons, self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L862_C12", "label": "if", "type": "if", "loc": [862, 893], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L850_C12", "vector": [4, 4, 0.8837, 0.0322, 4, 0.7, 1.0, 0, 0, 0, 0, 0, 0, 0, 42], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.parent().get_display_mode() == 'intensities':\n \n point = (event.x() / self.scaleFactor, event.y() / self.scaleFactor)\n print('point:', point)\n if True == self.parent().processor.check_3d_plane_point(point):\n self.ground_plane_points.append(point)\n if len(self.ground_plane_points) < 3:\n self.update()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L864_C16", "label": "point =", "type": "assigned_variable", "loc": [864, 864], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L862_C12", "vector": [14, 5, 0.8701, 0.001, 5, 0.11, 0.0, 16, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point = (event.x() / self.scaleFactor, event.y() / self.scaleFactor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L865_C16", "label": "print()", "type": "expression", "loc": [865, 865], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L862_C12", "vector": [8, 5, 0.8711, 0.001, 5, 0.11, 0.3333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('point:', point)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L866_C16", "label": "if", "type": "if", "loc": [866, 872], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L862_C12", "vector": [4, 5, 0.8751, 0.007, 5, 0.11, 0.6667, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if True == self.parent().processor.check_3d_plane_point(point):\n self.ground_plane_points.append(point)\n if len(self.ground_plane_points) < 3:\n self.update()\n else:\n self.emit(QtCore.SIGNAL(\"sigDefineGroundPlane\"), self.ground_plane_points)\n self.ground_plane_points = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L867_C20", "label": "append()", "type": "expression", "loc": [867, 867], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L866_C16", "vector": [8, 6, 0.8731, 0.001, 6, 0.65, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.ground_plane_points.append(point)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L868_C20", "label": "if", "type": "if", "loc": [868, 872], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L866_C16", "vector": [4, 6, 0.8761, 0.005, 6, 0.65, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(self.ground_plane_points) < 3:\n self.update()\n else:\n self.emit(QtCore.SIGNAL(\"sigDefineGroundPlane\"), self.ground_plane_points)\n self.ground_plane_points = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L869_C24", "label": "update()", "type": "expression", "loc": [869, 869], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L868_C20", "vector": [8, 7, 0.8751, 0.001, 7, 0.02, 0.0, 637, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.update()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L871_C24", "label": "emit()", "type": "expression", "loc": [871, 871], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L868_C20", "vector": [8, 7, 0.8771, 0.001, 7, 0.02, 0.5, 627, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit(QtCore.SIGNAL(\"sigDefineGroundPlane\"), self.ground_plane_points)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L872_C24", "label": "self.ground_plane_points =", "type": "assigned_variable", "loc": [872, 872], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L868_C20", "vector": [14, 7, 0.8781, 0.001, 7, 0.02, 1.0, 657, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ground_plane_points", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ground_plane_points = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L875_C12", "label": "if", "type": "if", "loc": [875, 893], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L862_C12", "vector": [4, 5, 0.8902, 0.0191, 5, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 0, 30], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.parent().get_display_mode() == 'features': \n point = (event.x() / self.scaleFactor, event.y() / self.scaleFactor)\n if True == self.parent().processor.check_3d_plane_point(point):\n print('point:', point)\n point3d = self.parent().processor.get_3d_point(point)\n print('point3d',point3d)\n \n index = self.parent().processor.get_3d_point_index_in_unrotated(point3d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L876_C16", "label": "point =", "type": "assigned_variable", "loc": [876, 876], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L875_C12", "vector": [14, 6, 0.8822, 0.001, 6, 0.57, 0.0, 16, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point = (event.x() / self.scaleFactor, event.y() / self.scaleFactor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "label": "if", "type": "if", "loc": [877, 893], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L875_C12", "vector": [4, 6, 0.8912, 0.0171, 6, 0.57, 1.0, 0, 0, 0, 0, 0, 0, 0, 26], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if True == self.parent().processor.check_3d_plane_point(point):\n print('point:', point)\n point3d = self.parent().processor.get_3d_point(point)\n print('point3d',point3d)\n \n index = self.parent().processor.get_3d_point_index_in_unrotated(point3d)\n self.parent().processor.load_data(self.parent().current_dataset.id)\n self.parent().processor.process_raw_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L878_C20", "label": "print()", "type": "expression", "loc": [878, 878], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "vector": [8, 7, 0.8842, 0.001, 7, 0.26, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('point:', point)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L879_C20", "label": "point3d = get_3d_point()", "type": "assigned_variable", "loc": [879, 879], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "vector": [14, 7, 0.8852, 0.001, 7, 0.26, 0.0833, 846, 3, 1, 0, 0, 70, 10, 2], "semantic": {"name": "point3d", "arg_names": [], "import_names": [], "rhs_call_name": "get_3d_point", "annotation": ""}, "snippet": " point3d = self.parent().processor.get_3d_point(point)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L880_C20", "label": "print()", "type": "expression", "loc": [880, 880], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "vector": [8, 7, 0.8862, 0.001, 7, 0.26, 0.1667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('point3d',point3d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L882_C20", "label": "index = get_3d_point_index_in_unrotated()", "type": "assigned_variable", "loc": [882, 882], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "vector": [14, 7, 0.8882, 0.001, 7, 0.26, 0.25, 780, 3, 1, 0, 0, 279, 10, 2], "semantic": {"name": "index", "arg_names": [], "import_names": [], "rhs_call_name": "get_3d_point_index_in_unrotated", "annotation": ""}, "snippet": " index = self.parent().processor.get_3d_point_index_in_unrotated(point3d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L883_C20", "label": "load_data()", "type": "expression", "loc": [883, 883], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "vector": [8, 7, 0.8892, 0.001, 7, 0.26, 0.3333, 477, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "load_data", "arg_names": [], "import_names": [], "rhs_call_name": "load_data", "annotation": ""}, "snippet": " self.parent().processor.load_data(self.parent().current_dataset.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L884_C20", "label": "process_raw_data()", "type": "expression", "loc": [884, 884], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "vector": [8, 7, 0.8902, 0.001, 7, 0.26, 0.4167, 553, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "process_raw_data", "arg_names": [], "import_names": [], "rhs_call_name": "process_raw_data", "annotation": ""}, "snippet": " self.parent().processor.process_raw_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L885_C20", "label": "prepare()", "type": "expression", "loc": [885, 885], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "vector": [8, 7, 0.8912, 0.001, 7, 0.26, 0.5, 556, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "prepare", "arg_names": [], "import_names": [], "rhs_call_name": "prepare", "annotation": ""}, "snippet": " self.parent().processor.features.prepare([index])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L886_C20", "label": "self.parent().processor.feature_type =", "type": "assigned_variable", "loc": [886, 886], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "vector": [14, 7, 0.8922, 0.001, 7, 0.26, 0.5833, 901, 1, 0, 0, 0, 0, 3, 1], "semantic": {"name": "self.parent().processor.feature_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.parent().processor.feature_type = 'gaussian_histograms'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L887_C20", "label": "fv = get_featurevector()", "type": "assigned_variable", "loc": [887, 887], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "vector": [14, 7, 0.8933, 0.001, 7, 0.26, 0.6667, 914, 3, 2, 0, 0, 16, 10, 2], "semantic": {"name": "fv", "arg_names": [], "import_names": [], "rhs_call_name": "get_featurevector", "annotation": ""}, "snippet": " fv = self.parent().processor.features.get_featurevector(index,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L888_C20", "label": "print()", "type": "expression", "loc": [888, 888], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "vector": [8, 7, 0.8943, 0.001, 7, 0.26, 0.75, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('fv',fv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L889_C20", "label": "display_featurevector()", "type": "expression", "loc": [889, 889], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "vector": [8, 7, 0.8953, 0.001, 7, 0.26, 0.8333, 505, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "display_featurevector", "arg_names": [], "import_names": [], "rhs_call_name": "display_featurevector", "annotation": ""}, "snippet": " self.parent().processor.display_featurevector(fv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L892_C20", "label": "load_data()", "type": "expression", "loc": [892, 892], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "vector": [8, 7, 0.8983, 0.001, 7, 0.26, 0.9167, 477, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "load_data", "arg_names": [], "import_names": [], "rhs_call_name": "load_data", "annotation": ""}, "snippet": " self.parent().processor.load_data(self.parent().current_dataset.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L893_C20", "label": "process_intensities()", "type": "expression", "loc": [893, 893], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "vector": [8, 7, 0.8993, 0.001, 7, 0.26, 1.0, 581, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "process_intensities", "arg_names": [], "import_names": [], "rhs_call_name": "process_intensities", "annotation": ""}, "snippet": " self.parent().processor.process_intensities()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L898_C12", "label": "setFocus()", "type": "expression", "loc": [898, 898], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L849_C8", "vector": [8, 3, 0.9043, 0.001, 3, 0.1, 1.0, 638, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "setFocus", "arg_names": [], "import_names": [], "rhs_call_name": "setFocus", "annotation": ""}, "snippet": " self.setFocus()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L900_C4", "label": "mouseDoubleClickEvent", "type": "function", "loc": [900, 905], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "vector": [2, 1, 0.9089, 0.006, 1, 0.83, 0.6154, 8, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "mouseDoubleClickEvent", "arg_names": ["self", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def mouseDoubleClickEvent(self,event):\n if self.parent().get_display_mode() == 'image':\n if event.button() == QtCore.Qt.LeftButton:\n self.start_new_polygon()\n self.update()\n self.emit(QtCore.SIGNAL(\"sigPolyChanged\"), self.polygons, self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L901_C8", "label": "if", "type": "if", "loc": [901, 905], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L900_C4", "vector": [4, 2, 0.9094, 0.005, 2, 0.97, 0.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.parent().get_display_mode() == 'image':\n if event.button() == QtCore.Qt.LeftButton:\n self.start_new_polygon()\n self.update()\n self.emit(QtCore.SIGNAL(\"sigPolyChanged\"), self.polygons, self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L902_C12", "label": "if", "type": "if", "loc": [902, 905], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L901_C8", "vector": [4, 3, 0.9099, 0.004, 3, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event.button() == QtCore.Qt.LeftButton:\n self.start_new_polygon()\n self.update()\n self.emit(QtCore.SIGNAL(\"sigPolyChanged\"), self.polygons, self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L903_C16", "label": "start_new_polygon()", "type": "expression", "loc": [903, 903], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L902_C12", "vector": [8, 4, 0.9094, 0.001, 4, 0.08, 0.0, 189, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start_new_polygon", "arg_names": [], "import_names": [], "rhs_call_name": "start_new_polygon", "annotation": ""}, "snippet": " self.start_new_polygon()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L904_C16", "label": "update()", "type": "expression", "loc": [904, 904], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L902_C12", "vector": [8, 4, 0.9104, 0.001, 4, 0.08, 0.5, 637, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.update()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L905_C16", "label": "emit()", "type": "expression", "loc": [905, 905], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L902_C12", "vector": [8, 4, 0.9114, 0.001, 4, 0.08, 1.0, 627, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit(QtCore.SIGNAL(\"sigPolyChanged\"), self.polygons, self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L907_C4", "label": "start_new_polygon", "type": "function", "loc": [907, 912], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "vector": [2, 1, 0.9159, 0.006, 1, 0.83, 0.6923, 189, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "start_new_polygon", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_new_polygon(self):\n if False == self.polygons[self.current_polygon_index].is_empty():\n # if self.current_polygon_index == len(self.polygons) - 1:\n self.polygons.append(label_object.label_object()) #last one, append new\n self.current_polygon_index = len(self.polygons) - 1\n print(\"new poly index: \", self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L908_C8", "label": "if", "type": "if", "loc": [908, 912], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L907_C4", "vector": [4, 2, 0.9164, 0.005, 2, 0.13, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False == self.polygons[self.current_polygon_index].is_empty():\n # if self.current_polygon_index == len(self.polygons) - 1:\n self.polygons.append(label_object.label_object()) #last one, append new\n self.current_polygon_index = len(self.polygons) - 1\n print(\"new poly index: \", self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L910_C12", "label": "append()", "type": "expression", "loc": [910, 910], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L908_C8", "vector": [8, 3, 0.9164, 0.001, 3, 0.72, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.polygons.append(label_object.label_object()) #last one, append new"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L911_C12", "label": "self.current_polygon_index =", "type": "assigned_variable", "loc": [911, 911], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L908_C8", "vector": [14, 3, 0.9174, 0.001, 3, 0.72, 0.5, 671, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.current_polygon_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_polygon_index = len(self.polygons) - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L912_C12", "label": "print()", "type": "expression", "loc": [912, 912], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L908_C8", "vector": [8, 3, 0.9184, 0.001, 3, 0.72, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"new poly index: \", self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L914_C4", "label": "delete_empty_polygon", "type": "function", "loc": [914, 923], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "vector": [2, 1, 0.925, 0.0101, 1, 0.83, 0.7692, 796, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "delete_empty_polygon", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def delete_empty_polygon(self):\n if True == self.polygons[self.current_polygon_index].is_empty():\n #and it isn't the only one:\n if 1 != len(self.polygons):\n del self.polygons[self.current_polygon_index]\n if 0 != self.current_polygon_index:\n self.current_polygon_index -= 1\n print(\"new poly index: \", self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L915_C8", "label": "if", "type": "if", "loc": [915, 922], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L914_C4", "vector": [4, 2, 0.925, 0.0081, 2, 0.41, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if True == self.polygons[self.current_polygon_index].is_empty():\n #and it isn't the only one:\n if 1 != len(self.polygons):\n del self.polygons[self.current_polygon_index]\n if 0 != self.current_polygon_index:\n self.current_polygon_index -= 1\n print(\"new poly index: \", self.current_polygon_index)\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L917_C12", "label": "if", "type": "if", "loc": [917, 922], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L915_C8", "vector": [4, 3, 0.926, 0.006, 3, 0.03, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 1 != len(self.polygons):\n del self.polygons[self.current_polygon_index]\n if 0 != self.current_polygon_index:\n self.current_polygon_index -= 1\n print(\"new poly index: \", self.current_polygon_index)\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L919_C16", "label": "if", "type": "if", "loc": [919, 920], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L917_C12", "vector": [4, 4, 0.926, 0.002, 4, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 0 != self.current_polygon_index:\n self.current_polygon_index -= 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L921_C16", "label": "print()", "type": "expression", "loc": [921, 921], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L917_C12", "vector": [8, 4, 0.9275, 0.001, 4, 0.85, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"new poly index: \", self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L922_C16", "label": "return", "type": "return", "loc": [922, 922], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L917_C12", "vector": [13, 4, 0.9285, 0.001, 4, 0.85, 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_99713:Return_L923_C8", "label": "return", "type": "return", "loc": [923, 923], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L914_C4", "vector": [13, 2, 0.9295, 0.001, 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_99713:FunctionDef_L925_C4", "label": "keyPressEvent", "type": "function", "loc": [925, 976], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "vector": [2, 1, 0.9572, 0.0524, 1, 0.83, 0.8462, 207, 0, 2, 0, 0, 0, 0, 45], "semantic": {"name": "keyPressEvent", "arg_names": ["self", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def keyPressEvent(self, event):\n key = event.key()\n if key == QtCore.Qt.Key_Right:\n print('right')\n if self.current_polygon_index < len(self.polygons) - 1:\n self.delete_empty_polygon()\n self.current_polygon_index += 1\n print(\"czurrent poly index: \", self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L926_C8", "label": "key = key()", "type": "assigned_variable", "loc": [926, 926], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L925_C4", "vector": [14, 2, 0.9325, 0.001, 2, 0.25, 0.0, 230, 3, 0, 0, 0, 230, 10, 1], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "key", "annotation": ""}, "snippet": " key = event.key()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L927_C8", "label": "if", "type": "if", "loc": [927, 976], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L925_C4", "vector": [4, 2, 0.9582, 0.0504, 2, 0.25, 1.0, 0, 0, 0, 0, 0, 0, 0, 44], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if key == QtCore.Qt.Key_Right:\n print('right')\n if self.current_polygon_index < len(self.polygons) - 1:\n self.delete_empty_polygon()\n self.current_polygon_index += 1\n print(\"czurrent poly index: \", self.current_polygon_index)\n else:\n self.start_new_polygon()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L928_C12", "label": "print()", "type": "expression", "loc": [928, 928], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L927_C8", "vector": [8, 3, 0.9345, 0.001, 3, 0.0, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('right')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L929_C12", "label": "if", "type": "if", "loc": [929, 935], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L927_C8", "vector": [4, 3, 0.9386, 0.007, 3, 0.0, 0.25, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.current_polygon_index < len(self.polygons) - 1:\n self.delete_empty_polygon()\n self.current_polygon_index += 1\n print(\"czurrent poly index: \", self.current_polygon_index)\n else:\n self.start_new_polygon()\n self.parent().slot_update_polygon_labels()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L930_C16", "label": "delete_empty_polygon()", "type": "expression", "loc": [930, 930], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L929_C12", "vector": [8, 4, 0.9366, 0.001, 4, 0.63, 0.0, 796, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "delete_empty_polygon", "arg_names": [], "import_names": [], "rhs_call_name": "delete_empty_polygon", "annotation": ""}, "snippet": " self.delete_empty_polygon()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L932_C16", "label": "print()", "type": "expression", "loc": [932, 932], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L929_C12", "vector": [8, 4, 0.9386, 0.001, 4, 0.63, 0.3333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"czurrent poly index: \", self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L934_C16", "label": "start_new_polygon()", "type": "expression", "loc": [934, 934], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L929_C12", "vector": [8, 4, 0.9406, 0.001, 4, 0.63, 0.6667, 189, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start_new_polygon", "arg_names": [], "import_names": [], "rhs_call_name": "start_new_polygon", "annotation": ""}, "snippet": " self.start_new_polygon()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L935_C16", "label": "slot_update_polygon_labels()", "type": "expression", "loc": [935, 935], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L929_C12", "vector": [8, 4, 0.9416, 0.001, 4, 0.63, 1.0, 63, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "slot_update_polygon_labels", "arg_names": [], "import_names": [], "rhs_call_name": "slot_update_polygon_labels", "annotation": ""}, "snippet": " self.parent().slot_update_polygon_labels()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L936_C12", "label": "update()", "type": "expression", "loc": [936, 936], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L927_C8", "vector": [8, 3, 0.9426, 0.001, 3, 0.0, 0.5, 637, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.update()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L937_C12", "label": "emit()", "type": "expression", "loc": [937, 937], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L927_C8", "vector": [8, 3, 0.9436, 0.001, 3, 0.0, 0.75, 627, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit(QtCore.SIGNAL(\"sigPolyChanged\"), self.polygons, self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L938_C8", "label": "if", "type": "if", "loc": [938, 976], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L927_C8", "vector": [4, 3, 0.9637, 0.0393, 3, 0.0, 1.0, 0, 0, 0, 0, 0, 0, 0, 34], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif key == QtCore.Qt.Key_Left:\n print('left')\n if self.current_polygon_index > 0:\n if False == self.delete_empty_polygon():\n self.current_polygon_index -= 1\n print(\"current poly index: \", self.current_polygon_index)\n self.update()\n self.emit(QtCore.SIGNAL(\"sigPolyChanged\"), self.polygons, self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L939_C12", "label": "print()", "type": "expression", "loc": [939, 939], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L938_C8", "vector": [8, 4, 0.9456, 0.001, 4, 0.5, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('left')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L940_C12", "label": "if", "type": "if", "loc": [940, 943], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L938_C8", "vector": [4, 4, 0.9481, 0.004, 4, 0.5, 0.25, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.current_polygon_index > 0:\n if False == self.delete_empty_polygon():\n self.current_polygon_index -= 1\n print(\"current poly index: \", self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L941_C16", "label": "if", "type": "if", "loc": [941, 942], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L940_C12", "vector": [4, 5, 0.9481, 0.002, 5, 0.03, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False == self.delete_empty_polygon():\n self.current_polygon_index -= 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L943_C16", "label": "print()", "type": "expression", "loc": [943, 943], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L940_C12", "vector": [8, 5, 0.9496, 0.001, 5, 0.03, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"current poly index: \", self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L944_C12", "label": "update()", "type": "expression", "loc": [944, 944], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L938_C8", "vector": [8, 4, 0.9507, 0.001, 4, 0.5, 0.5, 637, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.update()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L945_C12", "label": "emit()", "type": "expression", "loc": [945, 945], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L938_C8", "vector": [8, 4, 0.9517, 0.001, 4, 0.5, 0.75, 627, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit(QtCore.SIGNAL(\"sigPolyChanged\"), self.polygons, self.current_polygon_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L946_C8", "label": "if", "type": "if", "loc": [946, 976], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L938_C8", "vector": [4, 4, 0.9678, 0.0312, 4, 0.5, 1.0, 0, 0, 0, 0, 0, 0, 0, 28], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif key == QtCore.Qt.Key_O:\n print('o')\n self.emit(QtCore.SIGNAL(\"sigPolyLabelChanged\"), self.current_polygon_index, 'object') \n elif key == QtCore.Qt.Key_S:\n print('s')\n self.emit(QtCore.SIGNAL(\"sigPolyLabelChanged\"), self.current_polygon_index, 'surface') \n elif key == QtCore.Qt.Key_R:\n print('r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L947_C12", "label": "print()", "type": "expression", "loc": [947, 947], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L946_C8", "vector": [8, 5, 0.9537, 0.001, 5, 0.41, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('o')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L948_C12", "label": "emit()", "type": "expression", "loc": [948, 948], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L946_C8", "vector": [8, 5, 0.9547, 0.001, 5, 0.41, 0.5, 627, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit(QtCore.SIGNAL(\"sigPolyLabelChanged\"), self.current_polygon_index, 'object') "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L949_C8", "label": "if", "type": "if", "loc": [949, 976], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L946_C8", "vector": [4, 5, 0.9693, 0.0282, 5, 0.41, 1.0, 0, 0, 0, 0, 0, 0, 0, 25], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif key == QtCore.Qt.Key_S:\n print('s')\n self.emit(QtCore.SIGNAL(\"sigPolyLabelChanged\"), self.current_polygon_index, 'surface') \n elif key == QtCore.Qt.Key_R:\n print('r')\n self.emit(QtCore.SIGNAL(\"sigPolyLabelChanged\"), self.current_polygon_index, 'roi') \n elif key == QtCore.Qt.Key_B:\n print('b')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L950_C12", "label": "print()", "type": "expression", "loc": [950, 950], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L949_C8", "vector": [8, 6, 0.9567, 0.001, 6, 0.46, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('s')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L951_C12", "label": "emit()", "type": "expression", "loc": [951, 951], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L949_C8", "vector": [8, 6, 0.9577, 0.001, 6, 0.46, 0.5, 627, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit(QtCore.SIGNAL(\"sigPolyLabelChanged\"), self.current_polygon_index, 'surface') "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L952_C8", "label": "if", "type": "if", "loc": [952, 976], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L949_C8", "vector": [4, 6, 0.9708, 0.0252, 6, 0.46, 1.0, 0, 0, 0, 0, 0, 0, 0, 22], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif key == QtCore.Qt.Key_R:\n print('r')\n self.emit(QtCore.SIGNAL(\"sigPolyLabelChanged\"), self.current_polygon_index, 'roi') \n elif key == QtCore.Qt.Key_B:\n print('b')\n self.emit(QtCore.SIGNAL(\"sigPolyLabelChanged\"), self.current_polygon_index, 'background') \n elif key == QtCore.Qt.Key_E:\n print('e')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L953_C12", "label": "print()", "type": "expression", "loc": [953, 953], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L952_C8", "vector": [8, 7, 0.9597, 0.001, 7, 0.46, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L954_C12", "label": "emit()", "type": "expression", "loc": [954, 954], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L952_C8", "vector": [8, 7, 0.9607, 0.001, 7, 0.46, 0.5, 627, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit(QtCore.SIGNAL(\"sigPolyLabelChanged\"), self.current_polygon_index, 'roi') "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L955_C8", "label": "if", "type": "if", "loc": [955, 976], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L952_C8", "vector": [4, 7, 0.9723, 0.0222, 7, 0.46, 1.0, 0, 0, 0, 0, 0, 0, 0, 19], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif key == QtCore.Qt.Key_B:\n print('b')\n self.emit(QtCore.SIGNAL(\"sigPolyLabelChanged\"), self.current_polygon_index, 'background') \n elif key == QtCore.Qt.Key_E:\n print('e')\n self.emit(QtCore.SIGNAL(\"sigPolyLabelChanged\"), self.current_polygon_index, 'edge') \n elif key == QtCore.Qt.Key_U:\n print('u')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L956_C12", "label": "print()", "type": "expression", "loc": [956, 956], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L955_C8", "vector": [8, 8, 0.9627, 0.001, 8, 0.03, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('b')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L957_C12", "label": "emit()", "type": "expression", "loc": [957, 957], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L955_C8", "vector": [8, 8, 0.9637, 0.001, 8, 0.03, 0.5, 627, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit(QtCore.SIGNAL(\"sigPolyLabelChanged\"), self.current_polygon_index, 'background') "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L958_C8", "label": "if", "type": "if", "loc": [958, 976], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L955_C8", "vector": [4, 8, 0.9738, 0.0191, 8, 0.03, 1.0, 0, 0, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif key == QtCore.Qt.Key_E:\n print('e')\n self.emit(QtCore.SIGNAL(\"sigPolyLabelChanged\"), self.current_polygon_index, 'edge') \n elif key == QtCore.Qt.Key_U:\n print('u')\n self.emit(QtCore.SIGNAL(\"sigPolyLabelChanged\"), self.current_polygon_index, 'edge_up') \n elif key == QtCore.Qt.Key_D:\n print('d')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L959_C12", "label": "print()", "type": "expression", "loc": [959, 959], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L958_C8", "vector": [8, 9, 0.9658, 0.001, 9, 0.5, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('e')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L960_C12", "label": "emit()", "type": "expression", "loc": [960, 960], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L958_C8", "vector": [8, 9, 0.9668, 0.001, 9, 0.5, 0.5, 627, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit(QtCore.SIGNAL(\"sigPolyLabelChanged\"), self.current_polygon_index, 'edge') "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L961_C8", "label": "if", "type": "if", "loc": [961, 976], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L958_C8", "vector": [4, 9, 0.9753, 0.0161, 9, 0.5, 1.0, 0, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif key == QtCore.Qt.Key_U:\n print('u')\n self.emit(QtCore.SIGNAL(\"sigPolyLabelChanged\"), self.current_polygon_index, 'edge_up') \n elif key == QtCore.Qt.Key_D:\n print('d')\n self.emit(QtCore.SIGNAL(\"sigPolyLabelChanged\"), self.current_polygon_index, 'edge_down') \n elif key == QtCore.Qt.Key_Plus:\n print('+')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L962_C12", "label": "print()", "type": "expression", "loc": [962, 962], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L961_C8", "vector": [8, 10, 0.9688, 0.001, 10, 0.02, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('u')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L963_C12", "label": "emit()", "type": "expression", "loc": [963, 963], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L961_C8", "vector": [8, 10, 0.9698, 0.001, 10, 0.02, 0.5, 627, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit(QtCore.SIGNAL(\"sigPolyLabelChanged\"), self.current_polygon_index, 'edge_up') "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L964_C8", "label": "if", "type": "if", "loc": [964, 976], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L961_C8", "vector": [4, 10, 0.9768, 0.0131, 10, 0.02, 1.0, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif key == QtCore.Qt.Key_D:\n print('d')\n self.emit(QtCore.SIGNAL(\"sigPolyLabelChanged\"), self.current_polygon_index, 'edge_down') \n elif key == QtCore.Qt.Key_Plus:\n print('+')\n self.setScaleFactor(self.scaleFactor * 1.25)\n self.update() \n elif key == QtCore.Qt.Key_Minus:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L965_C12", "label": "print()", "type": "expression", "loc": [965, 965], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L964_C8", "vector": [8, 11, 0.9718, 0.001, 11, 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('d')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L966_C12", "label": "emit()", "type": "expression", "loc": [966, 966], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L964_C8", "vector": [8, 11, 0.9728, 0.001, 11, 0.13, 0.5, 627, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit(QtCore.SIGNAL(\"sigPolyLabelChanged\"), self.current_polygon_index, 'edge_down') "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L967_C8", "label": "if", "type": "if", "loc": [967, 976], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L964_C8", "vector": [4, 11, 0.9783, 0.0101, 11, 0.13, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif key == QtCore.Qt.Key_Plus:\n print('+')\n self.setScaleFactor(self.scaleFactor * 1.25)\n self.update() \n elif key == QtCore.Qt.Key_Minus:\n print('-')\n self.setScaleFactor(self.scaleFactor * 0.8)\n self.update() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L968_C12", "label": "print()", "type": "expression", "loc": [968, 968], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L967_C8", "vector": [8, 12, 0.9748, 0.001, 12, 0.9, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('+')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L969_C12", "label": "setScaleFactor()", "type": "expression", "loc": [969, 969], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L967_C8", "vector": [8, 12, 0.9758, 0.001, 12, 0.9, 0.3333, 230, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setScaleFactor", "arg_names": [], "import_names": [], "rhs_call_name": "setScaleFactor", "annotation": ""}, "snippet": " self.setScaleFactor(self.scaleFactor * 1.25)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L970_C12", "label": "update()", "type": "expression", "loc": [970, 970], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L967_C8", "vector": [8, 12, 0.9768, 0.001, 12, 0.9, 0.6667, 637, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.update() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L971_C8", "label": "if", "type": "if", "loc": [971, 976], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L967_C8", "vector": [4, 12, 0.9804, 0.006, 12, 0.9, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif key == QtCore.Qt.Key_Minus:\n print('-')\n self.setScaleFactor(self.scaleFactor * 0.8)\n self.update() \n else:\n QtGui.QWidget.keyPressEvent(self, event)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L972_C12", "label": "print()", "type": "expression", "loc": [972, 972], "level": 13, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L971_C8", "vector": [8, 13, 0.9789, 0.001, 13, 0.46, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('-')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L973_C12", "label": "setScaleFactor()", "type": "expression", "loc": [973, 973], "level": 13, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L971_C8", "vector": [8, 13, 0.9799, 0.001, 13, 0.46, 0.3333, 230, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setScaleFactor", "arg_names": [], "import_names": [], "rhs_call_name": "setScaleFactor", "annotation": ""}, "snippet": " self.setScaleFactor(self.scaleFactor * 0.8)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L974_C12", "label": "update()", "type": "expression", "loc": [974, 974], "level": 13, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L971_C8", "vector": [8, 13, 0.9809, 0.001, 13, 0.46, 0.6667, 637, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.update() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L976_C12", "label": "keyPressEvent()", "type": "expression", "loc": [976, 976], "level": 13, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L971_C8", "vector": [8, 13, 0.9829, 0.001, 13, 0.46, 1.0, 207, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "keyPressEvent", "arg_names": [], "import_names": [], "rhs_call_name": "keyPressEvent", "annotation": ""}, "snippet": " QtGui.QWidget.keyPressEvent(self, event)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L978_C4", "label": "get_polygons", "type": "function", "loc": [978, 979], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "vector": [2, 1, 0.9854, 0.002, 1, 0.83, 0.9231, 392, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_polygons", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_polygons(self):\n return self.polygons"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L979_C8", "label": "return", "type": "return", "loc": [979, 979], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L978_C4", "vector": [13, 2, 0.9859, 0.001, 2, 0.1, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.polygons"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L981_C4", "label": "get_current_polygon_index", "type": "function", "loc": [981, 982], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "vector": [2, 1, 0.9884, 0.002, 1, 0.83, 1.0, 330, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_current_polygon_index", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_current_polygon_index(self):\n return self.current_polygon_index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L982_C8", "label": "return", "type": "return", "loc": [982, 982], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L981_C4", "vector": [13, 2, 0.9889, 0.001, 2, 0.71, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.current_polygon_index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L988_C0", "label": "if", "type": "if", "loc": [988, 993], "level": 0, "parent": null, "vector": [4, 0, 0.9975, 0.006, 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 app = QtGui.QApplication(sys.argv)\n labeling_tool = labeling_tool('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling');#\n\n labeling_tool.show()\n sys.exit(app.exec_())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L989_C4", "label": "app = QApplication()", "type": "assigned_variable", "loc": [989, 989], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L988_C0", "vector": [14, 1, 0.996, 0.001, 1, 0.97, 0.0, 494, 3, 1, 0, 0, 447, 10, 1], "semantic": {"name": "app", "arg_names": [], "import_names": [], "rhs_call_name": "QApplication", "annotation": ""}, "snippet": " app = QtGui.QApplication(sys.argv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L990_C4", "label": "labeling_tool = labeling_tool()", "type": "assigned_variable", "loc": [990, 990], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L988_C0", "vector": [14, 1, 0.997, 0.001, 1, 0.97, 0.3333, 408, 3, 1, 0, 0, 408, 10, 1], "semantic": {"name": "labeling_tool", "arg_names": [], "import_names": [], "rhs_call_name": "labeling_tool", "annotation": ""}, "snippet": " labeling_tool = labeling_tool('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling');#"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L992_C4", "label": "show()", "type": "expression", "loc": [992, 992], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L988_C0", "vector": [8, 1, 0.999, 0.001, 1, 0.97, 0.6667, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " labeling_tool.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L993_C4", "label": "exit()", "type": "expression", "loc": [993, 993], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L988_C0", "vector": [8, 1, 1.0, 0.001, 1, 0.97, 1.0, 436, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(app.exec_())"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L254_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L270_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L285_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L288_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L291_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L292_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L294_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L297_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L300_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L300_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L301_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L301_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L302_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L301_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L304_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L306_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L306_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L308_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L310_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L312_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L313_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L314_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L313_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L316_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L318_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L318_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L319_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L318_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L320_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L322_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L323_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L324_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L326_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L328_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L329_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L330_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L331_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L333_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:While_L336_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L340_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L340_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L341_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L340_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L342_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L340_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L343_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L340_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L344_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L340_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L345_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L340_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L346_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L340_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L347_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L340_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L348_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L350_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L350_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L351_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L351_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L352_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L350_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L354_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L354_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L355_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L357_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L358_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L359_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L359_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L360_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L359_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L361_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L359_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L362_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L363_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L365_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L365_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L366_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L365_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L367_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L367_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L368_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L367_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L369_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L367_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L370_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L365_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L371_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L373_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L373_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L374_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L373_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L375_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L375_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L376_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L375_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L377_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L375_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L378_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L373_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L381_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L381_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L382_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L381_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L383_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L383_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L384_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L383_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L385_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L383_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L386_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L381_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L387_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L391_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L393_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L395_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L395_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L396_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L398_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L398_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L399_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L399_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L400_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L399_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L401_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L399_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L402_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L399_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L404_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L407_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L408_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L409_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L411_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L412_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L412_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L413_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L412_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L415_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L417_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L417_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L418_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L417_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L420_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L422_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L422_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L423_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L422_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L425_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L428_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L429_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L429_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L430_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L429_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L431_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L429_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L432_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L429_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L434_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L429_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L435_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L429_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L436_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L438_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L439_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L440_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L442_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L444_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L444_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L445_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L445_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L446_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L444_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L447_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L447_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L448_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L444_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L450_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L444_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L451_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L444_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L453_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L444_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L455_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L455_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L456_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L455_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L458_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L462_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L462_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L465_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L462_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L467_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L467_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L468_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L462_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L469_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L469_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L470_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L462_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L472_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L462_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L473_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L462_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L479_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L462_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L481_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L462_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:While_L484_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L487_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L487_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L489_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L489_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L490_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L493_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L494_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L495_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L498_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L499_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L500_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L504_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L505_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L509_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L488_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L510_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L512_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L512_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L513_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L513_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L514_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L514_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L515_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L513_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L517_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L513_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L518_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L513_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L519_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L513_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L520_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L513_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L521_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L513_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L525_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L513_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L526_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L529_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L529_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L530_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L530_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L531_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L531_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L532_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L530_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L534_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L530_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L535_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L530_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L536_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L530_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L538_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L530_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L539_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L530_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L542_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L530_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L543_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L545_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L545_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L546_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L546_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L547_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L545_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L549_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L545_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L550_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L552_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L552_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L553_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L553_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L554_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L552_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L556_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L552_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L557_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L560_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L560_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L561_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L563_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L563_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L565_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L565_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L566_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L563_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L569_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L563_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L571_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L563_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L573_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L563_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L575_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L577_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L577_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L579_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L579_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L580_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L577_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L583_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L577_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L585_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L577_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L586_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L588_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L588_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L590_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L590_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L591_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L588_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L594_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L588_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L596_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L588_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L597_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L600_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L600_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L601_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L601_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L602_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L600_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L603_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L600_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L604_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L600_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L605_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L600_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L606_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L608_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L608_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L609_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L609_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L610_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L608_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L611_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L608_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L612_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L608_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L613_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L608_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L614_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L616_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L616_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L617_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L617_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L618_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L616_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L619_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L621_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L621_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L622_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L622_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L623_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L622_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L624_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L621_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L625_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L628_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L629_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L630_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L631_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L632_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L633_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L634_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L635_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L636_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L638_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L639_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L640_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L627_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L641_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L644_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L644_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L646_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L646_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L647_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L644_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L648_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L648_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L649_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L644_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L650_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L650_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L651_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L644_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L653_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L644_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L654_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L644_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L655_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L657_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L657_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L658_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L657_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L662_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L664_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L664_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L665_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L665_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L666_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L664_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L667_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L664_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L668_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L670_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L670_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L671_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L671_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L672_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L670_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L673_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L670_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L674_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L676_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L676_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L677_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L677_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L678_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L676_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L680_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L676_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L681_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L676_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L682_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L676_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L684_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L686_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L686_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L687_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L687_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L688_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L686_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L690_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L690_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L691_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L691_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L692_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L691_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L693_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L686_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L695_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L697_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L697_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:While_L699_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:While_L699_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L700_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L697_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L703_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L703_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L704_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L704_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L705_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L704_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L707_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L697_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L708_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L710_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L710_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L711_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L710_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L712_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L710_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L714_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L710_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L715_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L710_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L716_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L710_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L717_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L710_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L718_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L710_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L719_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L710_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L721_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L723_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L723_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L724_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L726_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L726_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L728_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L726_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L729_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L734_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L736_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L736_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L737_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L736_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L739_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L736_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L741_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L736_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L743_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L736_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L744_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L736_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L747_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L736_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L748_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L736_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L750_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L752_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L752_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L753_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L752_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L754_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L756_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L756_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L757_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L757_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L758_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L757_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L760_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L757_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L761_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L756_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L763_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L756_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L764_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L756_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L765_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L756_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L766_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L756_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L768_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L756_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L769_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L756_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L770_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L773_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L773_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L774_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L773_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L775_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L773_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L776_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L773_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L777_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L779_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L779_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L780_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L779_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L781_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L781_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L782_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L781_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L784_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L779_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L786_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L779_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L787_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L789_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L789_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L791_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L789_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L792_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L789_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L793_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L789_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L795_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L796_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L797_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L798_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L799_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L800_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L801_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L802_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L804_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L804_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L806_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L804_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L807_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L804_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L808_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L808_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L809_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L809_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L810_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L809_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L811_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L811_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L812_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L811_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L813_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L813_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L814_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L813_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L815_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L815_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L816_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L815_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L817_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L817_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L818_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L817_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L819_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L819_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L820_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L819_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L822_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L808_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L824_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L804_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L826_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L826_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L827_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L827_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L828_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L826_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L829_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L826_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L830_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L804_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L833_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L833_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L834_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L833_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L836_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L836_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L837_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L794_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L839_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L839_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L840_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L839_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L841_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L839_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L842_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:For_L842_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L843_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L789_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L844_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L847_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L847_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L849_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L849_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L850_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L850_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L851_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L851_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L853_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L851_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L854_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L851_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L855_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L851_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L856_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L850_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L857_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L857_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L858_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L858_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L859_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L858_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L860_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L858_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L861_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L850_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L862_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L862_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L864_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L862_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L865_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L862_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L866_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L866_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L867_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L866_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L868_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L868_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L869_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L868_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L871_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L868_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L872_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L862_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L875_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L875_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L876_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L875_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L878_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L879_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L880_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L882_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L883_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L884_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L885_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L886_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L887_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L888_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L889_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L892_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L877_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L893_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L849_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L898_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L900_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L900_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L901_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L901_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L902_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L902_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L903_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L902_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L904_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L902_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L905_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L907_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L907_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L908_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L908_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L910_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L908_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L911_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L908_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L912_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L914_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L914_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L915_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L915_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L917_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L917_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L919_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L917_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L921_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L917_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L922_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L914_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L923_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L925_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L925_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L926_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L925_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L927_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L927_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L928_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L927_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L929_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L929_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L930_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L929_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L932_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L929_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L934_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L929_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L935_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L927_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L936_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L927_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L937_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L927_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L938_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L938_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L939_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L938_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L940_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L940_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L941_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L940_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L943_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L938_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L944_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L938_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L945_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L938_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L946_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L946_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L947_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L946_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L948_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L946_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L949_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L949_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L950_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L949_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L951_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L949_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L952_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L952_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L953_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L952_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L954_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L952_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L955_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L955_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L956_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L955_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L957_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L955_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L958_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L958_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L959_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L958_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L960_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L958_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L961_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L961_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L962_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L961_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L963_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L961_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L964_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L964_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L965_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L964_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L966_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L964_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L967_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L967_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L968_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L967_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L969_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L967_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L970_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L967_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L971_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L971_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L972_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L971_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L973_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L971_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L974_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L971_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L976_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L978_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L978_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L979_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:ClassDef_L731_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L981_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:FunctionDef_L981_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Return_L982_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L988_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L989_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L988_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Assign_L990_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L988_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L992_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99713:If_L988_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99713:Expr_L993_C4"}]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) import roslib; roslib.load_manifest('laser_camera_segmentation') from labeling import label_object, scan_dataset, scans_database import copy ##WARNING! THIS DOES A PARTIAL COPY OF A DATABASE! BACKUP BEFOREHAND AND KNOW WHAT YOU'RE DOING!!## path = '/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling' f1 = 'database_changed.pkl' db1 = scans_database.scans_database() db1.load(path, f1) f2 = 'database.pkl' db2 = scans_database.scans_database() db2.load(path, f2) #assume db2 is equal or larger, copy changes from db1 to db2! d2 = db2.get_first_dataset() d1 = db1.get_first_dataset() while False != d1: if False != d2 and d1.id == d2.id: print 'copy', d1.id d2.dict = copy.deepcopy(d1.dict) d2 = db2.get_next_dataset() d1 = db1.get_next_dataset() db2.save()
ajibawa-2023/Python-Code-Large/train/row_99714
20
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_99714:Import_L29_C0", "label": "roslib import roslib", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.4915, 0.0169, 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; roslib.load_manifest('laser_camera_segmentation')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99714:Expr_L29_C15", "label": "load_manifest()", "type": "expression", "loc": [29, 29], "level": 0, "parent": null, "vector": [8, 0, 0.4915, 0.0169, 0, 0.66, 0.0714, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('laser_camera_segmentation')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99714:ImportFrom_L30_C0", "label": "from labeling import label_object, scan_dataset, scans_database", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.5085, 0.0169, 0, 0.66, 0.1429, 948, 0, 3, 0, 0, 948, 0, 0], "semantic": {"name": "labeling", "arg_names": [], "import_names": ["label_object", "scan_dataset", "scans_database"], "rhs_call_name": "", "annotation": ""}, "snippet": "from labeling import label_object, scan_dataset, scans_database"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99714:Import_L32_C0", "label": "copy import copy", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.5424, 0.0169, 0, 0.66, 0.2143, 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_99714:Assign_L36_C0", "label": "path =", "type": "assigned_variable", "loc": [36, 36], "level": 0, "parent": null, "vector": [14, 0, 0.6102, 0.0169, 0, 0.66, 0.2857, 358, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "path = '/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99714:Assign_L37_C0", "label": "f1 =", "type": "assigned_variable", "loc": [37, 37], "level": 0, "parent": null, "vector": [14, 0, 0.6271, 0.0169, 0, 0.66, 0.3571, 282, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "f1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "f1 = 'database_changed.pkl'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99714:Assign_L38_C0", "label": "db1 = scans_database()", "type": "assigned_variable", "loc": [38, 38], "level": 0, "parent": null, "vector": [14, 0, 0.6441, 0.0169, 0, 0.66, 0.4286, 267, 3, 0, 0, 0, 332, 10, 1], "semantic": {"name": "db1", "arg_names": [], "import_names": [], "rhs_call_name": "scans_database", "annotation": ""}, "snippet": "db1 = scans_database.scans_database()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99714:Expr_L39_C0", "label": "load()", "type": "expression", "loc": [39, 39], "level": 0, "parent": null, "vector": [8, 0, 0.661, 0.0169, 0, 0.66, 0.5, 37, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "db1.load(path, f1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99714:Assign_L41_C0", "label": "f2 =", "type": "assigned_variable", "loc": [41, 41], "level": 0, "parent": null, "vector": [14, 0, 0.6949, 0.0169, 0, 0.66, 0.5714, 833, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "f2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "f2 = 'database.pkl'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99714:Assign_L42_C0", "label": "db2 = scans_database()", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 0.7119, 0.0169, 0, 0.66, 0.6429, 83, 3, 0, 0, 0, 332, 10, 1], "semantic": {"name": "db2", "arg_names": [], "import_names": [], "rhs_call_name": "scans_database", "annotation": ""}, "snippet": "db2 = scans_database.scans_database()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99714:Expr_L43_C0", "label": "load()", "type": "expression", "loc": [43, 43], "level": 0, "parent": null, "vector": [8, 0, 0.7288, 0.0169, 0, 0.66, 0.7143, 37, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "db2.load(path, f2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99714:Assign_L46_C0", "label": "d2 = get_first_dataset()", "type": "assigned_variable", "loc": [46, 46], "level": 0, "parent": null, "vector": [14, 0, 0.7797, 0.0169, 0, 0.66, 0.7857, 703, 3, 0, 0, 0, 189, 10, 1], "semantic": {"name": "d2", "arg_names": [], "import_names": [], "rhs_call_name": "get_first_dataset", "annotation": ""}, "snippet": "d2 = db2.get_first_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99714:Assign_L47_C0", "label": "d1 = get_first_dataset()", "type": "assigned_variable", "loc": [47, 47], "level": 0, "parent": null, "vector": [14, 0, 0.7966, 0.0169, 0, 0.66, 0.8571, 938, 3, 0, 0, 0, 189, 10, 1], "semantic": {"name": "d1", "arg_names": [], "import_names": [], "rhs_call_name": "get_first_dataset", "annotation": ""}, "snippet": "d1 = db1.get_first_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99714:While_L48_C0", "label": "while", "type": "while", "loc": [48, 55], "level": 0, "parent": null, "vector": [5, 0, 0.8729, 0.1356, 0, 0.66, 0.9286, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "while False != d1:\n\n if False != d2 and d1.id == d2.id:\n print('copy', d1.id)\n d2.dict = copy.deepcopy(d1.dict)\n \n d2 = db2.get_next_dataset()\n d1 = db1.get_next_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99714:If_L50_C4", "label": "if", "type": "if", "loc": [50, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99714:While_L48_C0", "vector": [4, 1, 0.8644, 0.0508, 1, 0.11, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False != d2 and d1.id == d2.id:\n print('copy', d1.id)\n d2.dict = copy.deepcopy(d1.dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99714:Expr_L51_C8", "label": "print()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99714:If_L50_C4", "vector": [8, 2, 0.8644, 0.0169, 2, 0.7, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('copy', d1.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99714:Assign_L52_C8", "label": "d2.dict = deepcopy()", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99714:If_L50_C4", "vector": [14, 2, 0.8814, 0.0169, 2, 0.7, 1.0, 374, 3, 1, 0, 0, 44, 10, 1], "semantic": {"name": "d2.dict", "arg_names": [], "import_names": [], "rhs_call_name": "deepcopy", "annotation": ""}, "snippet": " d2.dict = copy.deepcopy(d1.dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99714:Assign_L54_C4", "label": "d2 = get_next_dataset()", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99714:While_L48_C0", "vector": [14, 1, 0.9153, 0.0169, 1, 0.11, 0.5, 703, 3, 0, 0, 0, 672, 10, 1], "semantic": {"name": "d2", "arg_names": [], "import_names": [], "rhs_call_name": "get_next_dataset", "annotation": ""}, "snippet": " d2 = db2.get_next_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99714:Assign_L55_C4", "label": "d1 = get_next_dataset()", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99714:While_L48_C0", "vector": [14, 1, 0.9322, 0.0169, 1, 0.11, 1.0, 938, 3, 0, 0, 0, 672, 10, 1], "semantic": {"name": "d1", "arg_names": [], "import_names": [], "rhs_call_name": "get_next_dataset", "annotation": ""}, "snippet": " d1 = db1.get_next_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99714:Expr_L59_C0", "label": "save()", "type": "expression", "loc": [59, 59], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.0169, 0, 0.66, 1.0, 928, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "save", "arg_names": [], "import_names": [], "rhs_call_name": "save", "annotation": ""}, "snippet": "db2.save()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99714:While_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99714:If_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99714:If_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99714:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99714:If_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99714:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99714:While_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99714:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99714:While_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99714:Assign_L55_C4"}]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) import roslib; roslib.load_manifest('laser_camera_segmentation') from labeling import label_object, scan_dataset, scans_database scans_database = scans_database.scans_database() path = '/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling' filename = 'database.pkl' scans_database.load(path, filename) scans_database.add_attribute_to_every_dataset('ransac_table_plane') #dataset = scan_dataset.scan_dataset() #dataset.name = 'test2' #dataset.scan_filename = '' #dataset.image_filename = 'data/2009Oct01_112328_image.png' #scans_database.add_dataset(dataset) scans_database.save()
ajibawa-2023/Python-Code-Large/train/row_99715
9
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_99715:Import_L29_C0", "label": "roslib import roslib", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.617, 0.0213, 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; roslib.load_manifest('laser_camera_segmentation')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99715:Expr_L29_C15", "label": "load_manifest()", "type": "expression", "loc": [29, 29], "level": 0, "parent": null, "vector": [8, 0, 0.617, 0.0213, 0, 0.66, 0.125, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('laser_camera_segmentation')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99715:ImportFrom_L30_C0", "label": "from labeling import label_object, scan_dataset, scans_database", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.6383, 0.0213, 0, 0.66, 0.25, 948, 0, 3, 0, 0, 948, 0, 0], "semantic": {"name": "labeling", "arg_names": [], "import_names": ["label_object", "scan_dataset", "scans_database"], "rhs_call_name": "", "annotation": ""}, "snippet": "from labeling import label_object, scan_dataset, scans_database"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99715:Assign_L34_C0", "label": "scans_database = scans_database()", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.7234, 0.0213, 0, 0.66, 0.375, 332, 3, 0, 0, 0, 332, 10, 1], "semantic": {"name": "scans_database", "arg_names": [], "import_names": [], "rhs_call_name": "scans_database", "annotation": ""}, "snippet": "scans_database = scans_database.scans_database()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99715:Assign_L35_C0", "label": "path =", "type": "assigned_variable", "loc": [35, 35], "level": 0, "parent": null, "vector": [14, 0, 0.7447, 0.0213, 0, 0.66, 0.5, 358, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "path = '/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99715:Assign_L36_C0", "label": "filename =", "type": "assigned_variable", "loc": [36, 36], "level": 0, "parent": null, "vector": [14, 0, 0.766, 0.0213, 0, 0.66, 0.625, 275, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "filename = 'database.pkl'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99715:Expr_L37_C0", "label": "load()", "type": "expression", "loc": [37, 37], "level": 0, "parent": null, "vector": [8, 0, 0.7872, 0.0213, 0, 0.66, 0.75, 37, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "scans_database.load(path, filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99715:Expr_L38_C0", "label": "add_attribute_to_every_dataset()", "type": "expression", "loc": [38, 38], "level": 0, "parent": null, "vector": [8, 0, 0.8085, 0.0213, 0, 0.66, 0.875, 636, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_attribute_to_every_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "add_attribute_to_every_dataset", "annotation": ""}, "snippet": "scans_database.add_attribute_to_every_dataset('ransac_table_plane')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99715:Expr_L47_C0", "label": "save()", "type": "expression", "loc": [47, 47], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.0213, 0, 0.66, 1.0, 928, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "save", "arg_names": [], "import_names": [], "rhs_call_name": "save", "annotation": ""}, "snippet": "scans_database.save()"}]
[]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) import roslib; roslib.load_manifest('laser_camera_segmentation') from labeling import label_object, scan_dataset, scans_database scans_database = scans_database.scans_database() scans_database.path = '/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling' scans_database.filename = 'database.pkl' dataset = scan_dataset.scan_dataset() dataset.title = 'emtpy' dataset.id = '0' dataset.surface_id = '-1' dataset.scan_filename = '' dataset.image_filename = '' scans_database.add_dataset(dataset) #dataset = scan_dataset.scan_dataset() #dataset.name = 'test2' #dataset.scan_filename = '' #dataset.image_filename = 'data/2009Oct01_112328_image.png' #scans_database.add_dataset(dataset) scans_database.save()
ajibawa-2023/Python-Code-Large/train/row_99716
14
53
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99716:Import_L29_C0", "label": "roslib import roslib", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.5472, 0.0189, 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; roslib.load_manifest('laser_camera_segmentation')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99716:Expr_L29_C15", "label": "load_manifest()", "type": "expression", "loc": [29, 29], "level": 0, "parent": null, "vector": [8, 0, 0.5472, 0.0189, 0, 0.66, 0.0769, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('laser_camera_segmentation')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99716:ImportFrom_L30_C0", "label": "from labeling import label_object, scan_dataset, scans_database", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.566, 0.0189, 0, 0.66, 0.1538, 948, 0, 3, 0, 0, 948, 0, 0], "semantic": {"name": "labeling", "arg_names": [], "import_names": ["label_object", "scan_dataset", "scans_database"], "rhs_call_name": "", "annotation": ""}, "snippet": "from labeling import label_object, scan_dataset, scans_database"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99716:Assign_L34_C0", "label": "scans_database = scans_database()", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.6415, 0.0189, 0, 0.66, 0.2308, 332, 3, 0, 0, 0, 332, 10, 1], "semantic": {"name": "scans_database", "arg_names": [], "import_names": [], "rhs_call_name": "scans_database", "annotation": ""}, "snippet": "scans_database = scans_database.scans_database()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99716:Assign_L35_C0", "label": "scans_database.path =", "type": "assigned_variable", "loc": [35, 35], "level": 0, "parent": null, "vector": [14, 0, 0.6604, 0.0189, 0, 0.66, 0.3077, 812, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "scans_database.path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "scans_database.path = '/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99716:Assign_L36_C0", "label": "scans_database.filename =", "type": "assigned_variable", "loc": [36, 36], "level": 0, "parent": null, "vector": [14, 0, 0.6792, 0.0189, 0, 0.66, 0.3846, 759, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "scans_database.filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "scans_database.filename = 'database.pkl'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99716:Assign_L38_C0", "label": "dataset = scan_dataset()", "type": "assigned_variable", "loc": [38, 38], "level": 0, "parent": null, "vector": [14, 0, 0.717, 0.0189, 0, 0.66, 0.4615, 603, 3, 0, 0, 0, 727, 10, 1], "semantic": {"name": "dataset", "arg_names": [], "import_names": [], "rhs_call_name": "scan_dataset", "annotation": ""}, "snippet": "dataset = scan_dataset.scan_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99716:Assign_L39_C0", "label": "dataset.title =", "type": "assigned_variable", "loc": [39, 39], "level": 0, "parent": null, "vector": [14, 0, 0.7358, 0.0189, 0, 0.66, 0.5385, 476, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "dataset.title", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "dataset.title = 'emtpy'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99716:Assign_L40_C0", "label": "dataset.id =", "type": "assigned_variable", "loc": [40, 40], "level": 0, "parent": null, "vector": [14, 0, 0.7547, 0.0189, 0, 0.66, 0.6154, 900, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "dataset.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "dataset.id = '0'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99716:Assign_L41_C0", "label": "dataset.surface_id =", "type": "assigned_variable", "loc": [41, 41], "level": 0, "parent": null, "vector": [14, 0, 0.7736, 0.0189, 0, 0.66, 0.6923, 927, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "dataset.surface_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "dataset.surface_id = '-1'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99716:Assign_L42_C0", "label": "dataset.scan_filename =", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 0.7925, 0.0189, 0, 0.66, 0.7692, 312, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "dataset.scan_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "dataset.scan_filename = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99716:Assign_L43_C0", "label": "dataset.image_filename =", "type": "assigned_variable", "loc": [43, 43], "level": 0, "parent": null, "vector": [14, 0, 0.8113, 0.0189, 0, 0.66, 0.8462, 356, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "dataset.image_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "dataset.image_filename = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99716:Expr_L44_C0", "label": "add_dataset()", "type": "expression", "loc": [44, 44], "level": 0, "parent": null, "vector": [8, 0, 0.8302, 0.0189, 0, 0.66, 0.9231, 326, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "add_dataset", "annotation": ""}, "snippet": "scans_database.add_dataset(dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99716:Expr_L53_C0", "label": "save()", "type": "expression", "loc": [53, 53], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.0189, 0, 0.66, 1.0, 928, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "save", "arg_names": [], "import_names": [], "rhs_call_name": "save", "annotation": ""}, "snippet": "scans_database.save()"}]
[]
## Copyright (c) 2004-2007, Andrew D. Straw. All rights reserved. ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions are ## met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above ## copyright notice, this list of conditions and the following ## disclaimer in the documentation and/or other materials provided ## with the distribution. ## * Neither the name of the Andrew D. Straw nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##Original code was modified, PlaneLeastSquaresModel() added: # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) import numpy import numpy as np import scipy # use numpy if scipy unavailable import scipy.linalg # use numpy if scipy unavailable def ransac(data,model,n,k,t,d,debug=False,return_all=False): print 'INFO: running RANSAC for k=',k,'iterations' """fit model parameters to data using the RANSAC algorithm This implementation written from pseudocode found at http://en.wikipedia.org/w/index.php?title=RANSAC&oldid=116358182 {{{ Given: data - a set of observed data points model - a model that can be fitted to data points n - the minimum number of data values required to fit the model k - the maximum number of iterations allowed in the algorithm t - a threshold value for determining when a data point fits a model d - the number of close data values required to assert that a model fits well to data Return: bestfit - model parameters which best fit the data (or nil if no good model is found) iterations = 0 bestfit = nil besterr = something really large while iterations < k { maybeinliers = n randomly selected values from data maybemodel = model parameters fitted to maybeinliers alsoinliers = empty set for every point in data not in maybeinliers { if point fits maybemodel with an error smaller than t add point to alsoinliers } if the number of elements in alsoinliers is > d { % this implies that we may have found a good model % now test how good it is bettermodel = model parameters fitted to all points in maybeinliers and alsoinliers thiserr = a measure of how well model fits these points if thiserr < besterr { bestfit = bettermodel besterr = thiserr } } increment iterations } return bestfit }}} """ # iterations = 0 # bestfit = None # besterr = numpy.inf # best_inlier_idxs = None # while iterations < k: # maybe_idxs, test_idxs = random_partition(n,data.shape[0]) # print n # maybeinliers = data[maybe_idxs,:] # #print 'z',maybeinliers # test_points = data[test_idxs] # maybemodel = model.fit(maybeinliers) # test_err = model.get_error( test_points, maybemodel) # also_idxs = test_idxs[test_err < t] # select indices of rows with accepted points # alsoinliers = data[also_idxs,:] # if debug: # print 'test_err.min()',test_err.min() # print 'test_err.max()',test_err.max() # print 'numpy.mean(test_err)',numpy.mean(test_err) # print 'iteration %d:len(alsoinliers) = %d'%( # iterations,len(alsoinliers)) # if len(alsoinliers) > d: # print numpy.asmatrix(maybeinliers), numpy.asmatrix(alsoinliers) # betterdata = numpy.concatenate( (maybeinliers, numpy.asmatrix(alsoinliers)) ) # bettermodel = model.fit(numpy.asarray(betterdata)) # better_errs = model.get_error( betterdata, bettermodel) # thiserr = numpy.mean( better_errs ) # if thiserr < besterr: # bestfit = bettermodel # besterr = thiserr # print maybe_idxs, also_idxs # best_inlier_idxs = numpy.concatenate( (maybe_idxs, [also_idxs]) ) # iterations+=1 # if bestfit is None: # raise ValueError("did not meet fit acceptance criteria") # if return_all: # return bestfit, {'inliers':best_inlier_idxs} # else: # return bestfit iterations = 0 bestfit = None besterr = numpy.inf best_inlier_idxs = None while iterations < k: #print data maybe_idxs, test_idxs = random_partition(n,data.shape[0]) maybeinliers = data[maybe_idxs,:] test_points = data[test_idxs] maybemodel = model.fit(maybeinliers) test_err = model.get_error( test_points, maybemodel) also_idxs = test_idxs[test_err < t] # select indices of rows with accepted points alsoinliers = data[also_idxs,:] if debug: print 'test_err.min()',test_err.min() print 'test_err.max()',test_err.max() print 'numpy.mean(test_err)',numpy.mean(test_err) print 'iteration %d:len(alsoinliers) = %d'%( iterations,len(alsoinliers)) if len(alsoinliers) > d: betterdata = numpy.concatenate( (maybeinliers, alsoinliers) ) bettermodel = model.fit(betterdata) better_errs = model.get_error( betterdata, bettermodel) thiserr = numpy.mean( better_errs ) if thiserr < besterr: bestfit = bettermodel besterr = thiserr best_inlier_idxs = numpy.concatenate( (maybe_idxs, also_idxs) ) iterations+=1 if bestfit is None: raise ValueError("did not meet fit acceptance criteria") if return_all: return bestfit, {'inliers':best_inlier_idxs} else: return bestfit def random_partition(n,n_data): """return n random rows of data (and also the other len(data)-n rows)""" all_idxs = numpy.arange( n_data ) numpy.random.shuffle(all_idxs) idxs1 = all_idxs[:n] idxs2 = all_idxs[n:] return idxs1, idxs2 class LinearLeastSquaresModel: """linear system solved using linear least squares This class serves as an example that fulfills the model interface needed by the ransac() function. """ def __init__(self,input_columns,output_columns,debug=False): self.input_columns = input_columns self.output_columns = output_columns self.debug = debug def fit(self, data): A = numpy.vstack([data[:,i] for i in self.input_columns]).T B = numpy.vstack([data[:,i] for i in self.output_columns]).T x,resids,rank,s = scipy.linalg.lstsq(A,B) return x def get_error( self, data, model): A = numpy.vstack([data[:,i] for i in self.input_columns]).T B = numpy.vstack([data[:,i] for i in self.output_columns]).T B_fit = scipy.dot(A,model) err_per_point = numpy.sum((B-B_fit)**2,axis=1) # sum squared error per row print err_per_point return err_per_point class PlaneLeastSquaresModel: def __init__(self, debug=False): self.debug = debug def fit(self, data): #print 'fit',data model = [data[0],numpy.cross(data[1] - data[0], data[2] - data[1])] #point, normal model[1] = model[1] / numpy.linalg.norm(model[1]) #normalize return model def get_error( self, data, model): #reject model if it's not horizontal max_angle = 30.0 * np.pi / 180.0 angle = np.arccos(scipy.dot(np.array([0,0,1]),model[1].T)) #normal is normalized #print 'angle', angle / np.pi * 180.0 if abs(angle) > max_angle: return np.ones(np.shape(data)[0]) * 999999999999999999999999999999 #http://de.wikipedia.org/wiki/Hessesche_Normalform #print model[0], model[1] d = scipy.dot(model[0],model[1].T) #print 'd',d s = scipy.dot(data, model[1].T) - d #print 'dmds',data, model, d, 's',s #err_per_point = numpy.sum(numpy.asarray(s)**2, axis=1) # sum squared error per row #return err_per_point return abs(s) def test(): # generate perfect input data n_samples = 500 n_inputs = 1 n_outputs = 1 A_exact = 20*numpy.random.random((n_samples,n_inputs) ) perfect_fit = 60*numpy.random.normal(size=(n_inputs,n_outputs) ) # the model B_exact = scipy.dot(A_exact,perfect_fit) assert B_exact.shape == (n_samples,n_outputs) # add a little gaussian noise (linear least squares alone should handle this well) A_noisy = A_exact + numpy.random.normal(size=A_exact.shape ) B_noisy = B_exact + numpy.random.normal(size=B_exact.shape ) if 1: # add some outliers n_outliers = 100 all_idxs = numpy.arange( A_noisy.shape[0] ) numpy.random.shuffle(all_idxs) outlier_idxs = all_idxs[:n_outliers] non_outlier_idxs = all_idxs[n_outliers:] A_noisy[outlier_idxs] = 20*numpy.random.random((n_outliers,n_inputs) ) B_noisy[outlier_idxs] = 50*numpy.random.normal(size=(n_outliers,n_outputs) ) # setup model all_data = numpy.hstack( (A_noisy,B_noisy) ) input_columns = range(n_inputs) # the first columns of the array output_columns = [n_inputs+i for i in range(n_outputs)] # the last columns of the array debug = False model = LinearLeastSquaresModel(input_columns,output_columns,debug=debug) linear_fit,resids,rank,s = scipy.linalg.lstsq(all_data[:,input_columns], all_data[:,output_columns]) # run RANSAC algorithm ransac_fit, ransac_data = ransac(all_data,model, 50, 1000, 7e3, 300, # misc. parameters debug=debug,return_all=True) if 1: import pylab sort_idxs = numpy.argsort(A_exact[:,0]) A_col0_sorted = A_exact[sort_idxs] # maintain as rank-2 array if 1: pylab.plot( A_noisy[:,0], B_noisy[:,0], 'k.', label='data' ) pylab.plot( A_noisy[ransac_data['inliers'],0], B_noisy[ransac_data['inliers'],0], 'bx', label='RANSAC data' ) else: pylab.plot( A_noisy[non_outlier_idxs,0], B_noisy[non_outlier_idxs,0], 'k.', label='noisy data' ) pylab.plot( A_noisy[outlier_idxs,0], B_noisy[outlier_idxs,0], 'r.', label='outlier data' ) pylab.plot( A_col0_sorted[:,0], numpy.dot(A_col0_sorted,ransac_fit)[:,0], label='RANSAC fit' ) pylab.plot( A_col0_sorted[:,0], numpy.dot(A_col0_sorted,perfect_fit)[:,0], label='exact system' ) pylab.plot( A_col0_sorted[:,0], numpy.dot(A_col0_sorted,linear_fit)[:,0], label='linear fit' ) pylab.legend() pylab.show() def testPlane(): debug = True model = PlaneLeastSquaresModel(debug) data = numpy.array([[0,0,0],[0,1,0],[0.1,12,0.1],[0,0,12],[1,0,0],[1,2,13]]) # run RANSAC algorithm ransac_fit, ransac_data = ransac(data,model, 3, 1000, 1, 2, # misc. parameters debug=debug,return_all=True) print ransac_fit print ransac_data def testPlanePointcloud(): import roslib; roslib.load_manifest('laser_camera_segmentation') import laser_camera_segmentation.processor as processor import laser_camera_segmentation.configuration as configuration cfg = configuration.configuration('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling') #sc = scanner.scanner(cfg) pc = processor.processor(cfg) #pc.load_data('2009Oct30_162400') pc.load_data('2009Nov04_141226') pc.process_raw_data() debug = False model = PlaneLeastSquaresModel(debug) data = numpy.asarray(pc.pts3d_bound).T # run RANSAC algorithm ransac_fit, ransac_data = ransac(data,model, 3, 1000, 0.02, 300, # misc. parameters debug=debug,return_all=True) print ransac_fit print ransac_data print 'len inlier',len(ransac_data['inliers']),'shape pts',np.shape(pc.pts3d_bound) pc.pts3d_bound = pc.pts3d_bound[:,ransac_data['inliers']] pc.display_3d('height') if __name__=='__main__': #testPlane() testPlanePointcloud()
ajibawa-2023/Python-Code-Large/train/row_99717
141
324
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Import_L36_C0", "label": "numpy import numpy", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.0031, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["numpy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Import_L37_C0", "label": "numpy import np", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.1142, 0.0031, 0, 0.66, 0.0909, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Import_L38_C0", "label": "scipy import scipy", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.1173, 0.0031, 0, 0.66, 0.1818, 265, 0, 1, 0, 0, 265, 0, 0], "semantic": {"name": "scipy", "arg_names": [], "import_names": ["scipy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy # use numpy if scipy unavailable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Import_L39_C0", "label": "scipy.linalg import scipy.linalg", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.1204, 0.0031, 0, 0.66, 0.2727, 884, 0, 1, 0, 0, 884, 0, 0], "semantic": {"name": "scipy.linalg", "arg_names": [], "import_names": ["scipy.linalg"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.linalg # use numpy if scipy unavailable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L41_C0", "label": "ransac", "type": "function", "loc": [41, 154], "level": 0, "parent": null, "vector": [2, 0, 0.3009, 0.3519, 0, 0.66, 0.3636, 32, 0, 8, 1, 0, 0, 0, 17], "semantic": {"name": "ransac", "arg_names": ["data", "model", "n", "k", "t", "d", "debug", "return_all"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ransac(data,model,n,k,t,d,debug=False,return_all=False):\n print('INFO: running RANSAC for k=',k,'iterations')\n \"\"\"fit model parameters to data using the RANSAC algorithm\n \nThis implementation written from pseudocode found at\nhttp://en.wikipedia.org/w/index.php?title=RANSAC&oldid=116358182\n\n{{{"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L42_C4", "label": "print()", "type": "expression", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L41_C0", "vector": [8, 1, 0.1296, 0.0031, 1, 0.61, 0.0, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('INFO: running RANSAC for k=',k,'iterations')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L43_C4", "label": "expression", "type": "expression", "loc": [43, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L41_C0", "vector": [8, 1, 0.1944, 0.1265, 1, 0.61, 0.125, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"fit model parameters to data using the RANSAC algorithm\n \nThis implementation written from pseudocode found at\nhttp://en.wikipedia.org/w/index.php?title=RANSAC&oldid=116358182\n\n{{{\nGiven:\n data - a set of observed data points"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L122_C4", "label": "iterations =", "type": "assigned_variable", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L41_C0", "vector": [14, 1, 0.3765, 0.0031, 1, 0.61, 0.25, 143, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "iterations", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " iterations = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L123_C4", "label": "bestfit =", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L41_C0", "vector": [14, 1, 0.3796, 0.0031, 1, 0.61, 0.375, 706, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "bestfit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bestfit = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L124_C4", "label": "besterr =", "type": "assigned_variable", "loc": [124, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L41_C0", "vector": [14, 1, 0.3827, 0.0031, 1, 0.61, 0.5, 799, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "besterr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " besterr = numpy.inf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L125_C4", "label": "best_inlier_idxs =", "type": "assigned_variable", "loc": [125, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L41_C0", "vector": [14, 1, 0.3858, 0.0031, 1, 0.61, 0.625, 132, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "best_inlier_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_inlier_idxs = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:While_L126_C4", "label": "while", "type": "while", "loc": [126, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L41_C0", "vector": [5, 1, 0.4228, 0.071, 1, 0.61, 0.75, 0, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while iterations < k:\n #print data\n maybe_idxs, test_idxs = random_partition(n,data.shape[0])\n maybeinliers = data[maybe_idxs,:]\n test_points = data[test_idxs]\n maybemodel = model.fit(maybeinliers)\n test_err = model.get_error( test_points, maybemodel)\n also_idxs = test_idxs[test_err < t] # select indices of rows with accepted points"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L128_C8", "label": "maybe_idxs, test_idxs = random_partition()", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:While_L126_C4", "vector": [14, 2, 0.3951, 0.0031, 2, 0.87, 0.0, 331, 3, 2, 0, 0, 96, 10, 1], "semantic": {"name": "maybe_idxs, test_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "random_partition", "annotation": ""}, "snippet": " maybe_idxs, test_idxs = random_partition(n,data.shape[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L129_C8", "label": "maybeinliers =", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:While_L126_C4", "vector": [14, 2, 0.3981, 0.0031, 2, 0.87, 0.125, 407, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "maybeinliers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " maybeinliers = data[maybe_idxs,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L130_C8", "label": "test_points =", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:While_L126_C4", "vector": [14, 2, 0.4012, 0.0031, 2, 0.87, 0.25, 293, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test_points", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_points = data[test_idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L131_C8", "label": "maybemodel = fit()", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:While_L126_C4", "vector": [14, 2, 0.4043, 0.0031, 2, 0.87, 0.375, 118, 3, 1, 0, 0, 828, 10, 1], "semantic": {"name": "maybemodel", "arg_names": [], "import_names": [], "rhs_call_name": "fit", "annotation": ""}, "snippet": " maybemodel = model.fit(maybeinliers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L132_C8", "label": "test_err = get_error()", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:While_L126_C4", "vector": [14, 2, 0.4074, 0.0031, 2, 0.87, 0.5, 118, 3, 2, 0, 0, 186, 10, 1], "semantic": {"name": "test_err", "arg_names": [], "import_names": [], "rhs_call_name": "get_error", "annotation": ""}, "snippet": " test_err = model.get_error( test_points, maybemodel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L133_C8", "label": "also_idxs =", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:While_L126_C4", "vector": [14, 2, 0.4105, 0.0031, 2, 0.87, 0.625, 407, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "also_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " also_idxs = test_idxs[test_err < t] # select indices of rows with accepted points"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L134_C8", "label": "alsoinliers =", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:While_L126_C4", "vector": [14, 2, 0.4136, 0.0031, 2, 0.87, 0.75, 358, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "alsoinliers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alsoinliers = data[also_idxs,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L135_C8", "label": "if", "type": "if", "loc": [135, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:While_L126_C4", "vector": [4, 2, 0.4213, 0.0123, 2, 0.87, 0.875, 0, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if debug:\n print('test_err.min()',test_err.min())\n print('test_err.max()',test_err.max())\n print('numpy.mean(test_err)',numpy.mean(test_err))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L136_C12", "label": "print()", "type": "expression", "loc": [136, 136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L135_C8", "vector": [8, 3, 0.4198, 0.0031, 3, 0.55, 0.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('test_err.min()',test_err.min())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L137_C12", "label": "print()", "type": "expression", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L135_C8", "vector": [8, 3, 0.4228, 0.0031, 3, 0.55, 0.5, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('test_err.max()',test_err.max())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L138_C12", "label": "print()", "type": "expression", "loc": [138, 138], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L135_C8", "vector": [8, 3, 0.4259, 0.0031, 3, 0.55, 1.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('numpy.mean(test_err)',numpy.mean(test_err))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L139_C8", "label": "if", "type": "if", "loc": [139, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:While_L126_C4", "vector": [4, 2, 0.4414, 0.0278, 2, 0.87, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(alsoinliers) > d:\n betterdata = numpy.concatenate( (maybeinliers, alsoinliers) )\n bettermodel = model.fit(betterdata)\n better_errs = model.get_error( betterdata, bettermodel)\n thiserr = numpy.mean( better_errs )\n if thiserr < besterr:\n bestfit = bettermodel\n besterr = thiserr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L140_C12", "label": "betterdata = concatenate()", "type": "assigned_variable", "loc": [140, 140], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L139_C8", "vector": [14, 3, 0.4321, 0.0031, 3, 0.46, 0.0, 10, 3, 1, 0, 0, 63, 10, 1], "semantic": {"name": "betterdata", "arg_names": [], "import_names": [], "rhs_call_name": "concatenate", "annotation": ""}, "snippet": " betterdata = numpy.concatenate( (maybeinliers, alsoinliers) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L141_C12", "label": "bettermodel = fit()", "type": "assigned_variable", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L139_C8", "vector": [14, 3, 0.4352, 0.0031, 3, 0.46, 0.25, 969, 3, 1, 0, 0, 828, 10, 1], "semantic": {"name": "bettermodel", "arg_names": [], "import_names": [], "rhs_call_name": "fit", "annotation": ""}, "snippet": " bettermodel = model.fit(betterdata)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L142_C12", "label": "better_errs = get_error()", "type": "assigned_variable", "loc": [142, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L139_C8", "vector": [14, 3, 0.4383, 0.0031, 3, 0.46, 0.5, 117, 3, 2, 0, 0, 186, 10, 1], "semantic": {"name": "better_errs", "arg_names": [], "import_names": [], "rhs_call_name": "get_error", "annotation": ""}, "snippet": " better_errs = model.get_error( betterdata, bettermodel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L143_C12", "label": "thiserr = mean()", "type": "assigned_variable", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L139_C8", "vector": [14, 3, 0.4414, 0.0031, 3, 0.46, 0.75, 117, 3, 1, 0, 0, 856, 10, 1], "semantic": {"name": "thiserr", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " thiserr = numpy.mean( better_errs )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L144_C12", "label": "if", "type": "if", "loc": [144, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L139_C8", "vector": [4, 3, 0.4491, 0.0123, 3, 0.46, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if thiserr < besterr:\n bestfit = bettermodel\n besterr = thiserr\n best_inlier_idxs = numpy.concatenate( (maybe_idxs, also_idxs) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L145_C16", "label": "bestfit =", "type": "assigned_variable", "loc": [145, 145], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L144_C12", "vector": [14, 4, 0.4475, 0.0031, 4, 0.91, 0.0, 706, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "bestfit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bestfit = bettermodel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L146_C16", "label": "besterr =", "type": "assigned_variable", "loc": [146, 146], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L144_C12", "vector": [14, 4, 0.4506, 0.0031, 4, 0.91, 0.5, 799, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "besterr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " besterr = thiserr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L147_C16", "label": "best_inlier_idxs = concatenate()", "type": "assigned_variable", "loc": [147, 147], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L144_C12", "vector": [14, 4, 0.4537, 0.0031, 4, 0.91, 1.0, 132, 3, 1, 0, 0, 63, 10, 1], "semantic": {"name": "best_inlier_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "concatenate", "annotation": ""}, "snippet": " best_inlier_idxs = numpy.concatenate( (maybe_idxs, also_idxs) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L149_C4", "label": "if", "type": "if", "loc": [149, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L41_C0", "vector": [4, 1, 0.4614, 0.0062, 1, 0.61, 0.875, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if bestfit is None:\n raise ValueError(\"did not meet fit acceptance criteria\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L151_C4", "label": "if", "type": "if", "loc": [151, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L41_C0", "vector": [4, 1, 0.4707, 0.0123, 1, 0.61, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if return_all:\n return bestfit, {'inliers':best_inlier_idxs}\n else:\n return bestfit"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Return_L152_C8", "label": "return", "type": "return", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L151_C4", "vector": [13, 2, 0.4691, 0.0031, 2, 0.35, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bestfit, {'inliers':best_inlier_idxs}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Return_L154_C8", "label": "return", "type": "return", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L151_C4", "vector": [13, 2, 0.4753, 0.0031, 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 bestfit"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L157_C0", "label": "random_partition", "type": "function", "loc": [157, 163], "level": 0, "parent": null, "vector": [2, 0, 0.4938, 0.0216, 0, 0.66, 0.4545, 96, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "random_partition", "arg_names": ["n", "n_data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def random_partition(n,n_data):\n \"\"\"return n random rows of data (and also the other len(data)-n rows)\"\"\"\n all_idxs = numpy.arange( n_data )\n numpy.random.shuffle(all_idxs)\n idxs1 = all_idxs[:n]\n idxs2 = all_idxs[n:]\n return idxs1, idxs2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L158_C4", "label": "expression", "type": "expression", "loc": [158, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L157_C0", "vector": [8, 1, 0.4877, 0.0031, 1, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"return n random rows of data (and also the other len(data)-n rows)\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L159_C4", "label": "all_idxs = arange()", "type": "assigned_variable", "loc": [159, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L157_C0", "vector": [14, 1, 0.4907, 0.0031, 1, 0.93, 0.2, 960, 3, 1, 0, 0, 489, 10, 1], "semantic": {"name": "all_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " all_idxs = numpy.arange( n_data )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L160_C4", "label": "shuffle()", "type": "expression", "loc": [160, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L157_C0", "vector": [8, 1, 0.4938, 0.0031, 1, 0.93, 0.4, 903, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "shuffle", "arg_names": [], "import_names": [], "rhs_call_name": "shuffle", "annotation": ""}, "snippet": " numpy.random.shuffle(all_idxs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L161_C4", "label": "idxs1 =", "type": "assigned_variable", "loc": [161, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L157_C0", "vector": [14, 1, 0.4969, 0.0031, 1, 0.93, 0.6, 677, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "idxs1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " idxs1 = all_idxs[:n]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L162_C4", "label": "idxs2 =", "type": "assigned_variable", "loc": [162, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L157_C0", "vector": [14, 1, 0.5, 0.0031, 1, 0.93, 0.8, 730, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "idxs2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " idxs2 = all_idxs[n:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Return_L163_C4", "label": "return", "type": "return", "loc": [163, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L157_C0", "vector": [13, 1, 0.5031, 0.0031, 1, 0.93, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return idxs1, idxs2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:ClassDef_L165_C0", "label": "LinearLeastSquaresModel", "type": "class", "loc": [165, 187], "level": 0, "parent": null, "vector": [3, 0, 0.5432, 0.071, 0, 0.66, 0.5455, 613, 0, 3, 0, 0, 0, 0, 8], "semantic": {"name": "LinearLeastSquaresModel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class LinearLeastSquaresModel:\n \"\"\"linear system solved using linear least squares\n\n This class serves as an example that fulfills the model interface\n needed by the ransac() function.\n \n \"\"\"\n def __init__(self,input_columns,output_columns,debug=False):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L166_C4", "label": "expression", "type": "expression", "loc": [166, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:ClassDef_L165_C0", "vector": [8, 1, 0.5201, 0.0185, 1, 0.57, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"linear system solved using linear least squares\n\n This class serves as an example that fulfills the model interface\n needed by the ransac() function.\n \n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L172_C4", "label": "__init__", "type": "function", "loc": [172, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:ClassDef_L165_C0", "vector": [2, 1, 0.5355, 0.0123, 1, 0.57, 0.3333, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "input_columns", "output_columns", "debug"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self,input_columns,output_columns,debug=False):\n self.input_columns = input_columns\n self.output_columns = output_columns\n self.debug = debug"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L173_C8", "label": "self.input_columns =", "type": "assigned_variable", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L172_C4", "vector": [14, 2, 0.534, 0.0031, 2, 0.41, 0.0, 438, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.input_columns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.input_columns = input_columns"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L174_C8", "label": "self.output_columns =", "type": "assigned_variable", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L172_C4", "vector": [14, 2, 0.537, 0.0031, 2, 0.41, 0.5, 608, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.output_columns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.output_columns = output_columns"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L175_C8", "label": "self.debug =", "type": "assigned_variable", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L172_C4", "vector": [14, 2, 0.5401, 0.0031, 2, 0.41, 1.0, 168, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.debug", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.debug = debug"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L176_C4", "label": "fit", "type": "function", "loc": [176, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:ClassDef_L165_C0", "vector": [2, 1, 0.5494, 0.0154, 1, 0.57, 0.6667, 828, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "fit", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def fit(self, data):\n A = numpy.vstack([data[:,i] for i in self.input_columns]).T\n B = numpy.vstack([data[:,i] for i in self.output_columns]).T\n x,resids,rank,s = scipy.linalg.lstsq(A,B)\n return x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L177_C8", "label": "A =", "type": "assigned_variable", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L176_C4", "vector": [14, 2, 0.5463, 0.0031, 2, 0.63, 0.0, 429, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "A", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " A = numpy.vstack([data[:,i] for i in self.input_columns]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L178_C8", "label": "B =", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L176_C4", "vector": [14, 2, 0.5494, 0.0031, 2, 0.63, 0.3333, 197, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "B", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " B = numpy.vstack([data[:,i] for i in self.output_columns]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L179_C8", "label": "x, resids, rank, s = lstsq()", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L176_C4", "vector": [14, 2, 0.5525, 0.0031, 2, 0.63, 0.6667, 868, 3, 2, 0, 0, 318, 10, 1], "semantic": {"name": "x, resids, rank, s", "arg_names": [], "import_names": [], "rhs_call_name": "lstsq", "annotation": ""}, "snippet": " x,resids,rank,s = scipy.linalg.lstsq(A,B)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Return_L180_C8", "label": "return", "type": "return", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L176_C4", "vector": [13, 2, 0.5556, 0.0031, 2, 0.63, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L181_C4", "label": "get_error", "type": "function", "loc": [181, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:ClassDef_L165_C0", "vector": [2, 1, 0.5679, 0.0216, 1, 0.57, 1.0, 186, 0, 3, 1, 0, 0, 0, 5], "semantic": {"name": "get_error", "arg_names": ["self", "data", "model"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_error( self, data, model):\n A = numpy.vstack([data[:,i] for i in self.input_columns]).T\n B = numpy.vstack([data[:,i] for i in self.output_columns]).T\n B_fit = scipy.dot(A,model)\n err_per_point = numpy.sum((B-B_fit)**2,axis=1) # sum squared error per row\n print(err_per_point)\n return err_per_point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L182_C8", "label": "A =", "type": "assigned_variable", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L181_C4", "vector": [14, 2, 0.5617, 0.0031, 2, 0.29, 0.0, 429, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "A", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " A = numpy.vstack([data[:,i] for i in self.input_columns]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L183_C8", "label": "B =", "type": "assigned_variable", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L181_C4", "vector": [14, 2, 0.5648, 0.0031, 2, 0.29, 0.2, 197, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "B", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " B = numpy.vstack([data[:,i] for i in self.output_columns]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L184_C8", "label": "B_fit = dot()", "type": "assigned_variable", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L181_C4", "vector": [14, 2, 0.5679, 0.0031, 2, 0.29, 0.4, 214, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "B_fit", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " B_fit = scipy.dot(A,model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L185_C8", "label": "err_per_point = sum()", "type": "assigned_variable", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L181_C4", "vector": [14, 2, 0.571, 0.0031, 2, 0.29, 0.6, 931, 3, 2, 0, 0, 824, 10, 1], "semantic": {"name": "err_per_point", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " err_per_point = numpy.sum((B-B_fit)**2,axis=1) # sum squared error per row"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L186_C8", "label": "print()", "type": "expression", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L181_C4", "vector": [8, 2, 0.5741, 0.0031, 2, 0.29, 0.8, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(err_per_point)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Return_L187_C8", "label": "return", "type": "return", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L181_C4", "vector": [13, 2, 0.5772, 0.0031, 2, 0.29, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return err_per_point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:ClassDef_L189_C0", "label": "PlaneLeastSquaresModel", "type": "class", "loc": [189, 215], "level": 0, "parent": null, "vector": [3, 0, 0.6235, 0.0833, 0, 0.66, 0.6364, 15, 0, 3, 0, 0, 0, 0, 11], "semantic": {"name": "PlaneLeastSquaresModel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PlaneLeastSquaresModel:\n \n def __init__(self, debug=False):\n self.debug = debug\n def fit(self, data):\n #print 'fit',data\n model = [data[0],numpy.cross(data[1] - data[0], data[2] - data[1])] #point, normal\n model[1] = model[1] / numpy.linalg.norm(model[1]) #normalize"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L191_C4", "label": "__init__", "type": "function", "loc": [191, 192], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:ClassDef_L189_C0", "vector": [2, 1, 0.591, 0.0062, 1, 0.5, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "debug"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, debug=False):\n self.debug = debug"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L192_C8", "label": "self.debug =", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L191_C4", "vector": [14, 2, 0.5926, 0.0031, 2, 0.98, 0.0, 168, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.debug", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.debug = debug"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L193_C4", "label": "fit", "type": "function", "loc": [193, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:ClassDef_L189_C0", "vector": [2, 1, 0.6019, 0.0154, 1, 0.5, 0.5, 828, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "fit", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def fit(self, data):\n #print 'fit',data\n model = [data[0],numpy.cross(data[1] - data[0], data[2] - data[1])] #point, normal\n model[1] = model[1] / numpy.linalg.norm(model[1]) #normalize\n return model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L195_C8", "label": "model =", "type": "assigned_variable", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L193_C4", "vector": [14, 2, 0.6019, 0.0031, 2, 0.6, 0.0, 722, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " model = [data[0],numpy.cross(data[1] - data[0], data[2] - data[1])] #point, normal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L196_C8", "label": "assign", "type": "assigned_variable", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L193_C4", "vector": [14, 2, 0.6049, 0.0031, 2, 0.6, 0.5, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " model[1] = model[1] / numpy.linalg.norm(model[1]) #normalize"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Return_L197_C8", "label": "return", "type": "return", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L193_C4", "vector": [13, 2, 0.608, 0.0031, 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 model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L198_C4", "label": "get_error", "type": "function", "loc": [198, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:ClassDef_L189_C0", "vector": [2, 1, 0.6373, 0.0556, 1, 0.5, 1.0, 186, 0, 3, 1, 0, 0, 0, 9], "semantic": {"name": "get_error", "arg_names": ["self", "data", "model"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_error( self, data, model):\n \n #reject model if it's not horizontal\n max_angle = 30.0 * np.pi / 180.0\n angle = np.arccos(scipy.dot(np.array([0,0,1]),model[1].T)) #normal is normalized\n #print 'angle', angle / np.pi * 180.0\n \n if abs(angle) > max_angle:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L201_C8", "label": "max_angle =", "type": "assigned_variable", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L198_C4", "vector": [14, 2, 0.6204, 0.0031, 2, 0.1, 0.0, 451, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_angle = 30.0 * np.pi / 180.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L202_C8", "label": "angle = arccos()", "type": "assigned_variable", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L198_C4", "vector": [14, 2, 0.6235, 0.0031, 2, 0.1, 0.2, 418, 3, 1, 0, 0, 793, 10, 3], "semantic": {"name": "angle", "arg_names": [], "import_names": [], "rhs_call_name": "arccos", "annotation": ""}, "snippet": " angle = np.arccos(scipy.dot(np.array([0,0,1]),model[1].T)) #normal is normalized"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L205_C8", "label": "if", "type": "if", "loc": [205, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L198_C4", "vector": [4, 2, 0.6343, 0.0062, 2, 0.1, 0.4, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if abs(angle) > max_angle:\n return np.ones(np.shape(data)[0]) * 999999999999999999999999999999"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Return_L206_C12", "label": "return", "type": "return", "loc": [206, 206], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L205_C8", "vector": [13, 3, 0.6358, 0.0031, 3, 0.09, 0.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.ones(np.shape(data)[0]) * 999999999999999999999999999999"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L209_C8", "label": "d = dot()", "type": "assigned_variable", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L198_C4", "vector": [14, 2, 0.6451, 0.0031, 2, 0.1, 0.6, 355, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " d = scipy.dot(model[0],model[1].T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L211_C8", "label": "s =", "type": "assigned_variable", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L198_C4", "vector": [14, 2, 0.6512, 0.0031, 2, 0.1, 0.8, 553, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s = scipy.dot(data, model[1].T) - d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Return_L215_C8", "label": "return", "type": "return", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L198_C4", "vector": [13, 2, 0.6636, 0.0031, 2, 0.1, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return abs(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "label": "test", "type": "function", "loc": [217, 279], "level": 0, "parent": null, "vector": [2, 0, 0.7654, 0.1944, 0, 0.66, 0.7273, 224, 0, 0, 0, 0, 0, 0, 28], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test():\n # generate perfect input data\n\n n_samples = 500\n n_inputs = 1\n n_outputs = 1\n A_exact = 20*numpy.random.random((n_samples,n_inputs) )\n perfect_fit = 60*numpy.random.normal(size=(n_inputs,n_outputs) ) # the model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L220_C4", "label": "n_samples =", "type": "assigned_variable", "loc": [220, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "vector": [14, 1, 0.679, 0.0031, 1, 0.12, 0.0, 812, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "n_samples", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_samples = 500"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L221_C4", "label": "n_inputs =", "type": "assigned_variable", "loc": [221, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "vector": [14, 1, 0.6821, 0.0031, 1, 0.12, 0.0625, 424, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "n_inputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_inputs = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L222_C4", "label": "n_outputs =", "type": "assigned_variable", "loc": [222, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "vector": [14, 1, 0.6852, 0.0031, 1, 0.12, 0.125, 11, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "n_outputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_outputs = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L223_C4", "label": "A_exact =", "type": "assigned_variable", "loc": [223, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "vector": [14, 1, 0.6883, 0.0031, 1, 0.12, 0.1875, 889, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "A_exact", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " A_exact = 20*numpy.random.random((n_samples,n_inputs) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L224_C4", "label": "perfect_fit =", "type": "assigned_variable", "loc": [224, 224], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "vector": [14, 1, 0.6914, 0.0031, 1, 0.12, 0.25, 405, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "perfect_fit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " perfect_fit = 60*numpy.random.normal(size=(n_inputs,n_outputs) ) # the model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L225_C4", "label": "B_exact = dot()", "type": "assigned_variable", "loc": [225, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "vector": [14, 1, 0.6944, 0.0031, 1, 0.12, 0.3125, 254, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "B_exact", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " B_exact = scipy.dot(A_exact,perfect_fit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L229_C4", "label": "A_noisy =", "type": "assigned_variable", "loc": [229, 229], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "vector": [14, 1, 0.7068, 0.0031, 1, 0.12, 0.375, 126, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "A_noisy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " A_noisy = A_exact + numpy.random.normal(size=A_exact.shape )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L230_C4", "label": "B_noisy =", "type": "assigned_variable", "loc": [230, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "vector": [14, 1, 0.7099, 0.0031, 1, 0.12, 0.4375, 42, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "B_noisy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " B_noisy = B_exact + numpy.random.normal(size=B_exact.shape )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L232_C4", "label": "if", "type": "if", "loc": [232, 240], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "vector": [4, 1, 0.7284, 0.0278, 1, 0.12, 0.5, 0, 1, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 1:\n # add some outliers\n n_outliers = 100\n all_idxs = numpy.arange( A_noisy.shape[0] )\n numpy.random.shuffle(all_idxs)\n outlier_idxs = all_idxs[:n_outliers]\n non_outlier_idxs = all_idxs[n_outliers:]\n A_noisy[outlier_idxs] = 20*numpy.random.random((n_outliers,n_inputs) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L234_C8", "label": "n_outliers =", "type": "assigned_variable", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L232_C4", "vector": [14, 2, 0.7222, 0.0031, 2, 0.02, 0.0, 587, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "n_outliers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_outliers = 100"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L235_C8", "label": "all_idxs = arange()", "type": "assigned_variable", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L232_C4", "vector": [14, 2, 0.7253, 0.0031, 2, 0.02, 0.1667, 960, 3, 1, 0, 0, 489, 10, 1], "semantic": {"name": "all_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " all_idxs = numpy.arange( A_noisy.shape[0] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L236_C8", "label": "shuffle()", "type": "expression", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L232_C4", "vector": [8, 2, 0.7284, 0.0031, 2, 0.02, 0.3333, 903, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "shuffle", "arg_names": [], "import_names": [], "rhs_call_name": "shuffle", "annotation": ""}, "snippet": " numpy.random.shuffle(all_idxs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L237_C8", "label": "outlier_idxs =", "type": "assigned_variable", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L232_C4", "vector": [14, 2, 0.7315, 0.0031, 2, 0.02, 0.5, 167, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "outlier_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " outlier_idxs = all_idxs[:n_outliers]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L238_C8", "label": "non_outlier_idxs =", "type": "assigned_variable", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L232_C4", "vector": [14, 2, 0.7346, 0.0031, 2, 0.02, 0.6667, 913, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "non_outlier_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " non_outlier_idxs = all_idxs[n_outliers:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L239_C8", "label": "assign", "type": "assigned_variable", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L232_C4", "vector": [14, 2, 0.7377, 0.0031, 2, 0.02, 0.8333, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " A_noisy[outlier_idxs] = 20*numpy.random.random((n_outliers,n_inputs) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L240_C8", "label": "assign", "type": "assigned_variable", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L232_C4", "vector": [14, 2, 0.7407, 0.0031, 2, 0.02, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " B_noisy[outlier_idxs] = 50*numpy.random.normal(size=(n_outliers,n_outputs) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L244_C4", "label": "all_data = hstack()", "type": "assigned_variable", "loc": [244, 244], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "vector": [14, 1, 0.7531, 0.0031, 1, 0.12, 0.5625, 688, 3, 1, 0, 0, 85, 10, 1], "semantic": {"name": "all_data", "arg_names": [], "import_names": [], "rhs_call_name": "hstack", "annotation": ""}, "snippet": " all_data = numpy.hstack( (A_noisy,B_noisy) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L245_C4", "label": "input_columns = range()", "type": "assigned_variable", "loc": [245, 245], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "vector": [14, 1, 0.7562, 0.0031, 1, 0.12, 0.625, 839, 3, 1, 0, 0, 816, 10, 1], "semantic": {"name": "input_columns", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": " input_columns = range(n_inputs) # the first columns of the array"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L246_C4", "label": "output_columns =", "type": "assigned_variable", "loc": [246, 246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "vector": [14, 1, 0.7593, 0.0031, 1, 0.12, 0.6875, 58, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "output_columns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " output_columns = [n_inputs+i for i in range(n_outputs)] # the last columns of the array"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L247_C4", "label": "debug =", "type": "assigned_variable", "loc": [247, 247], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "vector": [14, 1, 0.7623, 0.0031, 1, 0.12, 0.75, 924, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " debug = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L248_C4", "label": "model = LinearLeastSquaresModel()", "type": "assigned_variable", "loc": [248, 248], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "vector": [14, 1, 0.7654, 0.0031, 1, 0.12, 0.8125, 722, 3, 3, 0, 0, 613, 10, 1], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "LinearLeastSquaresModel", "annotation": ""}, "snippet": " model = LinearLeastSquaresModel(input_columns,output_columns,debug=debug)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L250_C4", "label": "linear_fit, resids, rank, s = lstsq()", "type": "assigned_variable", "loc": [250, 251], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "vector": [14, 1, 0.7731, 0.0062, 1, 0.12, 0.875, 407, 3, 2, 0, 0, 318, 10, 1], "semantic": {"name": "linear_fit, resids, rank, s", "arg_names": [], "import_names": [], "rhs_call_name": "lstsq", "annotation": ""}, "snippet": " linear_fit,resids,rank,s = scipy.linalg.lstsq(all_data[:,input_columns],\n all_data[:,output_columns])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L254_C4", "label": "ransac_fit, ransac_data = ransac()", "type": "assigned_variable", "loc": [254, 256], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "vector": [14, 1, 0.787, 0.0093, 1, 0.12, 0.9375, 711, 3, 8, 0, 0, 32, 10, 1], "semantic": {"name": "ransac_fit, ransac_data", "arg_names": [], "import_names": [], "rhs_call_name": "ransac", "annotation": ""}, "snippet": " ransac_fit, ransac_data = ransac(all_data,model,\n 50, 1000, 7e3, 300, # misc. parameters\n debug=debug,return_all=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L257_C4", "label": "if", "type": "if", "loc": [257, 279], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "vector": [4, 1, 0.8272, 0.071, 1, 0.12, 1.0, 0, 1, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 1:\n import pylab\n\n sort_idxs = numpy.argsort(A_exact[:,0])\n A_col0_sorted = A_exact[sort_idxs] # maintain as rank-2 array\n\n if 1:\n pylab.plot( A_noisy[:,0], B_noisy[:,0], 'k.', label='data' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Import_L258_C8", "label": "pylab import pylab", "type": "import", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L257_C4", "vector": [1, 2, 0.7963, 0.0031, 2, 0.9, 0.0, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "pylab", "arg_names": [], "import_names": ["pylab"], "rhs_call_name": "", "annotation": ""}, "snippet": " import pylab"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L260_C8", "label": "sort_idxs = argsort()", "type": "assigned_variable", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L257_C4", "vector": [14, 2, 0.8025, 0.0031, 2, 0.9, 0.125, 625, 3, 1, 0, 0, 237, 10, 1], "semantic": {"name": "sort_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "argsort", "annotation": ""}, "snippet": " sort_idxs = numpy.argsort(A_exact[:,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L261_C8", "label": "A_col0_sorted =", "type": "assigned_variable", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L257_C4", "vector": [14, 2, 0.8056, 0.0031, 2, 0.9, 0.25, 838, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "A_col0_sorted", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " A_col0_sorted = A_exact[sort_idxs] # maintain as rank-2 array"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L263_C8", "label": "if", "type": "if", "loc": [263, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L257_C4", "vector": [4, 2, 0.8194, 0.0185, 2, 0.9, 0.375, 0, 1, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 1:\n pylab.plot( A_noisy[:,0], B_noisy[:,0], 'k.', label='data' )\n pylab.plot( A_noisy[ransac_data['inliers'],0], B_noisy[ransac_data['inliers'],0], 'bx', label='RANSAC data' )\n else:\n pylab.plot( A_noisy[non_outlier_idxs,0], B_noisy[non_outlier_idxs,0], 'k.', label='noisy data' )\n pylab.plot( A_noisy[outlier_idxs,0], B_noisy[outlier_idxs,0], 'r.', label='outlier data' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L264_C12", "label": "plot()", "type": "expression", "loc": [264, 264], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L263_C8", "vector": [8, 3, 0.8148, 0.0031, 3, 0.19, 0.0, 929, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pylab.plot( A_noisy[:,0], B_noisy[:,0], 'k.', label='data' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L265_C12", "label": "plot()", "type": "expression", "loc": [265, 265], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L263_C8", "vector": [8, 3, 0.8179, 0.0031, 3, 0.19, 0.3333, 929, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pylab.plot( A_noisy[ransac_data['inliers'],0], B_noisy[ransac_data['inliers'],0], 'bx', label='RANSAC data' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L267_C12", "label": "plot()", "type": "expression", "loc": [267, 267], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L263_C8", "vector": [8, 3, 0.8241, 0.0031, 3, 0.19, 0.6667, 929, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pylab.plot( A_noisy[non_outlier_idxs,0], B_noisy[non_outlier_idxs,0], 'k.', label='noisy data' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L268_C12", "label": "plot()", "type": "expression", "loc": [268, 268], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L263_C8", "vector": [8, 3, 0.8272, 0.0031, 3, 0.19, 1.0, 929, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pylab.plot( A_noisy[outlier_idxs,0], B_noisy[outlier_idxs,0], 'r.', label='outlier data' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L269_C8", "label": "plot()", "type": "expression", "loc": [269, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L257_C4", "vector": [8, 2, 0.8333, 0.0093, 2, 0.9, 0.5, 929, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pylab.plot( A_col0_sorted[:,0],\n numpy.dot(A_col0_sorted,ransac_fit)[:,0],\n label='RANSAC fit' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L272_C8", "label": "plot()", "type": "expression", "loc": [272, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L257_C4", "vector": [8, 2, 0.8426, 0.0093, 2, 0.9, 0.625, 929, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pylab.plot( A_col0_sorted[:,0],\n numpy.dot(A_col0_sorted,perfect_fit)[:,0],\n label='exact system' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L275_C8", "label": "plot()", "type": "expression", "loc": [275, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L257_C4", "vector": [8, 2, 0.8519, 0.0093, 2, 0.9, 0.75, 929, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pylab.plot( A_col0_sorted[:,0],\n numpy.dot(A_col0_sorted,linear_fit)[:,0],\n label='linear fit' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L278_C8", "label": "legend()", "type": "expression", "loc": [278, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L257_C4", "vector": [8, 2, 0.858, 0.0031, 2, 0.9, 0.875, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " pylab.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L279_C8", "label": "show()", "type": "expression", "loc": [279, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L257_C4", "vector": [8, 2, 0.8611, 0.0031, 2, 0.9, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " pylab.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L282_C0", "label": "testPlane", "type": "function", "loc": [282, 294], "level": 0, "parent": null, "vector": [2, 0, 0.8889, 0.0401, 0, 0.66, 0.8182, 980, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "testPlane", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def testPlane():\n\n\n\n debug = True\n model = PlaneLeastSquaresModel(debug)\n data = numpy.array([[0,0,0],[0,1,0],[0.1,12,0.1],[0,0,12],[1,0,0],[1,2,13]])\n # run RANSAC algorithm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L286_C4", "label": "debug =", "type": "assigned_variable", "loc": [286, 286], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L282_C0", "vector": [14, 1, 0.8827, 0.0031, 1, 0.4, 0.0, 924, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " debug = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L287_C4", "label": "model = PlaneLeastSquaresModel()", "type": "assigned_variable", "loc": [287, 287], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L282_C0", "vector": [14, 1, 0.8858, 0.0031, 1, 0.4, 0.2, 722, 3, 1, 0, 0, 15, 10, 1], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "PlaneLeastSquaresModel", "annotation": ""}, "snippet": " model = PlaneLeastSquaresModel(debug)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L288_C4", "label": "data = array()", "type": "assigned_variable", "loc": [288, 288], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L282_C0", "vector": [14, 1, 0.8889, 0.0031, 1, 0.4, 0.4, 929, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " data = numpy.array([[0,0,0],[0,1,0],[0.1,12,0.1],[0,0,12],[1,0,0],[1,2,13]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L290_C4", "label": "ransac_fit, ransac_data = ransac()", "type": "assigned_variable", "loc": [290, 292], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L282_C0", "vector": [14, 1, 0.8981, 0.0093, 1, 0.4, 0.6, 711, 3, 8, 0, 0, 32, 10, 1], "semantic": {"name": "ransac_fit, ransac_data", "arg_names": [], "import_names": [], "rhs_call_name": "ransac", "annotation": ""}, "snippet": " ransac_fit, ransac_data = ransac(data,model,\n 3, 1000, 1, 2, # misc. parameters\n debug=debug,return_all=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L293_C4", "label": "print()", "type": "expression", "loc": [293, 293], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L282_C0", "vector": [8, 1, 0.9043, 0.0031, 1, 0.4, 0.8, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(ransac_fit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L294_C4", "label": "print()", "type": "expression", "loc": [294, 294], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L282_C0", "vector": [8, 1, 0.9074, 0.0031, 1, 0.4, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(ransac_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "label": "testPlanePointcloud", "type": "function", "loc": [296, 320], "level": 0, "parent": null, "vector": [2, 0, 0.9506, 0.0772, 0, 0.66, 0.9091, 762, 0, 0, 0, 0, 0, 0, 14], "semantic": {"name": "testPlanePointcloud", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def testPlanePointcloud():\n import roslib; roslib.load_manifest('laser_camera_segmentation')\n import laser_camera_segmentation.processor as processor\n import laser_camera_segmentation.configuration as configuration \n\n cfg = configuration.configuration('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling')\n #sc = scanner.scanner(cfg)\n pc = processor.processor(cfg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Import_L297_C4", "label": "roslib import roslib", "type": "import", "loc": [297, 297], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "vector": [1, 1, 0.9167, 0.0031, 1, 0.9, 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; roslib.load_manifest('laser_camera_segmentation')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L297_C19", "label": "load_manifest()", "type": "expression", "loc": [297, 297], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "vector": [8, 1, 0.9167, 0.0031, 1, 0.9, 0.0625, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": " import roslib; roslib.load_manifest('laser_camera_segmentation')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Import_L298_C4", "label": "laser_camera_segmentation.processor import processor", "type": "import", "loc": [298, 298], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "vector": [1, 1, 0.9198, 0.0031, 1, 0.9, 0.125, 235, 0, 1, 0, 0, 235, 0, 0], "semantic": {"name": "laser_camera_segmentation.processor", "arg_names": [], "import_names": ["processor"], "rhs_call_name": "", "annotation": ""}, "snippet": " import laser_camera_segmentation.processor as processor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Import_L299_C4", "label": "laser_camera_segmentation.configuration import configuration", "type": "import", "loc": [299, 299], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "vector": [1, 1, 0.9228, 0.0031, 1, 0.9, 0.1875, 995, 0, 1, 0, 0, 995, 0, 0], "semantic": {"name": "laser_camera_segmentation.configuration", "arg_names": [], "import_names": ["configuration"], "rhs_call_name": "", "annotation": ""}, "snippet": " import laser_camera_segmentation.configuration as configuration "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L301_C4", "label": "cfg = configuration()", "type": "assigned_variable", "loc": [301, 301], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "vector": [14, 1, 0.929, 0.0031, 1, 0.9, 0.25, 46, 3, 1, 0, 0, 627, 10, 1], "semantic": {"name": "cfg", "arg_names": [], "import_names": [], "rhs_call_name": "configuration", "annotation": ""}, "snippet": " cfg = configuration.configuration('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L303_C4", "label": "pc = processor()", "type": "assigned_variable", "loc": [303, 303], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "vector": [14, 1, 0.9352, 0.0031, 1, 0.9, 0.3125, 876, 3, 1, 0, 0, 177, 10, 1], "semantic": {"name": "pc", "arg_names": [], "import_names": [], "rhs_call_name": "processor", "annotation": ""}, "snippet": " pc = processor.processor(cfg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L305_C4", "label": "load_data()", "type": "expression", "loc": [305, 305], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "vector": [8, 1, 0.9414, 0.0031, 1, 0.9, 0.375, 477, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_data", "arg_names": [], "import_names": [], "rhs_call_name": "load_data", "annotation": ""}, "snippet": " pc.load_data('2009Nov04_141226')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L306_C4", "label": "process_raw_data()", "type": "expression", "loc": [306, 306], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "vector": [8, 1, 0.9444, 0.0031, 1, 0.9, 0.4375, 553, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "process_raw_data", "arg_names": [], "import_names": [], "rhs_call_name": "process_raw_data", "annotation": ""}, "snippet": " pc.process_raw_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L309_C4", "label": "debug =", "type": "assigned_variable", "loc": [309, 309], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "vector": [14, 1, 0.9537, 0.0031, 1, 0.9, 0.5, 924, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " debug = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L310_C4", "label": "model = PlaneLeastSquaresModel()", "type": "assigned_variable", "loc": [310, 310], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "vector": [14, 1, 0.9568, 0.0031, 1, 0.9, 0.5625, 722, 3, 1, 0, 0, 15, 10, 1], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "PlaneLeastSquaresModel", "annotation": ""}, "snippet": " model = PlaneLeastSquaresModel(debug)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L311_C4", "label": "data =", "type": "assigned_variable", "loc": [311, 311], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "vector": [14, 1, 0.9599, 0.0031, 1, 0.9, 0.625, 929, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data = numpy.asarray(pc.pts3d_bound).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L313_C4", "label": "ransac_fit, ransac_data = ransac()", "type": "assigned_variable", "loc": [313, 315], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "vector": [14, 1, 0.9691, 0.0093, 1, 0.9, 0.6875, 711, 3, 8, 0, 0, 32, 10, 1], "semantic": {"name": "ransac_fit, ransac_data", "arg_names": [], "import_names": [], "rhs_call_name": "ransac", "annotation": ""}, "snippet": " ransac_fit, ransac_data = ransac(data,model,\n 3, 1000, 0.02, 300, # misc. parameters\n debug=debug,return_all=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L316_C4", "label": "print()", "type": "expression", "loc": [316, 316], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "vector": [8, 1, 0.9753, 0.0031, 1, 0.9, 0.75, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(ransac_fit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L317_C4", "label": "print()", "type": "expression", "loc": [317, 317], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "vector": [8, 1, 0.9784, 0.0031, 1, 0.9, 0.8125, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(ransac_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L318_C4", "label": "print()", "type": "expression", "loc": [318, 318], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "vector": [8, 1, 0.9815, 0.0031, 1, 0.9, 0.875, 535, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('len inlier',len(ransac_data['inliers']),'shape pts',np.shape(pc.pts3d_bound))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L319_C4", "label": "pc.pts3d_bound =", "type": "assigned_variable", "loc": [319, 319], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "vector": [14, 1, 0.9846, 0.0031, 1, 0.9, 0.9375, 228, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pc.pts3d_bound", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.pts3d_bound = pc.pts3d_bound[:,ransac_data['inliers']]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L320_C4", "label": "display_3d()", "type": "expression", "loc": [320, 320], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "vector": [8, 1, 0.9877, 0.0031, 1, 0.9, 1.0, 989, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "display_3d", "arg_names": [], "import_names": [], "rhs_call_name": "display_3d", "annotation": ""}, "snippet": " pc.display_3d('height')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L322_C0", "label": "if", "type": "if", "loc": [322, 324], "level": 0, "parent": null, "vector": [4, 0, 0.9969, 0.0093, 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 #testPlane()\n testPlanePointcloud()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L324_C4", "label": "testPlanePointcloud()", "type": "expression", "loc": [324, 324], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L322_C0", "vector": [8, 1, 1.0, 0.0031, 1, 0.65, 0.0, 762, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "testPlanePointcloud", "arg_names": [], "import_names": [], "rhs_call_name": "testPlanePointcloud", "annotation": ""}, "snippet": " testPlanePointcloud()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:While_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:While_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:While_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:While_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:While_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:While_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:While_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:While_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:While_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L138_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:While_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L142_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L144_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L145_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L144_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L146_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L144_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L147_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Return_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Return_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Return_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:ClassDef_L165_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:ClassDef_L165_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:ClassDef_L165_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Return_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:ClassDef_L165_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Return_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:ClassDef_L189_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:ClassDef_L189_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L193_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L193_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L193_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Return_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:ClassDef_L189_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L198_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L198_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L198_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L198_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L205_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Return_L206_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L198_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L198_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L198_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Return_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L220_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L223_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L224_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L229_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L230_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L232_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L244_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L245_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L246_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L247_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L250_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L254_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L257_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Import_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L263_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L264_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L263_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L265_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L263_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L267_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L263_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L268_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L282_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L286_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L282_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L287_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L282_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L288_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L282_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L290_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L282_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L293_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L282_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L294_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Import_L297_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L297_C19"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Import_L298_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Import_L299_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L301_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L303_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L305_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L306_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L309_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L310_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L311_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L313_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L316_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L317_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L318_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Assign_L319_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:FunctionDef_L296_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L320_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99717:If_L322_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99717:Expr_L324_C4"}]
#!/usr/bin/python # # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Travis Deyle (Healthcare Robotics Lab, Georgia Tech.) # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) import time import hrl_lib.util as ut import opencv as cv import opencv.highgui as hg import pycessing as pyc import transforms as tr import numpy as np,math import tilting_hokuyo.processing_3d as p3d #import math_util as mu def scale(image, s): scaled = cv.cvCreateImage(cv.cvSize(int(image.width * s), int(image.height * s)), image.depth, image.nChannels) cv.cvResize(image, scaled, cv.CV_INTER_AREA) return scaled class Callib(): def __init__(self, transFunc, seeds, deltas, names, pts, img, cam_proj_mat, cam_centers, zoom, id): ''' transFunc => takes in param vector, returns homogeneous Xform seeds => initial param vector (1XM array) deltas => step sizes in param vector quantities (1XM array) pts => 3D points to be mapped into img (3XN array) img => an OpenCV image from the camera ''' self.dataset_id = id # Note that adaptors are deprecated... imgTmp = cv.cvCloneImage(img) imNP = cv.adaptors.Ipl2NumPy(imgTmp) self.height = imNP.shape[0] * zoom self.width = imNP.shape[1] * zoom self.zoom = zoom pyc.size(self.width + 200, self.height) #pyc.size(self.height + 200, self.width + 200) self.pts = pts self.img = img self.vals = seeds self.selected = np.zeros( self.vals.shape[0] ) self.selected[0] = 1.0 self.dels = deltas self.names = names self.transFunc = transFunc self.cam_proj_mat = cam_proj_mat self.cam_centers = cam_centers self.display_laser = True def reDraw(self): pyc.background(255) pyc.lightSpecular(255*30/640, 255*30/640, 255*30/640) pyc.directionalLight(255,255,255,0,0,1) pyc.specular(102, 102, 102) # Project self.pts into image, and display it imgTmp = cv.cvCloneImage(self.img) imNP = cv.adaptors.Ipl2NumPy(scale(imgTmp, self.zoom)) color_list = [(255,255,0),(255,0,0),(0,255,255),(0,255,0),(0,0,255),(0,100,100),(100,100,0), (100,0,100),(100,200,100),(200,100,100),(100,100,200),(100,0,200),(0,200,100), (0,100,200),(200,0,100),(100,0,100),(255,152,7) ] XformPts = tr.transform( self.transFunc(self.vals), self.pts ) camPts = self.cam_proj_mat * tr.xyzToHomogenous(XformPts) camPts = camPts / camPts[2] camPts[0] = (camPts[0] + self.cam_centers[0]) * self.zoom camPts[1] = (camPts[1] + self.cam_centers[1]) * self.zoom camPts = np.matrix( np.round(camPts), 'int') conditions = np.concatenate([camPts[0] >= 0, camPts[0] < imNP.shape[1], camPts[1] >= 0, camPts[1] < imNP.shape[0]], 0) r, c = np.where(np.all(conditions, 0)) camPts_bound = camPts[:, c.A[0]] x = np.asarray(self.pts[0])[0][c.A[0]] x = x - x.min() x = x / x.max() * 256 #512 #number of colors x = np.floor(x) x = np.asarray(np.matrix(x,'int'))[0] if self.display_laser: map2d = np.asarray(camPts_bound[0:2]) n,m = map2d.shape for i in range(0,m): imNP[map2d[1,i],map2d[0,i], :] = [x[i],256-x[i],128+x[i]/2]#color_list[x[i]] imgTmp = cv.adaptors.NumPy2Ipl(imNP) #imgSmall = cv.cvCreateImage(cv.cvSize(imgTmp.width/3, imgTmp.height/3), cv.IPL_DEPTH_8U, 3) #cv.cvResize(imgTmp, imgSmall, cv.CV_INTER_AREA) im = cv.adaptors.Ipl2PIL(imgTmp) #pyc.rotate(math.radians(90)) pyc.image(im, 0,0, self.width, self.height) #pyc.rotate(math.radians(-90)) # Display the current values of the parameter vector (and highlight the selected one) pyc.textSize(10) for i, val in enumerate(self.vals): if np.nonzero(self.selected)[0] == i: print 'x', print '%8.4f ' % self.vals[i], pval = '%7s: %8.4f' % (self.names[i], self.vals[i]) pyc.text(pval, self.width + 15, 20 + 20*i, 0) if np.nonzero(self.selected)[0] == i: pyc.fill(255,0,0) pyc.quad(self.width+4.0, 15.0 + 20.0*i - 7.0, self.width+4.0, 15.0 + 20.0*i + 7.0, self.width+13.0, 15.0 + 20.0*i, self.width+13.0, 15.0 + 20.0*i) print '\n' self.move(pyc.escape_handler(pyc.draw())) def move(self, events): if len(events) > 0: for event in events: currselect = np.nonzero( self.selected )[0] if event.type == pyc.KEYDOWN: if event.key == pyc.K_DOWN: self.selected[currselect] = 0 self.selected[ ut.bound(currselect + 1, 0, self.selected.shape[0]-1) ] = 1 if event.key == pyc.K_UP: self.selected[currselect] = 0 self.selected[ ut.bound(currselect - 1, 0, self.selected.shape[0]-1) ] = 1 if event.key == pyc.K_LEFT: self.vals[currselect] -= self.dels[currselect] if event.key == pyc.K_RIGHT: self.vals[currselect] += self.dels[currselect] if event.key == pyc.K_SPACE: self.display_laser = not self.display_laser if event.key == pyc.K_RETURN: self.display3d() return events def display3d(self): import laser_camera_segmentation.processor as processor import laser_camera_segmentation.configuration as configuration print 'display in 3d...' cfg = configuration.configuration('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling') cfg.cam_vec = np.array(self.vals) import scanr_transforms as trs cfg.camTlaser = trs.camTlaser(cfg.cam_vec) pc = processor.processor(cfg) pc.load_data(self.dataset_id) pc.process_raw_data() pc.display_3d('labels', False) if __name__ == '__main__': import optparse p = optparse.OptionParser() p.add_option('-c', action='store', type='string', dest='image', default='xxcalib.png', help='camera image') p.add_option('-p', action='store', type='string', dest='point_cloud', default='xxcalib.pkl', help='pickle file containing a point cloud matrix expressed in the laser\'s frame') p.add_option('-n', action='store', type='string', dest='camera_name', default='eleUTM', help='name of camera as specified in camera_config.py') opt, args = p.parse_args() image_filename = opt.image point_cloud_filename = opt.point_cloud def cameraTlaser(vec): x, y, z, r1, r2, r3, r4 = vec disp = np.matrix([x, y, z]).T rot1 = tr.Rx(math.radians(r1)) rot2 = tr.Rz(math.radians(r2)) rot3 = tr.Rx(math.radians(r3)) rot4 = tr.Rz(math.radians(r4)) rt = rot4 * rot3 * rot2 * rot1 laserTcam = tr.composeHomogeneousTransform(rt, disp) trans = tr.invertHomogeneousTransform(laserTcam) return trans #seeds = np.array([0.018, -0.057, 0.015, 91.2, 90.8, 0.0]) #seeds = np.array([0.013, -0.027, 0.025, 91.2, 92.8, 0.0]) #seeds = np.array([0.013, -0.032, 0.01, 91.4, 93.2, 0.0]) #seeds = np.array([ 0.003, 0.1 , -0.02, 89.8, 89.8, 90.0, 0]) seeds = np.array([ -0.087, 0.105 , 0.01, 89.8, 89.8, 90.0, 0]) #deltas = np.array([0.005, 0.005, 0.005, 0.1, 0.1, 0.1, 0.1]) #seeds = np.array([0.061, 0.032, -0.035, 0.8, 0.9, -1.7, 3.1 ]) deltas = np.array([0.001, 0.001, 0.001, 0.1, 0.1, 0.1, 0.1]) #self.cam_names = ['Ry_0', 'Rz_0', 'Rx_-90', 'Rz_-90', 'dx', 'dy', 'dz'] names = ['x_disp', 'y_disp', 'z_disp', 'rotX', 'rotZ', 'rotX', 'rotZ'] img = hg.cvLoadImage(image_filename) raw_laser_scans = ut.load_pickle(point_cloud_filename) #if raw_laser_scans.__class__ == ().__class__: poses, scans = raw_laser_scans['laserscans'][0] points_cloud_laser = p3d.generate_pointcloud(poses, scans, math.radians(-180), math.radians(180), 0, .035, max_dist=5, min_dist=.2) #else: # points_cloud_laser = raw_laser_scans import webcam_config as cc cp = cc.webcam_parameters['DesktopWebcam'] fx = cp['focal_length_x_in_pixels'] fy = cp['focal_length_y_in_pixels'] cam_proj_mat = np.matrix([[fx, 0, 0, 0], [0, fy, 0, 0], [0, 0, 1, 0]]) cam_centers = ( cp['optical_center_x_in_pixels'], cp['optical_center_y_in_pixels'] ) c = Callib(cameraTlaser, seeds, deltas, names, points_cloud_laser, img, cam_proj_mat, cam_centers, 1/1.0) while True: c.reDraw()
ajibawa-2023/Python-Code-Large/train/row_99718
141
249
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Import_L33_C0", "label": "time import time", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.1325, 0.004, 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_99718:Import_L34_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.1365, 0.004, 0, 0.66, 0.1, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Import_L35_C0", "label": "opencv import cv", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.1406, 0.004, 0, 0.66, 0.2, 437, 0, 1, 0, 0, 437, 0, 0], "semantic": {"name": "opencv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import opencv as cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Import_L36_C0", "label": "opencv.highgui import hg", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.1446, 0.004, 0, 0.66, 0.3, 453, 0, 1, 0, 0, 453, 0, 0], "semantic": {"name": "opencv.highgui", "arg_names": [], "import_names": ["hg"], "rhs_call_name": "", "annotation": ""}, "snippet": "import opencv.highgui as hg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Import_L37_C0", "label": "pycessing import pyc", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.1486, 0.004, 0, 0.66, 0.4, 850, 0, 1, 0, 0, 850, 0, 0], "semantic": {"name": "pycessing", "arg_names": [], "import_names": ["pyc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pycessing as pyc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Import_L38_C0", "label": "transforms import tr", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.1526, 0.004, 0, 0.66, 0.5, 578, 0, 1, 0, 0, 578, 0, 0], "semantic": {"name": "transforms", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Import_L39_C0", "label": "numpy import np, math", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.1566, 0.004, 0, 0.66, 0.6, 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_99718:Import_L40_C0", "label": "tilting_hokuyo.processing_3d import p3d", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.1606, 0.004, 0, 0.66, 0.7, 474, 0, 1, 0, 0, 474, 0, 0], "semantic": {"name": "tilting_hokuyo.processing_3d", "arg_names": [], "import_names": ["p3d"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tilting_hokuyo.processing_3d as p3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L43_C0", "label": "scale", "type": "function", "loc": [43, 46], "level": 0, "parent": null, "vector": [2, 0, 0.1787, 0.0161, 0, 0.66, 0.8, 18, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "scale", "arg_names": ["image", "s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def scale(image, s):\n scaled = cv.cvCreateImage(cv.cvSize(int(image.width * s), int(image.height * s)), image.depth, image.nChannels)\n cv.cvResize(image, scaled, cv.CV_INTER_AREA)\n return scaled"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L44_C4", "label": "scaled = cvCreateImage()", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L43_C0", "vector": [14, 1, 0.1767, 0.004, 1, 0.84, 0.0, 396, 3, 3, 0, 0, 953, 10, 4], "semantic": {"name": "scaled", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateImage", "annotation": ""}, "snippet": " scaled = cv.cvCreateImage(cv.cvSize(int(image.width * s), int(image.height * s)), image.depth, image.nChannels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L45_C4", "label": "cvResize()", "type": "expression", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L43_C0", "vector": [8, 1, 0.1807, 0.004, 1, 0.84, 0.5, 382, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "cvResize", "arg_names": [], "import_names": [], "rhs_call_name": "cvResize", "annotation": ""}, "snippet": " cv.cvResize(image, scaled, cv.CV_INTER_AREA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Return_L46_C4", "label": "return", "type": "return", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L43_C0", "vector": [13, 1, 0.1847, 0.004, 1, 0.84, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return scaled"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:ClassDef_L48_C0", "label": "Callib", "type": "class", "loc": [48, 182], "level": 0, "parent": null, "vector": [3, 0, 0.4618, 0.5422, 0, 0.66, 0.9, 724, 0, 4, 0, 0, 0, 0, 56], "semantic": {"name": "Callib", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Callib():\n def __init__(self, transFunc, seeds, deltas, names, pts, img, cam_proj_mat, cam_centers, zoom, id):\n '''\n transFunc => takes in param vector, returns homogeneous Xform\n seeds => initial param vector (1XM array)\n deltas => step sizes in param vector quantities (1XM array)\n pts => 3D points to be mapped into img (3XN array)\n img => an OpenCV image from the camera"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "label": "__init__", "type": "function", "loc": [49, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:ClassDef_L48_C0", "vector": [2, 1, 0.257, 0.1245, 1, 0.36, 0.0, 555, 0, 11, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "transFunc", "seeds", "deltas", "names", "pts", "img", "cam_proj_mat", "cam_centers", "zoom", "id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, transFunc, seeds, deltas, names, pts, img, cam_proj_mat, cam_centers, zoom, id):\n '''\n transFunc => takes in param vector, returns homogeneous Xform\n seeds => initial param vector (1XM array)\n deltas => step sizes in param vector quantities (1XM array)\n pts => 3D points to be mapped into img (3XN array)\n img => an OpenCV image from the camera\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L50_C8", "label": "expression", "type": "expression", "loc": [50, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "vector": [8, 2, 0.2129, 0.0281, 2, 0.21, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n transFunc => takes in param vector, returns homogeneous Xform\n seeds => initial param vector (1XM array)\n deltas => step sizes in param vector quantities (1XM array)\n pts => 3D points to be mapped into img (3XN array)\n img => an OpenCV image from the camera\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L58_C8", "label": "self.dataset_id =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "vector": [14, 2, 0.2329, 0.004, 2, 0.21, 0.0556, 80, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.dataset_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dataset_id = id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L61_C8", "label": "imgTmp = cvCloneImage()", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "vector": [14, 2, 0.245, 0.004, 2, 0.21, 0.1111, 110, 3, 1, 0, 0, 483, 10, 1], "semantic": {"name": "imgTmp", "arg_names": [], "import_names": [], "rhs_call_name": "cvCloneImage", "annotation": ""}, "snippet": " imgTmp = cv.cvCloneImage(img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L62_C8", "label": "imNP = Ipl2NumPy()", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "vector": [14, 2, 0.249, 0.004, 2, 0.21, 0.1667, 217, 3, 1, 0, 0, 295, 10, 1], "semantic": {"name": "imNP", "arg_names": [], "import_names": [], "rhs_call_name": "Ipl2NumPy", "annotation": ""}, "snippet": " imNP = cv.adaptors.Ipl2NumPy(imgTmp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L63_C8", "label": "self.height =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "vector": [14, 2, 0.253, 0.004, 2, 0.21, 0.2222, 466, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.height", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.height = imNP.shape[0] * zoom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L64_C8", "label": "self.width =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "vector": [14, 2, 0.257, 0.004, 2, 0.21, 0.2778, 901, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.width = imNP.shape[1] * zoom "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L65_C8", "label": "self.zoom =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "vector": [14, 2, 0.261, 0.004, 2, 0.21, 0.3333, 774, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.zoom", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.zoom = zoom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L67_C8", "label": "size()", "type": "expression", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "vector": [8, 2, 0.2691, 0.004, 2, 0.21, 0.3889, 714, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "size", "arg_names": [], "import_names": [], "rhs_call_name": "size", "annotation": ""}, "snippet": " pyc.size(self.width + 200, self.height)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L69_C8", "label": "self.pts =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "vector": [14, 2, 0.2771, 0.004, 2, 0.21, 0.4444, 137, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pts = pts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L70_C8", "label": "self.img =", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "vector": [14, 2, 0.2811, 0.004, 2, 0.21, 0.5, 992, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.img", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.img = img"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L71_C8", "label": "self.vals =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "vector": [14, 2, 0.2851, 0.004, 2, 0.21, 0.5556, 108, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.vals", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.vals = seeds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L72_C8", "label": "self.selected = zeros()", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "vector": [14, 2, 0.2892, 0.004, 2, 0.21, 0.6111, 432, 3, 1, 0, 0, 213, 10, 1], "semantic": {"name": "self.selected", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " self.selected = np.zeros( self.vals.shape[0] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L73_C8", "label": "assign", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "vector": [14, 2, 0.2932, 0.004, 2, 0.21, 0.6667, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.selected[0] = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L74_C8", "label": "self.dels =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "vector": [14, 2, 0.2972, 0.004, 2, 0.21, 0.7222, 567, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.dels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dels = deltas"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L75_C8", "label": "self.names =", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "vector": [14, 2, 0.3012, 0.004, 2, 0.21, 0.7778, 353, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.names = names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L76_C8", "label": "self.transFunc =", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "vector": [14, 2, 0.3052, 0.004, 2, 0.21, 0.8333, 963, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.transFunc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.transFunc = transFunc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L77_C8", "label": "self.cam_proj_mat =", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "vector": [14, 2, 0.3092, 0.004, 2, 0.21, 0.8889, 245, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cam_proj_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cam_proj_mat = cam_proj_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L78_C8", "label": "self.cam_centers =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "vector": [14, 2, 0.3133, 0.004, 2, 0.21, 0.9444, 76, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cam_centers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cam_centers = cam_centers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L79_C8", "label": "self.display_laser =", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "vector": [14, 2, 0.3173, 0.004, 2, 0.21, 1.0, 583, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.display_laser", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.display_laser = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "label": "reDraw", "type": "function", "loc": [82, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:ClassDef_L48_C0", "vector": [2, 1, 0.4558, 0.257, 1, 0.36, 0.3333, 371, 0, 1, 0, 0, 0, 0, 39], "semantic": {"name": "reDraw", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def reDraw(self):\n pyc.background(255)\n pyc.lightSpecular(255*30/640, 255*30/640, 255*30/640)\n pyc.directionalLight(255,255,255,0,0,1)\n pyc.specular(102, 102, 102)\n\n # Project self.pts into image, and display it\n imgTmp = cv.cvCloneImage(self.img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L83_C8", "label": "background()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [8, 2, 0.3333, 0.004, 2, 0.24, 0.0, 459, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "background", "arg_names": [], "import_names": [], "rhs_call_name": "background", "annotation": ""}, "snippet": " pyc.background(255)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L84_C8", "label": "lightSpecular()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [8, 2, 0.3373, 0.004, 2, 0.24, 0.0357, 728, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "lightSpecular", "arg_names": [], "import_names": [], "rhs_call_name": "lightSpecular", "annotation": ""}, "snippet": " pyc.lightSpecular(255*30/640, 255*30/640, 255*30/640)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L85_C8", "label": "directionalLight()", "type": "expression", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [8, 2, 0.3414, 0.004, 2, 0.24, 0.0714, 352, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "directionalLight", "arg_names": [], "import_names": [], "rhs_call_name": "directionalLight", "annotation": ""}, "snippet": " pyc.directionalLight(255,255,255,0,0,1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L86_C8", "label": "specular()", "type": "expression", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [8, 2, 0.3454, 0.004, 2, 0.24, 0.1071, 421, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "specular", "arg_names": [], "import_names": [], "rhs_call_name": "specular", "annotation": ""}, "snippet": " pyc.specular(102, 102, 102)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L89_C8", "label": "imgTmp = cvCloneImage()", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [14, 2, 0.3574, 0.004, 2, 0.24, 0.1429, 110, 3, 1, 0, 0, 483, 10, 1], "semantic": {"name": "imgTmp", "arg_names": [], "import_names": [], "rhs_call_name": "cvCloneImage", "annotation": ""}, "snippet": " imgTmp = cv.cvCloneImage(self.img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L90_C8", "label": "imNP = Ipl2NumPy()", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [14, 2, 0.3614, 0.004, 2, 0.24, 0.1786, 217, 3, 1, 0, 0, 295, 10, 2], "semantic": {"name": "imNP", "arg_names": [], "import_names": [], "rhs_call_name": "Ipl2NumPy", "annotation": ""}, "snippet": " imNP = cv.adaptors.Ipl2NumPy(scale(imgTmp, self.zoom))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L92_C8", "label": "color_list =", "type": "assigned_variable", "loc": [92, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [14, 2, 0.3735, 0.012, 2, 0.24, 0.2143, 570, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "color_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " color_list = [(255,255,0),(255,0,0),(0,255,255),(0,255,0),(0,0,255),(0,100,100),(100,100,0),\n (100,0,100),(100,200,100),(200,100,100),(100,100,200),(100,0,200),(0,200,100),\n (0,100,200),(200,0,100),(100,0,100),(255,152,7) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L96_C8", "label": "XformPts = transform()", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [14, 2, 0.3855, 0.004, 2, 0.24, 0.25, 662, 3, 2, 0, 0, 48, 10, 2], "semantic": {"name": "XformPts", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " XformPts = tr.transform( self.transFunc(self.vals), self.pts )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L97_C8", "label": "camPts =", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [14, 2, 0.3896, 0.004, 2, 0.24, 0.2857, 191, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "camPts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " camPts = self.cam_proj_mat * tr.xyzToHomogenous(XformPts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L98_C8", "label": "camPts =", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [14, 2, 0.3936, 0.004, 2, 0.24, 0.3214, 191, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "camPts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " camPts = camPts / camPts[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L99_C8", "label": "assign", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [14, 2, 0.3976, 0.004, 2, 0.24, 0.3571, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " camPts[0] = (camPts[0] + self.cam_centers[0]) * self.zoom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L100_C8", "label": "assign", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [14, 2, 0.4016, 0.004, 2, 0.24, 0.3929, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " camPts[1] = (camPts[1] + self.cam_centers[1]) * self.zoom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L101_C8", "label": "camPts = matrix()", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [14, 2, 0.4056, 0.004, 2, 0.24, 0.4286, 191, 3, 2, 0, 0, 162, 10, 2], "semantic": {"name": "camPts", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " camPts = np.matrix( np.round(camPts), 'int')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L103_C8", "label": "conditions = concatenate()", "type": "assigned_variable", "loc": [103, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [14, 2, 0.4197, 0.0161, 2, 0.24, 0.4643, 876, 3, 2, 0, 0, 63, 10, 1], "semantic": {"name": "conditions", "arg_names": [], "import_names": [], "rhs_call_name": "concatenate", "annotation": ""}, "snippet": " conditions = np.concatenate([camPts[0] >= 0, \n camPts[0] < imNP.shape[1],\n camPts[1] >= 0,\n camPts[1] < imNP.shape[0]], 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L107_C8", "label": "r, c = where()", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [14, 2, 0.4297, 0.004, 2, 0.24, 0.5, 385, 3, 1, 0, 0, 169, 10, 2], "semantic": {"name": "r, c", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " r, c = np.where(np.all(conditions, 0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L108_C8", "label": "camPts_bound =", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [14, 2, 0.4337, 0.004, 2, 0.24, 0.5357, 750, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "camPts_bound", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " camPts_bound = camPts[:, c.A[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L109_C8", "label": "x =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [14, 2, 0.4378, 0.004, 2, 0.24, 0.5714, 190, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = np.asarray(self.pts[0])[0][c.A[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L110_C8", "label": "x =", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [14, 2, 0.4418, 0.004, 2, 0.24, 0.6071, 190, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = x - x.min()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L111_C8", "label": "x =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [14, 2, 0.4458, 0.004, 2, 0.24, 0.6429, 190, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = x / x.max() * 256 #512 #number of colors"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L112_C8", "label": "x = floor()", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [14, 2, 0.4498, 0.004, 2, 0.24, 0.6786, 190, 3, 1, 0, 0, 956, 10, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "floor", "annotation": ""}, "snippet": " x = np.floor(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L113_C8", "label": "x =", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [14, 2, 0.4538, 0.004, 2, 0.24, 0.7143, 190, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = np.asarray(np.matrix(x,'int'))[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L114_C8", "label": "if", "type": "if", "loc": [114, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [4, 2, 0.4659, 0.0201, 2, 0.24, 0.75, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.display_laser:\n map2d = np.asarray(camPts_bound[0:2])\n n,m = map2d.shape\n for i in range(0,m):\n imNP[map2d[1,i],map2d[0,i], :] = [x[i],256-x[i],128+x[i]/2]#color_list[x[i]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L115_C12", "label": "map2d = asarray()", "type": "assigned_variable", "loc": [115, 115], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L114_C8", "vector": [14, 3, 0.4618, 0.004, 3, 0.24, 0.0, 954, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "map2d", "arg_names": [], "import_names": [], "rhs_call_name": "asarray", "annotation": ""}, "snippet": " map2d = np.asarray(camPts_bound[0:2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L116_C12", "label": "n, m =", "type": "assigned_variable", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L114_C8", "vector": [14, 3, 0.4659, 0.004, 3, 0.24, 0.5, 51, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "n, m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n,m = map2d.shape"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L117_C12", "label": "for i", "type": "for", "loc": [117, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L114_C8", "vector": [6, 3, 0.4719, 0.008, 3, 0.24, 1.0, 826, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(0,m):\n imNP[map2d[1,i],map2d[0,i], :] = [x[i],256-x[i],128+x[i]/2]#color_list[x[i]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L118_C16", "label": "assign", "type": "assigned_variable", "loc": [118, 118], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L117_C12", "vector": [14, 4, 0.4739, 0.004, 4, 0.9, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " imNP[map2d[1,i],map2d[0,i], :] = [x[i],256-x[i],128+x[i]/2]#color_list[x[i]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L119_C8", "label": "imgTmp = NumPy2Ipl()", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [14, 2, 0.4779, 0.004, 2, 0.24, 0.7857, 110, 3, 1, 0, 0, 457, 10, 1], "semantic": {"name": "imgTmp", "arg_names": [], "import_names": [], "rhs_call_name": "NumPy2Ipl", "annotation": ""}, "snippet": " imgTmp = cv.adaptors.NumPy2Ipl(imNP)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L122_C8", "label": "im = Ipl2PIL()", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [14, 2, 0.49, 0.004, 2, 0.24, 0.8214, 940, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "im", "arg_names": [], "import_names": [], "rhs_call_name": "Ipl2PIL", "annotation": ""}, "snippet": " im = cv.adaptors.Ipl2PIL(imgTmp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L125_C8", "label": "image()", "type": "expression", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [8, 2, 0.502, 0.004, 2, 0.24, 0.8571, 505, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "image", "arg_names": [], "import_names": [], "rhs_call_name": "image", "annotation": ""}, "snippet": " pyc.image(im, 0,0, self.width, self.height)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L130_C8", "label": "textSize()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [8, 2, 0.5221, 0.004, 2, 0.24, 0.8929, 187, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "textSize", "arg_names": [], "import_names": [], "rhs_call_name": "textSize", "annotation": ""}, "snippet": " pyc.textSize(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L131_C8", "label": "for i, val", "type": "for", "loc": [131, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [6, 2, 0.5482, 0.0482, 2, 0.24, 0.9286, 224, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "i, val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, val in enumerate(self.vals):\n if np.nonzero(self.selected)[0] == i: \n print('x',)\n print('%8.4f ' % self.vals[i],)\n pval = '%7s: %8.4f' % (self.names[i], self.vals[i])\n pyc.text(pval, self.width + 15, 20 + 20*i, 0)\n if np.nonzero(self.selected)[0] == i:\n pyc.fill(255,0,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L132_C12", "label": "if", "type": "if", "loc": [132, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L131_C8", "vector": [4, 3, 0.5321, 0.008, 3, 0.03, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.nonzero(self.selected)[0] == i: \n print('x',)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L133_C16", "label": "print()", "type": "expression", "loc": [133, 133], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L132_C12", "vector": [8, 4, 0.5341, 0.004, 4, 0.82, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('x',)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L134_C12", "label": "print()", "type": "expression", "loc": [134, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L131_C8", "vector": [8, 3, 0.5382, 0.004, 3, 0.03, 0.25, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('%8.4f ' % self.vals[i],)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L135_C12", "label": "pval =", "type": "assigned_variable", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L131_C8", "vector": [14, 3, 0.5422, 0.004, 3, 0.03, 0.5, 890, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pval", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pval = '%7s: %8.4f' % (self.names[i], self.vals[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L136_C12", "label": "text()", "type": "expression", "loc": [136, 136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L131_C8", "vector": [8, 3, 0.5462, 0.004, 3, 0.03, 0.75, 439, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " pyc.text(pval, self.width + 15, 20 + 20*i, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L137_C12", "label": "if", "type": "if", "loc": [137, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L131_C8", "vector": [4, 3, 0.5602, 0.0241, 3, 0.03, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.nonzero(self.selected)[0] == i:\n pyc.fill(255,0,0)\n pyc.quad(self.width+4.0, 15.0 + 20.0*i - 7.0,\n self.width+4.0, 15.0 + 20.0*i + 7.0,\n self.width+13.0, 15.0 + 20.0*i,\n self.width+13.0, 15.0 + 20.0*i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L138_C16", "label": "fill()", "type": "expression", "loc": [138, 138], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L137_C12", "vector": [8, 4, 0.5542, 0.004, 4, 0.44, 0.0, 346, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "fill", "arg_names": [], "import_names": [], "rhs_call_name": "fill", "annotation": ""}, "snippet": " pyc.fill(255,0,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L139_C16", "label": "quad()", "type": "expression", "loc": [139, 142], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L137_C12", "vector": [8, 4, 0.5643, 0.0161, 4, 0.44, 1.0, 898, 3, 8, 0, 0, 0, 0, 1], "semantic": {"name": "quad", "arg_names": [], "import_names": [], "rhs_call_name": "quad", "annotation": ""}, "snippet": " pyc.quad(self.width+4.0, 15.0 + 20.0*i - 7.0,\n self.width+4.0, 15.0 + 20.0*i + 7.0,\n self.width+13.0, 15.0 + 20.0*i,\n self.width+13.0, 15.0 + 20.0*i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L143_C8", "label": "print()", "type": "expression", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [8, 2, 0.5743, 0.004, 2, 0.24, 0.9643, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L145_C8", "label": "move()", "type": "expression", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "vector": [8, 2, 0.5823, 0.004, 2, 0.24, 1.0, 856, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "move", "arg_names": [], "import_names": [], "rhs_call_name": "move", "annotation": ""}, "snippet": " self.move(pyc.escape_handler(pyc.draw()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L147_C4", "label": "move", "type": "function", "loc": [147, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:ClassDef_L48_C0", "vector": [2, 1, 0.6325, 0.0884, 1, 0.36, 0.6667, 856, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "move", "arg_names": ["self", "events"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move(self, events):\n if len(events) > 0:\n for event in events:\n currselect = np.nonzero( self.selected )[0]\n if event.type == pyc.KEYDOWN:\n if event.key == pyc.K_DOWN:\n self.selected[currselect] = 0\n self.selected[ ut.bound(currselect + 1, 0, self.selected.shape[0]-1) ] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L148_C8", "label": "if", "type": "if", "loc": [148, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L147_C4", "vector": [4, 2, 0.6285, 0.0723, 2, 0.35, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(events) > 0:\n for event in events:\n currselect = np.nonzero( self.selected )[0]\n if event.type == pyc.KEYDOWN:\n if event.key == pyc.K_DOWN:\n self.selected[currselect] = 0\n self.selected[ ut.bound(currselect + 1, 0, self.selected.shape[0]-1) ] = 1\n if event.key == pyc.K_UP:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L149_C12", "label": "for event", "type": "for", "loc": [149, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L148_C8", "vector": [6, 3, 0.6305, 0.0683, 3, 0.31, 0.0, 371, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "event", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for event in events:\n currselect = np.nonzero( self.selected )[0]\n if event.type == pyc.KEYDOWN:\n if event.key == pyc.K_DOWN:\n self.selected[currselect] = 0\n self.selected[ ut.bound(currselect + 1, 0, self.selected.shape[0]-1) ] = 1\n if event.key == pyc.K_UP:\n self.selected[currselect] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L150_C16", "label": "currselect =", "type": "assigned_variable", "loc": [150, 150], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L149_C12", "vector": [14, 4, 0.6024, 0.004, 4, 0.29, 0.0, 133, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "currselect", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " currselect = np.nonzero( self.selected )[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L151_C16", "label": "if", "type": "if", "loc": [151, 165], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L149_C12", "vector": [4, 4, 0.6345, 0.0602, 4, 0.29, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event.type == pyc.KEYDOWN:\n if event.key == pyc.K_DOWN:\n self.selected[currselect] = 0\n self.selected[ ut.bound(currselect + 1, 0, self.selected.shape[0]-1) ] = 1\n if event.key == pyc.K_UP:\n self.selected[currselect] = 0\n self.selected[ ut.bound(currselect - 1, 0, self.selected.shape[0]-1) ] = 1\n if event.key == pyc.K_LEFT:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L152_C20", "label": "if", "type": "if", "loc": [152, 154], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L151_C16", "vector": [4, 5, 0.6145, 0.012, 5, 0.87, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event.key == pyc.K_DOWN:\n self.selected[currselect] = 0\n self.selected[ ut.bound(currselect + 1, 0, self.selected.shape[0]-1) ] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L153_C24", "label": "assign", "type": "assigned_variable", "loc": [153, 153], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L152_C20", "vector": [14, 6, 0.6145, 0.004, 6, 0.33, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.selected[currselect] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L154_C24", "label": "assign", "type": "assigned_variable", "loc": [154, 154], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L152_C20", "vector": [14, 6, 0.6185, 0.004, 6, 0.33, 1.0, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.selected[ ut.bound(currselect + 1, 0, self.selected.shape[0]-1) ] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L155_C20", "label": "if", "type": "if", "loc": [155, 157], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L151_C16", "vector": [4, 5, 0.6265, 0.012, 5, 0.87, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event.key == pyc.K_UP:\n self.selected[currselect] = 0\n self.selected[ ut.bound(currselect - 1, 0, self.selected.shape[0]-1) ] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L156_C24", "label": "assign", "type": "assigned_variable", "loc": [156, 156], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L155_C20", "vector": [14, 6, 0.6265, 0.004, 6, 0.08, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.selected[currselect] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L157_C24", "label": "assign", "type": "assigned_variable", "loc": [157, 157], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L155_C20", "vector": [14, 6, 0.6305, 0.004, 6, 0.08, 1.0, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.selected[ ut.bound(currselect - 1, 0, self.selected.shape[0]-1) ] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L158_C20", "label": "if", "type": "if", "loc": [158, 159], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L151_C16", "vector": [4, 5, 0.6365, 0.008, 5, 0.87, 0.4, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event.key == pyc.K_LEFT:\n self.vals[currselect] -= self.dels[currselect]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L160_C20", "label": "if", "type": "if", "loc": [160, 161], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L151_C16", "vector": [4, 5, 0.6446, 0.008, 5, 0.87, 0.6, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event.key == pyc.K_RIGHT:\n self.vals[currselect] += self.dels[currselect]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L162_C20", "label": "if", "type": "if", "loc": [162, 163], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L151_C16", "vector": [4, 5, 0.6526, 0.008, 5, 0.87, 0.8, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event.key == pyc.K_SPACE:\n self.display_laser = not self.display_laser"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L163_C24", "label": "self.display_laser =", "type": "assigned_variable", "loc": [163, 163], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L162_C20", "vector": [14, 6, 0.6546, 0.004, 6, 0.4, 0.0, 583, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.display_laser", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.display_laser = not self.display_laser"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L164_C20", "label": "if", "type": "if", "loc": [164, 165], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L151_C16", "vector": [4, 5, 0.6606, 0.008, 5, 0.87, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event.key == pyc.K_RETURN:\n self.display3d()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L165_C24", "label": "display3d()", "type": "expression", "loc": [165, 165], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L164_C20", "vector": [8, 6, 0.6627, 0.004, 6, 0.6, 0.0, 526, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "display3d", "arg_names": [], "import_names": [], "rhs_call_name": "display3d", "annotation": ""}, "snippet": " self.display3d()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Return_L168_C8", "label": "return", "type": "return", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L147_C4", "vector": [13, 2, 0.6747, 0.004, 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 events"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "label": "display3d", "type": "function", "loc": [170, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:ClassDef_L48_C0", "vector": [2, 1, 0.7068, 0.0522, 1, 0.36, 1.0, 526, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "display3d", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def display3d(self):\n import laser_camera_segmentation.processor as processor\n import laser_camera_segmentation.configuration as configuration \n print('display in 3d...')\n cfg = configuration.configuration('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling')\n cfg.cam_vec = np.array(self.vals)\n import scanr_transforms as trs\n cfg.camTlaser = trs.camTlaser(cfg.cam_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Import_L171_C8", "label": "laser_camera_segmentation.processor import processor", "type": "import", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "vector": [1, 2, 0.6867, 0.004, 2, 0.84, 0.0, 235, 0, 1, 0, 0, 235, 0, 0], "semantic": {"name": "laser_camera_segmentation.processor", "arg_names": [], "import_names": ["processor"], "rhs_call_name": "", "annotation": ""}, "snippet": " import laser_camera_segmentation.processor as processor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Import_L172_C8", "label": "laser_camera_segmentation.configuration import configuration", "type": "import", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "vector": [1, 2, 0.6908, 0.004, 2, 0.84, 0.1, 995, 0, 1, 0, 0, 995, 0, 0], "semantic": {"name": "laser_camera_segmentation.configuration", "arg_names": [], "import_names": ["configuration"], "rhs_call_name": "", "annotation": ""}, "snippet": " import laser_camera_segmentation.configuration as configuration "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L173_C8", "label": "print()", "type": "expression", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "vector": [8, 2, 0.6948, 0.004, 2, 0.84, 0.2, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('display in 3d...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L174_C8", "label": "cfg = configuration()", "type": "assigned_variable", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "vector": [14, 2, 0.6988, 0.004, 2, 0.84, 0.3, 46, 3, 1, 0, 0, 627, 10, 1], "semantic": {"name": "cfg", "arg_names": [], "import_names": [], "rhs_call_name": "configuration", "annotation": ""}, "snippet": " cfg = configuration.configuration('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L175_C8", "label": "cfg.cam_vec = array()", "type": "assigned_variable", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "vector": [14, 2, 0.7028, 0.004, 2, 0.84, 0.4, 446, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "cfg.cam_vec", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " cfg.cam_vec = np.array(self.vals)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Import_L176_C8", "label": "scanr_transforms import trs", "type": "import", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "vector": [1, 2, 0.7068, 0.004, 2, 0.84, 0.5, 488, 0, 1, 0, 0, 488, 0, 0], "semantic": {"name": "scanr_transforms", "arg_names": [], "import_names": ["trs"], "rhs_call_name": "", "annotation": ""}, "snippet": " import scanr_transforms as trs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L177_C8", "label": "cfg.camTlaser = camTlaser()", "type": "assigned_variable", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "vector": [14, 2, 0.7108, 0.004, 2, 0.84, 0.6, 221, 3, 1, 0, 0, 184, 10, 1], "semantic": {"name": "cfg.camTlaser", "arg_names": [], "import_names": [], "rhs_call_name": "camTlaser", "annotation": ""}, "snippet": " cfg.camTlaser = trs.camTlaser(cfg.cam_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L179_C8", "label": "pc = processor()", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "vector": [14, 2, 0.7189, 0.004, 2, 0.84, 0.7, 876, 3, 1, 0, 0, 177, 10, 1], "semantic": {"name": "pc", "arg_names": [], "import_names": [], "rhs_call_name": "processor", "annotation": ""}, "snippet": " pc = processor.processor(cfg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L180_C8", "label": "load_data()", "type": "expression", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "vector": [8, 2, 0.7229, 0.004, 2, 0.84, 0.8, 477, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_data", "arg_names": [], "import_names": [], "rhs_call_name": "load_data", "annotation": ""}, "snippet": " pc.load_data(self.dataset_id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L181_C8", "label": "process_raw_data()", "type": "expression", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "vector": [8, 2, 0.7269, 0.004, 2, 0.84, 0.9, 553, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "process_raw_data", "arg_names": [], "import_names": [], "rhs_call_name": "process_raw_data", "annotation": ""}, "snippet": " pc.process_raw_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L182_C8", "label": "display_3d()", "type": "expression", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "vector": [8, 2, 0.7309, 0.004, 2, 0.84, 1.0, 989, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "display_3d", "arg_names": [], "import_names": [], "rhs_call_name": "display_3d", "annotation": ""}, "snippet": " pc.display_3d('labels', False) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "label": "if", "type": "if", "loc": [185, 249], "level": 0, "parent": null, "vector": [4, 0, 0.8715, 0.261, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 26], "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('-c', action='store', type='string', dest='image', \n default='xxcalib.png', \n help='camera image')\n p.add_option('-p', action='store', type='string', dest='point_cloud', \n default='xxcalib.pkl', "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Import_L186_C4", "label": "optparse import optparse", "type": "import", "loc": [186, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [1, 1, 0.747, 0.004, 1, 0.2, 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_99718:Assign_L187_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [187, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [14, 1, 0.751, 0.004, 1, 0.2, 0.0435, 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_99718:Expr_L188_C4", "label": "add_option()", "type": "expression", "loc": [188, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [8, 1, 0.759, 0.012, 1, 0.2, 0.087, 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('-c', action='store', type='string', dest='image', \n default='xxcalib.png', \n help='camera image')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L191_C4", "label": "add_option()", "type": "expression", "loc": [191, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [8, 1, 0.7711, 0.012, 1, 0.2, 0.1304, 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('-p', action='store', type='string', dest='point_cloud', \n default='xxcalib.pkl', \n help='pickle file containing a point cloud matrix expressed in the laser\\'s frame')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L194_C4", "label": "add_option()", "type": "expression", "loc": [194, 196], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [8, 1, 0.7831, 0.012, 1, 0.2, 0.1739, 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('-n', action='store', type='string', dest='camera_name', \n default='eleUTM', \n help='name of camera as specified in camera_config.py')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L198_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [198, 198], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [14, 1, 0.7952, 0.004, 1, 0.2, 0.2174, 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_99718:Assign_L199_C4", "label": "image_filename =", "type": "assigned_variable", "loc": [199, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [14, 1, 0.7992, 0.004, 1, 0.2, 0.2609, 618, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "image_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " image_filename = opt.image"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L200_C4", "label": "point_cloud_filename =", "type": "assigned_variable", "loc": [200, 200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [14, 1, 0.8032, 0.004, 1, 0.2, 0.3043, 490, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "point_cloud_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point_cloud_filename = opt.point_cloud"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4", "label": "cameraTlaser", "type": "function", "loc": [203, 213], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [2, 1, 0.8353, 0.0442, 1, 0.2, 0.3478, 992, 0, 1, 1, 0, 0, 0, 11], "semantic": {"name": "cameraTlaser", "arg_names": ["vec"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def cameraTlaser(vec):\n x, y, z, r1, r2, r3, r4 = vec\n disp = np.matrix([x, y, z]).T\n rot1 = tr.Rx(math.radians(r1))\n rot2 = tr.Rz(math.radians(r2))\n rot3 = tr.Rx(math.radians(r3))\n rot4 = tr.Rz(math.radians(r4))\n rt = rot4 * rot3 * rot2 * rot1 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L204_C8", "label": "x, y, z, r1, r2, r3, r4 =", "type": "assigned_variable", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4", "vector": [14, 2, 0.8193, 0.004, 2, 0.27, 0.0, 829, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x, y, z, r1, r2, r3, r4", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x, y, z, r1, r2, r3, r4 = vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L205_C8", "label": "disp =", "type": "assigned_variable", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4", "vector": [14, 2, 0.8233, 0.004, 2, 0.27, 0.1111, 654, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " disp = np.matrix([x, y, z]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L206_C8", "label": "rot1 = Rx()", "type": "assigned_variable", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4", "vector": [14, 2, 0.8273, 0.004, 2, 0.27, 0.2222, 856, 3, 1, 0, 0, 820, 10, 2], "semantic": {"name": "rot1", "arg_names": [], "import_names": [], "rhs_call_name": "Rx", "annotation": ""}, "snippet": " rot1 = tr.Rx(math.radians(r1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L207_C8", "label": "rot2 = Rz()", "type": "assigned_variable", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4", "vector": [14, 2, 0.8313, 0.004, 2, 0.27, 0.3333, 447, 3, 1, 0, 0, 936, 10, 2], "semantic": {"name": "rot2", "arg_names": [], "import_names": [], "rhs_call_name": "Rz", "annotation": ""}, "snippet": " rot2 = tr.Rz(math.radians(r2))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L208_C8", "label": "rot3 = Rx()", "type": "assigned_variable", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4", "vector": [14, 2, 0.8353, 0.004, 2, 0.27, 0.4444, 236, 3, 1, 0, 0, 820, 10, 2], "semantic": {"name": "rot3", "arg_names": [], "import_names": [], "rhs_call_name": "Rx", "annotation": ""}, "snippet": " rot3 = tr.Rx(math.radians(r3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L209_C8", "label": "rot4 = Rz()", "type": "assigned_variable", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4", "vector": [14, 2, 0.8394, 0.004, 2, 0.27, 0.5556, 141, 3, 1, 0, 0, 936, 10, 2], "semantic": {"name": "rot4", "arg_names": [], "import_names": [], "rhs_call_name": "Rz", "annotation": ""}, "snippet": " rot4 = tr.Rz(math.radians(r4))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L210_C8", "label": "rt =", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4", "vector": [14, 2, 0.8434, 0.004, 2, 0.27, 0.6667, 991, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rt = rot4 * rot3 * rot2 * rot1 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L211_C8", "label": "laserTcam = composeHomogeneousTransform()", "type": "assigned_variable", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4", "vector": [14, 2, 0.8474, 0.004, 2, 0.27, 0.7778, 376, 3, 2, 0, 0, 126, 10, 1], "semantic": {"name": "laserTcam", "arg_names": [], "import_names": [], "rhs_call_name": "composeHomogeneousTransform", "annotation": ""}, "snippet": " laserTcam = tr.composeHomogeneousTransform(rt, disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L212_C8", "label": "trans = invertHomogeneousTransform()", "type": "assigned_variable", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4", "vector": [14, 2, 0.8514, 0.004, 2, 0.27, 0.8889, 786, 3, 1, 0, 0, 505, 10, 1], "semantic": {"name": "trans", "arg_names": [], "import_names": [], "rhs_call_name": "invertHomogeneousTransform", "annotation": ""}, "snippet": " trans = tr.invertHomogeneousTransform(laserTcam)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Return_L213_C8", "label": "return", "type": "return", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4", "vector": [13, 2, 0.8554, 0.004, 2, 0.27, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return trans"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L219_C4", "label": "seeds = array()", "type": "assigned_variable", "loc": [219, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [14, 1, 0.8795, 0.004, 1, 0.2, 0.3913, 706, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "seeds", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " seeds = np.array([ -0.087, 0.105 , 0.01, 89.8, 89.8, 90.0, 0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L222_C4", "label": "deltas = array()", "type": "assigned_variable", "loc": [222, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [14, 1, 0.8916, 0.004, 1, 0.2, 0.4348, 647, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "deltas", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " deltas = np.array([0.001, 0.001, 0.001, 0.1, 0.1, 0.1, 0.1]) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L224_C4", "label": "names =", "type": "assigned_variable", "loc": [224, 224], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [14, 1, 0.8996, 0.004, 1, 0.2, 0.4783, 382, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " names = ['x_disp', 'y_disp', 'z_disp', 'rotX', 'rotZ', 'rotX', 'rotZ']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L226_C4", "label": "img = cvLoadImage()", "type": "assigned_variable", "loc": [226, 226], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [14, 1, 0.9076, 0.004, 1, 0.2, 0.5217, 200, 3, 1, 0, 0, 45, 10, 1], "semantic": {"name": "img", "arg_names": [], "import_names": [], "rhs_call_name": "cvLoadImage", "annotation": ""}, "snippet": " img = hg.cvLoadImage(image_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L227_C4", "label": "raw_laser_scans = load_pickle()", "type": "assigned_variable", "loc": [227, 227], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [14, 1, 0.9116, 0.004, 1, 0.2, 0.5652, 256, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "raw_laser_scans", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " raw_laser_scans = ut.load_pickle(point_cloud_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L229_C4", "label": "poses, scans =", "type": "assigned_variable", "loc": [229, 229], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [14, 1, 0.9197, 0.004, 1, 0.2, 0.6087, 354, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "poses, scans", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " poses, scans = raw_laser_scans['laserscans'][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L230_C4", "label": "points_cloud_laser = generate_pointcloud()", "type": "assigned_variable", "loc": [230, 231], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [14, 1, 0.9257, 0.008, 1, 0.2, 0.6522, 166, 3, 8, 0, 0, 989, 10, 3], "semantic": {"name": "points_cloud_laser", "arg_names": [], "import_names": [], "rhs_call_name": "generate_pointcloud", "annotation": ""}, "snippet": " points_cloud_laser = p3d.generate_pointcloud(poses, scans, math.radians(-180), math.radians(180), \n 0, .035, max_dist=5, min_dist=.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Import_L236_C4", "label": "webcam_config import cc", "type": "import", "loc": [236, 236], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [1, 1, 0.9478, 0.004, 1, 0.2, 0.6957, 880, 0, 1, 0, 0, 880, 0, 0], "semantic": {"name": "webcam_config", "arg_names": [], "import_names": ["cc"], "rhs_call_name": "", "annotation": ""}, "snippet": " import webcam_config as cc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L237_C4", "label": "cp =", "type": "assigned_variable", "loc": [237, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [14, 1, 0.9518, 0.004, 1, 0.2, 0.7391, 70, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cp = cc.webcam_parameters['DesktopWebcam']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L238_C4", "label": "fx =", "type": "assigned_variable", "loc": [238, 238], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [14, 1, 0.9558, 0.004, 1, 0.2, 0.7826, 322, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fx = cp['focal_length_x_in_pixels']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L239_C4", "label": "fy =", "type": "assigned_variable", "loc": [239, 239], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [14, 1, 0.9598, 0.004, 1, 0.2, 0.8261, 8, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fy = cp['focal_length_y_in_pixels']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L240_C4", "label": "cam_proj_mat = matrix()", "type": "assigned_variable", "loc": [240, 242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [14, 1, 0.9679, 0.012, 1, 0.2, 0.8696, 613, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "cam_proj_mat", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " cam_proj_mat = np.matrix([[fx, 0, 0, 0],\n [0, fy, 0, 0],\n [0, 0, 1, 0]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L244_C4", "label": "cam_centers =", "type": "assigned_variable", "loc": [244, 244], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [14, 1, 0.9799, 0.004, 1, 0.2, 0.913, 890, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "cam_centers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cam_centers = ( cp['optical_center_x_in_pixels'], cp['optical_center_y_in_pixels'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L246_C4", "label": "c = Callib()", "type": "assigned_variable", "loc": [246, 246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [14, 1, 0.988, 0.004, 1, 0.2, 0.9565, 411, 3, 9, 0, 0, 724, 10, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "Callib", "annotation": ""}, "snippet": " c = Callib(cameraTlaser, seeds, deltas, names, points_cloud_laser, img, cam_proj_mat, cam_centers, 1/1.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:While_L248_C4", "label": "while", "type": "while", "loc": [248, 249], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "vector": [5, 1, 0.998, 0.008, 1, 0.2, 1.0, 0, 1, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True:\n c.reDraw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L249_C8", "label": "reDraw()", "type": "expression", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99718:While_L248_C4", "vector": [8, 2, 1.0, 0.004, 2, 0.2, 0.0, 371, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "reDraw", "arg_names": [], "import_names": [], "rhs_call_name": "reDraw", "annotation": ""}, "snippet": " c.reDraw()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Return_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:ClassDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:ClassDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L114_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L115_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L114_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L114_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L117_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L118_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L131_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L132_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L132_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L133_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L131_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L134_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L131_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L131_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L131_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L137_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L138_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L137_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L139_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:ClassDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L149_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L150_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:For_L149_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L151_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L151_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L152_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L152_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L153_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L152_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L154_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L151_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L155_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L155_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L156_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L155_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L157_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L151_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L158_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L151_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L160_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L151_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L162_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L162_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L163_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L151_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L164_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L164_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L165_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Return_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:ClassDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Import_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Import_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Import_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Import_L186_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L198_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L200_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Return_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L224_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L226_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L227_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L229_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L230_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Import_L236_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L238_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L239_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L240_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L244_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Assign_L246_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:If_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:While_L248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99718:While_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99718:Expr_L249_C8"}]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) from classifier import classifier import hrl_lib.util as ut import numpy as np from hrl_lib.util import getTime import processor class baseline_classifier(classifier): ''' classdocs ''' #def __init__(selfparams): # ''' # Constructor # ''' def test(self, feature_data = None): #test on current scan: print getTime(), 'test on:', self.processor.scan_dataset.id if feature_data == None: filename = self.processor.get_features_filename() dict = ut.load_pickle(filename) else: dict = feature_data baseline_labels = self.classify_baseline_code() return baseline_labels, self.test_results(dict, baseline_labels) def classify_baseline_code(self): import hrl_tilting_hokuyo.processing_3d as p3d import hrl_tilting_hokuyo.occupancy_grid_3d as og3d import hrl_tilting_hokuyo.display_3d_mayavi as d3m pt = np.matrix(self.processor.point_of_interest).T #define VOI width_half = self.processor.voi_width / 2.0 brf = pt+np.matrix([-width_half,-width_half,-width_half]).T tlb = pt+np.matrix([width_half, width_half, width_half]).T resolution = np.matrix([0.1,0.1,0.0025]).T max_dist = 15 min_dist = -15 gr = og3d.occupancy_grid_3d(brf,tlb,resolution) print 'filling grid...' gr.fill_grid(self.processor.pts3d_bound) print '...filled.' gr.to_binary(1) l = gr.find_plane_indices(assume_plane=True,hmin=0.3,hmax=2) z_min = min(l)*gr.resolution[2,0]+gr.brf[2,0] z_max = max(l)*gr.resolution[2,0]+gr.brf[2,0] pts = np.asarray(self.processor.pts3d_bound) conditions_surface = np.multiply(pts[2,:] > z_min, pts[2,:] < z_max) print 'cf',conditions_surface conditions_clutter = np.invert(conditions_surface) conditions_surface = np.multiply(conditions_surface, np.array(self.processor.map_polys) > 0) print 'cf',conditions_surface idx_surface = np.where(conditions_surface) conditions_clutter = np.multiply(conditions_clutter, np.array(self.processor.map_polys) > 0) idx_clutter = np.where(conditions_clutter) n, m = np.shape(self.processor.pts3d_bound) print n,m labels = np.zeros(m) print np.shape(labels), labels print np.shape(idx_surface), idx_surface labels[idx_surface] = processor.LABEL_SURFACE labels[idx_clutter] = processor.LABEL_CLUTTER print labels return labels
ajibawa-2023/Python-Code-Large/train/row_99719
52
109
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99719:ImportFrom_L30_C0", "label": "from classifier import classifier", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.2752, 0.0092, 0, 0.66, 0.0, 71, 0, 1, 0, 0, 71, 0, 0], "semantic": {"name": "classifier", "arg_names": [], "import_names": ["classifier"], "rhs_call_name": "", "annotation": ""}, "snippet": "from classifier import classifier"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Import_L32_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.2936, 0.0092, 0, 0.66, 0.2, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Import_L33_C0", "label": "numpy import np", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.3028, 0.0092, 0, 0.66, 0.4, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:ImportFrom_L35_C0", "label": "from hrl_lib.util import getTime", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.3211, 0.0092, 0, 0.66, 0.6, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["getTime"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_lib.util import getTime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Import_L37_C0", "label": "processor import processor", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.3394, 0.0092, 0, 0.66, 0.8, 177, 0, 1, 0, 0, 177, 0, 0], "semantic": {"name": "processor", "arg_names": [], "import_names": ["processor"], "rhs_call_name": "", "annotation": ""}, "snippet": "import processor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:ClassDef_L39_C0", "label": "baseline_classifier", "type": "class", "loc": [39, 107], "level": 0, "parent": null, "vector": [3, 0, 0.6697, 0.633, 0, 0.66, 1.0, 700, 0, 2, 0, 0, 71, 0, 37], "semantic": {"name": "baseline_classifier", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class baseline_classifier(classifier):\n '''\n classdocs\n '''\n\n\n #def __init__(selfparams):\n # '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L40_C4", "label": "expression", "type": "expression", "loc": [40, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:ClassDef_L39_C0", "vector": [8, 1, 0.3761, 0.0275, 1, 0.29, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n classdocs\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L51_C4", "label": "test", "type": "function", "loc": [51, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:ClassDef_L39_C0", "vector": [2, 1, 0.5229, 0.1193, 1, 0.29, 0.5, 224, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "test", "arg_names": ["self", "feature_data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def test(self, feature_data = None):\n #test on current scan:\n print(getTime(), 'test on:', self.processor.scan_dataset.id)\n \n if feature_data == None:\n filename = self.processor.get_features_filename()\n dict = ut.load_pickle(filename)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L53_C8", "label": "print()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L51_C4", "vector": [8, 2, 0.4862, 0.0092, 2, 0.14, 0.0, 535, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), 'test on:', self.processor.scan_dataset.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:If_L55_C8", "label": "if", "type": "if", "loc": [55, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L51_C4", "vector": [4, 2, 0.5229, 0.0459, 2, 0.14, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if feature_data == None:\n filename = self.processor.get_features_filename()\n dict = ut.load_pickle(filename)\n else:\n dict = feature_data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L56_C12", "label": "filename = get_features_filename()", "type": "assigned_variable", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:If_L55_C8", "vector": [14, 3, 0.5138, 0.0092, 3, 0.01, 0.0, 275, 3, 0, 0, 0, 49, 10, 1], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "get_features_filename", "annotation": ""}, "snippet": " filename = self.processor.get_features_filename()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L57_C12", "label": "dict = load_pickle()", "type": "assigned_variable", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:If_L55_C8", "vector": [14, 3, 0.5229, 0.0092, 3, 0.01, 0.5, 827, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "dict", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " dict = ut.load_pickle(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L59_C12", "label": "dict =", "type": "assigned_variable", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:If_L55_C8", "vector": [14, 3, 0.5413, 0.0092, 3, 0.01, 1.0, 827, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dict = feature_data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L61_C8", "label": "baseline_labels = classify_baseline_code()", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L51_C4", "vector": [14, 2, 0.5596, 0.0092, 2, 0.14, 0.6667, 85, 3, 0, 0, 0, 822, 10, 1], "semantic": {"name": "baseline_labels", "arg_names": [], "import_names": [], "rhs_call_name": "classify_baseline_code", "annotation": ""}, "snippet": " baseline_labels = self.classify_baseline_code()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Return_L63_C8", "label": "return", "type": "return", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L51_C4", "vector": [13, 2, 0.578, 0.0092, 2, 0.14, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return baseline_labels, self.test_results(dict, baseline_labels) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "label": "classify_baseline_code", "type": "function", "loc": [66, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:ClassDef_L39_C0", "vector": [2, 1, 0.7936, 0.3853, 1, 0.29, 1.0, 822, 0, 1, 1, 0, 0, 0, 31], "semantic": {"name": "classify_baseline_code", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def classify_baseline_code(self):\n import hrl_tilting_hokuyo.processing_3d as p3d\n import hrl_tilting_hokuyo.occupancy_grid_3d as og3d\n import hrl_tilting_hokuyo.display_3d_mayavi as d3m\n pt = np.matrix(self.processor.point_of_interest).T\n #define VOI\n width_half = self.processor.voi_width / 2.0\n brf = pt+np.matrix([-width_half,-width_half,-width_half]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Import_L67_C8", "label": "hrl_tilting_hokuyo.processing_3d import p3d", "type": "import", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [1, 2, 0.6147, 0.0092, 2, 0.02, 0.0, 307, 0, 1, 0, 0, 307, 0, 0], "semantic": {"name": "hrl_tilting_hokuyo.processing_3d", "arg_names": [], "import_names": ["p3d"], "rhs_call_name": "", "annotation": ""}, "snippet": " import hrl_tilting_hokuyo.processing_3d as p3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Import_L68_C8", "label": "hrl_tilting_hokuyo.occupancy_grid_3d import og3d", "type": "import", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [1, 2, 0.6239, 0.0092, 2, 0.02, 0.0286, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "hrl_tilting_hokuyo.occupancy_grid_3d", "arg_names": [], "import_names": ["og3d"], "rhs_call_name": "", "annotation": ""}, "snippet": " import hrl_tilting_hokuyo.occupancy_grid_3d as og3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Import_L69_C8", "label": "hrl_tilting_hokuyo.display_3d_mayavi import d3m", "type": "import", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [1, 2, 0.633, 0.0092, 2, 0.02, 0.0571, 181, 0, 1, 0, 0, 181, 0, 0], "semantic": {"name": "hrl_tilting_hokuyo.display_3d_mayavi", "arg_names": [], "import_names": ["d3m"], "rhs_call_name": "", "annotation": ""}, "snippet": " import hrl_tilting_hokuyo.display_3d_mayavi as d3m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L70_C8", "label": "pt =", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.6422, 0.0092, 2, 0.02, 0.0857, 989, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = np.matrix(self.processor.point_of_interest).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L72_C8", "label": "width_half =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.6606, 0.0092, 2, 0.02, 0.1143, 821, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "width_half", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " width_half = self.processor.voi_width / 2.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L73_C8", "label": "brf =", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.6697, 0.0092, 2, 0.02, 0.1429, 17, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "brf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " brf = pt+np.matrix([-width_half,-width_half,-width_half]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L74_C8", "label": "tlb =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.6789, 0.0092, 2, 0.02, 0.1714, 90, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tlb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tlb = pt+np.matrix([width_half, width_half, width_half]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L75_C8", "label": "resolution =", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.6881, 0.0092, 2, 0.02, 0.2, 615, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "resolution", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resolution = np.matrix([0.1,0.1,0.0025]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L76_C8", "label": "max_dist =", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.6972, 0.0092, 2, 0.02, 0.2286, 822, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "max_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_dist = 15"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L77_C8", "label": "min_dist =", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.7064, 0.0092, 2, 0.02, 0.2571, 109, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "min_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_dist = -15"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L78_C8", "label": "gr = occupancy_grid_3d()", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.7156, 0.0092, 2, 0.02, 0.2857, 8, 3, 3, 0, 0, 222, 10, 1], "semantic": {"name": "gr", "arg_names": [], "import_names": [], "rhs_call_name": "occupancy_grid_3d", "annotation": ""}, "snippet": " gr = og3d.occupancy_grid_3d(brf,tlb,resolution)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L79_C8", "label": "print()", "type": "expression", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [8, 2, 0.7248, 0.0092, 2, 0.02, 0.3143, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('filling grid...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L80_C8", "label": "fill_grid()", "type": "expression", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [8, 2, 0.7339, 0.0092, 2, 0.02, 0.3429, 619, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "fill_grid", "arg_names": [], "import_names": [], "rhs_call_name": "fill_grid", "annotation": ""}, "snippet": " gr.fill_grid(self.processor.pts3d_bound)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L81_C8", "label": "print()", "type": "expression", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [8, 2, 0.7431, 0.0092, 2, 0.02, 0.3714, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('...filled.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L82_C8", "label": "to_binary()", "type": "expression", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [8, 2, 0.7523, 0.0092, 2, 0.02, 0.4, 206, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "to_binary", "arg_names": [], "import_names": [], "rhs_call_name": "to_binary", "annotation": ""}, "snippet": " gr.to_binary(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L83_C8", "label": "l = find_plane_indices()", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.7615, 0.0092, 2, 0.02, 0.4286, 810, 3, 3, 0, 0, 383, 10, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "find_plane_indices", "annotation": ""}, "snippet": " l = gr.find_plane_indices(assume_plane=True,hmin=0.3,hmax=2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L84_C8", "label": "z_min =", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.7706, 0.0092, 2, 0.02, 0.4571, 566, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "z_min", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_min = min(l)*gr.resolution[2,0]+gr.brf[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L85_C8", "label": "z_max =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.7798, 0.0092, 2, 0.02, 0.4857, 465, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "z_max", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_max = max(l)*gr.resolution[2,0]+gr.brf[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L87_C8", "label": "pts = asarray()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.7982, 0.0092, 2, 0.02, 0.5143, 195, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "asarray", "annotation": ""}, "snippet": " pts = np.asarray(self.processor.pts3d_bound)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L88_C8", "label": "conditions_surface = multiply()", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.8073, 0.0092, 2, 0.02, 0.5429, 692, 3, 2, 0, 0, 960, 10, 1], "semantic": {"name": "conditions_surface", "arg_names": [], "import_names": [], "rhs_call_name": "multiply", "annotation": ""}, "snippet": " conditions_surface = np.multiply(pts[2,:] > z_min, pts[2,:] < z_max)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L89_C8", "label": "print()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [8, 2, 0.8165, 0.0092, 2, 0.02, 0.5714, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('cf',conditions_surface)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L90_C8", "label": "conditions_clutter = invert()", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.8257, 0.0092, 2, 0.02, 0.6, 955, 3, 1, 0, 0, 317, 10, 1], "semantic": {"name": "conditions_clutter", "arg_names": [], "import_names": [], "rhs_call_name": "invert", "annotation": ""}, "snippet": " conditions_clutter = np.invert(conditions_surface)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L91_C8", "label": "conditions_surface = multiply()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.8349, 0.0092, 2, 0.02, 0.6286, 692, 3, 2, 0, 0, 960, 10, 2], "semantic": {"name": "conditions_surface", "arg_names": [], "import_names": [], "rhs_call_name": "multiply", "annotation": ""}, "snippet": " conditions_surface = np.multiply(conditions_surface, np.array(self.processor.map_polys) > 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L92_C8", "label": "print()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [8, 2, 0.844, 0.0092, 2, 0.02, 0.6571, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('cf',conditions_surface)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L93_C8", "label": "idx_surface = where()", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.8532, 0.0092, 2, 0.02, 0.6857, 729, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "idx_surface", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idx_surface = np.where(conditions_surface)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L94_C8", "label": "conditions_clutter = multiply()", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.8624, 0.0092, 2, 0.02, 0.7143, 955, 3, 2, 0, 0, 960, 10, 2], "semantic": {"name": "conditions_clutter", "arg_names": [], "import_names": [], "rhs_call_name": "multiply", "annotation": ""}, "snippet": " conditions_clutter = np.multiply(conditions_clutter, np.array(self.processor.map_polys) > 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L95_C8", "label": "idx_clutter = where()", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.8716, 0.0092, 2, 0.02, 0.7429, 566, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "idx_clutter", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idx_clutter = np.where(conditions_clutter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L97_C8", "label": "n, m = shape()", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.8899, 0.0092, 2, 0.02, 0.7714, 51, 3, 1, 0, 0, 381, 10, 1], "semantic": {"name": "n, m", "arg_names": [], "import_names": [], "rhs_call_name": "shape", "annotation": ""}, "snippet": " n, m = np.shape(self.processor.pts3d_bound)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L98_C8", "label": "print()", "type": "expression", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [8, 2, 0.8991, 0.0092, 2, 0.02, 0.8, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(n,m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L99_C8", "label": "labels = zeros()", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.9083, 0.0092, 2, 0.02, 0.8286, 283, 3, 1, 0, 0, 213, 10, 1], "semantic": {"name": "labels", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " labels = np.zeros(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L100_C8", "label": "print()", "type": "expression", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [8, 2, 0.9174, 0.0092, 2, 0.02, 0.8571, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(np.shape(labels), labels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L101_C8", "label": "print()", "type": "expression", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [8, 2, 0.9266, 0.0092, 2, 0.02, 0.8857, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(np.shape(idx_surface), idx_surface)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L102_C8", "label": "assign", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.9358, 0.0092, 2, 0.02, 0.9143, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labels[idx_surface] = processor.LABEL_SURFACE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L103_C8", "label": "assign", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [14, 2, 0.945, 0.0092, 2, 0.02, 0.9429, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labels[idx_clutter] = processor.LABEL_CLUTTER"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L105_C8", "label": "print()", "type": "expression", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [8, 2, 0.9633, 0.0092, 2, 0.02, 0.9714, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(labels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99719:Return_L107_C8", "label": "return", "type": "return", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "vector": [13, 2, 0.9817, 0.0092, 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 labels "}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99719:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:If_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:If_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:If_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:If_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Return_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Import_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Import_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Import_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99719:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99719:Return_L107_C8"}]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) class features(object): ''' classdocs ''' processor = None def __init__(self,processor): ''' Constructor ''' self.processor = processor def get_indexvector(self): return None #get the feature vector for a specific point def get_featurevector(self): return None def prepare(self, features_k_nearest_neighbors): return None
ajibawa-2023/Python-Code-Large/train/row_99720
12
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_99720:ClassDef_L29_C0", "label": "features", "type": "class", "loc": [29, 53], "level": 0, "parent": null, "vector": [3, 0, 0.7593, 0.463, 0, 0.66, 0.0, 479, 0, 4, 0, 0, 186, 0, 0], "semantic": {"name": "features", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class features(object):\n '''\n classdocs\n '''\n\n\n processor = None\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99720:Expr_L30_C4", "label": "expression", "type": "expression", "loc": [30, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99720:ClassDef_L29_C0", "vector": [8, 1, 0.5741, 0.0556, 1, 0.96, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n classdocs\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99720:Assign_L35_C4", "label": "processor =", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99720:ClassDef_L29_C0", "vector": [14, 1, 0.6481, 0.0185, 1, 0.96, 0.2, 177, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "processor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " processor = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99720:FunctionDef_L37_C4", "label": "__init__", "type": "function", "loc": [37, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99720:ClassDef_L29_C0", "vector": [2, 1, 0.7222, 0.0926, 1, 0.96, 0.4, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "processor"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self,processor):\n '''\n Constructor\n '''\n self.processor = processor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99720:Expr_L38_C8", "label": "expression", "type": "expression", "loc": [38, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99720:FunctionDef_L37_C4", "vector": [8, 2, 0.7222, 0.0556, 2, 0.37, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n Constructor\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99720:Assign_L41_C8", "label": "self.processor =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99720:FunctionDef_L37_C4", "vector": [14, 2, 0.7593, 0.0185, 2, 0.37, 1.0, 855, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.processor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.processor = processor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99720:FunctionDef_L44_C4", "label": "get_indexvector", "type": "function", "loc": [44, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99720:ClassDef_L29_C0", "vector": [2, 1, 0.8241, 0.037, 1, 0.96, 0.6, 770, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_indexvector", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_indexvector(self):\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99720:Return_L45_C8", "label": "return", "type": "return", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99720:FunctionDef_L44_C4", "vector": [13, 2, 0.8333, 0.0185, 2, 0.11, 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_99720:FunctionDef_L49_C4", "label": "get_featurevector", "type": "function", "loc": [49, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99720:ClassDef_L29_C0", "vector": [2, 1, 0.9167, 0.037, 1, 0.96, 0.8, 16, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_featurevector", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_featurevector(self):\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99720:Return_L50_C8", "label": "return", "type": "return", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99720:FunctionDef_L49_C4", "vector": [13, 2, 0.9259, 0.0185, 2, 0.18, 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_99720:FunctionDef_L52_C4", "label": "prepare", "type": "function", "loc": [52, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99720:ClassDef_L29_C0", "vector": [2, 1, 0.9722, 0.037, 1, 0.96, 1.0, 556, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "prepare", "arg_names": ["self", "features_k_nearest_neighbors"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def prepare(self, features_k_nearest_neighbors):\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99720:Return_L53_C8", "label": "return", "type": "return", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99720:FunctionDef_L52_C4", "vector": [13, 2, 0.9815, 0.0185, 2, 0.63, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99720:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99720:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99720:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99720:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99720:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99720:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99720:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99720:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99720:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99720:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99720:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99720:FunctionDef_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99720:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99720:Return_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99720:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99720:FunctionDef_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99720:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99720:Return_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99720:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99720:FunctionDef_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99720:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99720:Return_L53_C8"}]
#! /usr/bin/env python # # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) import scanner import Processor import configuration import hrl_lib.util as ut # Import Psyco if available #try: # import psyco # psyco.full() # print "Psyco loaded" #except ImportError: # pass #from labeling import label_object, scan_dataset, scans_database #database = scans_database.scans_database() #database.load('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling','database.pkl') #dataset = scan_dataset.scan_dataset() #print dataset cfg = configuration.configuration('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling') sc = scanner.scanner(cfg) pc = Processor.Processor(cfg) name = ut.formatted_time() name='2009Oct17_122644' #sc.capture_and_save(name) pc.load_data(name) #pc.load_raw_data('pill_table/2009Sep12_142422') pc.process_raw_data() pc.save_mapped_image(name) pc.display_all_data() print 'done'
ajibawa-2023/Python-Code-Large/train/row_99721
14
68
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99721:Import_L31_C0", "label": "scanner import scanner", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.4559, 0.0147, 0, 0.66, 0.0, 802, 0, 1, 0, 0, 802, 0, 0], "semantic": {"name": "scanner", "arg_names": [], "import_names": ["scanner"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scanner "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99721:Import_L32_C0", "label": "Processor import Processor", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.4706, 0.0147, 0, 0.66, 0.0769, 732, 0, 1, 0, 0, 732, 0, 0], "semantic": {"name": "Processor", "arg_names": [], "import_names": ["Processor"], "rhs_call_name": "", "annotation": ""}, "snippet": "import Processor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99721:Import_L33_C0", "label": "configuration import configuration", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.4853, 0.0147, 0, 0.66, 0.1538, 627, 0, 1, 0, 0, 627, 0, 0], "semantic": {"name": "configuration", "arg_names": [], "import_names": ["configuration"], "rhs_call_name": "", "annotation": ""}, "snippet": "import configuration "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99721:Import_L34_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.0147, 0, 0.66, 0.2308, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99721:Assign_L50_C0", "label": "cfg = configuration()", "type": "assigned_variable", "loc": [50, 50], "level": 0, "parent": null, "vector": [14, 0, 0.7353, 0.0147, 0, 0.66, 0.3077, 46, 3, 1, 0, 0, 627, 10, 1], "semantic": {"name": "cfg", "arg_names": [], "import_names": [], "rhs_call_name": "configuration", "annotation": ""}, "snippet": "cfg = configuration.configuration('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99721:Assign_L51_C0", "label": "sc = scanner()", "type": "assigned_variable", "loc": [51, 51], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.0147, 0, 0.66, 0.3846, 356, 3, 1, 0, 0, 802, 10, 1], "semantic": {"name": "sc", "arg_names": [], "import_names": [], "rhs_call_name": "scanner", "annotation": ""}, "snippet": "sc = scanner.scanner(cfg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99721:Assign_L52_C0", "label": "pc = Processor()", "type": "assigned_variable", "loc": [52, 52], "level": 0, "parent": null, "vector": [14, 0, 0.7647, 0.0147, 0, 0.66, 0.4615, 876, 3, 1, 0, 0, 732, 10, 1], "semantic": {"name": "pc", "arg_names": [], "import_names": [], "rhs_call_name": "Processor", "annotation": ""}, "snippet": "pc = Processor.Processor(cfg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99721:Assign_L54_C0", "label": "name = formatted_time()", "type": "assigned_variable", "loc": [54, 54], "level": 0, "parent": null, "vector": [14, 0, 0.7941, 0.0147, 0, 0.66, 0.5385, 57, 3, 0, 0, 0, 353, 10, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "formatted_time", "annotation": ""}, "snippet": "name = ut.formatted_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99721:Assign_L55_C0", "label": "name =", "type": "assigned_variable", "loc": [55, 55], "level": 0, "parent": null, "vector": [14, 0, 0.8088, 0.0147, 0, 0.66, 0.6154, 57, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "name='2009Oct17_122644'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99721:Expr_L57_C0", "label": "load_data()", "type": "expression", "loc": [57, 57], "level": 0, "parent": null, "vector": [8, 0, 0.8382, 0.0147, 0, 0.66, 0.6923, 477, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_data", "arg_names": [], "import_names": [], "rhs_call_name": "load_data", "annotation": ""}, "snippet": "pc.load_data(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99721:Expr_L60_C0", "label": "process_raw_data()", "type": "expression", "loc": [60, 60], "level": 0, "parent": null, "vector": [8, 0, 0.8824, 0.0147, 0, 0.66, 0.7692, 553, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "process_raw_data", "arg_names": [], "import_names": [], "rhs_call_name": "process_raw_data", "annotation": ""}, "snippet": "pc.process_raw_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99721:Expr_L61_C0", "label": "save_mapped_image()", "type": "expression", "loc": [61, 61], "level": 0, "parent": null, "vector": [8, 0, 0.8971, 0.0147, 0, 0.66, 0.8462, 42, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "save_mapped_image", "arg_names": [], "import_names": [], "rhs_call_name": "save_mapped_image", "annotation": ""}, "snippet": "pc.save_mapped_image(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99721:Expr_L62_C0", "label": "display_all_data()", "type": "expression", "loc": [62, 62], "level": 0, "parent": null, "vector": [8, 0, 0.9118, 0.0147, 0, 0.66, 0.9231, 987, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "display_all_data", "arg_names": [], "import_names": [], "rhs_call_name": "display_all_data", "annotation": ""}, "snippet": "pc.display_all_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99721:Expr_L63_C0", "label": "print()", "type": "expression", "loc": [63, 63], "level": 0, "parent": null, "vector": [8, 0, 0.9265, 0.0147, 0, 0.66, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('done')"}]
[]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # import numpy as np, math import hrl_lib.transforms as tr def residualXform( residuals ): ''' residuals are np.array([ Rz2, Rx, Rz1, dx, dy, dz ]) returns rotResid, dispResid ''' rotResid = tr.Rz( residuals[0] ) * tr.Rx( residuals[1] ) * tr.Rz( residuals[2] ) dispResid = np.matrix([ residuals[3], residuals[4], residuals[5] ]).T return rotResid, dispResid def camTlaser( res = np.zeros(7) ): # @ Duke, res = np.array([0.8, 0.9, -1.7, 3.1, 0.061, 0.032, -0.035 ]) rot = tr.Ry( math.radians( 0.0 + res[0] )) * tr.Rz( math.radians( 0.0 + res[1] )) * tr.Rx( math.radians( -90.0 + res[2] )) * tr.Rz( math.radians( -90.0 + res[3])) disp = np.matrix([ res[4], res[5], res[6] ]).T + np.matrix([ 0.0, 0.0, 0.0 ]).T return tr.composeHomogeneousTransform(rot, disp) def rollTtool_pointer( residuals = np.zeros(6) ): rotResid, dispResid = residualXform( residuals ) rot = rotResid * tr.Rz( math.radians( -10.0 )) disp = dispResid + np.matrix([ 0.008, 0.0, 0.0 ]).T return tr.composeHomogeneousTransform(rot, disp) def rollTtool_MA( residuals = np.zeros(6) ): rotResid, dispResid = residualXform( residuals ) rot = rotResid * tr.Ry( math.radians( -90.0 )) disp = dispResid + np.matrix([ 0.0476, 0.0, 0.0 ]).T return tr.composeHomogeneousTransform(rot, disp) def panTroll(rollAng, residuals = np.zeros(6) ): rotResid, dispResid = residualXform( residuals ) rot = rotResid * tr.Rx( -1.0 * rollAng ) disp = dispResid + np.matrix([0.02021, 0.0, 0.04236 ]).T return tr.composeHomogeneousTransform(rot, disp) def tiltTpan(panAng, residuals = np.zeros(6) ): rotResid, dispResid = residualXform( residuals ) rot = rotResid * tr.Rz( -1.0 * panAng ) disp = dispResid + np.matrix([ 0.07124, 0.0, 0.02243 ]).T return tr.composeHomogeneousTransform(rot, disp) def laserTtilt(tiltAng, residuals = np.zeros(6) ): rotResid, dispResid = residualXform( residuals ) rot = rotResid * tr.Ry( +1.0 * tiltAng ) disp = dispResid + np.matrix([ 0.03354, 0.0, 0.23669 ]).T return tr.composeHomogeneousTransform(rot, disp) def laserTtool_pointer(rollAng, panAng, tiltAng, residuals = np.zeros([4,6])): ''' This is specifically for the off-axis laser pointer! Tool coordinate frame will change for each tool. Here, residuals are 4x6 array where: res[0] = rollTtool res[1] = panTroll res[2] = tiltTpan res[3] = laserTtilt ''' res = residuals return laserTtilt(tiltAng, res[3] ) * tiltTpan(panAng, res[2] ) * panTroll(rollAng, res[1] ) * rollTtool_pointer(res[0]) def tool_pointerTlaser(rollAng, panAng, tiltAng, residuals = np.zeros([4,6])): return tr.invertHomogeneousTransform( laserTtool_pointer(rollAng, panAng, tiltAng, residuals) ) def laserTtool_MA(rollAng, panAng, tiltAng, residuals = np.zeros([4,6])): ''' This is specifically for the multi-antenna (MA) tool attachment! Tool coordinate frame will change for each tool. Here, residuals are 4x6 array where: res[0] = rollTtool res[1] = panTroll res[2] = tiltTpan res[3] = laserTtilt ''' res = residuals return laserTtilt(tiltAng, res[3] ) * tiltTpan(panAng, res[2] ) * panTroll(rollAng, res[1] ) * rollTtool_MA(res[0]) def tool_MATlaser(rollAng, panAng, tiltAng, residuals = np.zeros([4,6])): return tr.invertHomogeneousTransform( laserTtool_MA(rollAng, panAng, tiltAng, residuals) )
ajibawa-2023/Python-Code-Large/train/row_99722
48
109
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Import_L28_C0", "label": "numpy import np, math", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.2569, 0.0092, 0, 0.66, 0.0, 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_99722:Import_L29_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.2661, 0.0092, 0, 0.66, 0.0833, 82, 0, 1, 0, 0, 82, 0, 0], "semantic": {"name": "hrl_lib.transforms", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L33_C0", "label": "residualXform", "type": "function", "loc": [33, 40], "level": 0, "parent": null, "vector": [2, 0, 0.3349, 0.0734, 0, 0.66, 0.1667, 522, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "residualXform", "arg_names": ["residuals"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def residualXform( residuals ):\n '''\n residuals are np.array([ Rz2, Rx, Rz1, dx, dy, dz ])\n returns rotResid, dispResid\n '''\n rotResid = tr.Rz( residuals[0] ) * tr.Rx( residuals[1] ) * tr.Rz( residuals[2] )\n dispResid = np.matrix([ residuals[3], residuals[4], residuals[5] ]).T\n return rotResid, dispResid "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Expr_L34_C4", "label": "expression", "type": "expression", "loc": [34, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L33_C0", "vector": [8, 1, 0.3257, 0.0367, 1, 0.43, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n residuals are np.array([ Rz2, Rx, Rz1, dx, dy, dz ])\n returns rotResid, dispResid\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L38_C4", "label": "rotResid =", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L33_C0", "vector": [14, 1, 0.3486, 0.0092, 1, 0.43, 0.3333, 64, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "rotResid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rotResid = tr.Rz( residuals[0] ) * tr.Rx( residuals[1] ) * tr.Rz( residuals[2] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L39_C4", "label": "dispResid =", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L33_C0", "vector": [14, 1, 0.3578, 0.0092, 1, 0.43, 0.6667, 207, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dispResid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dispResid = np.matrix([ residuals[3], residuals[4], residuals[5] ]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L40_C4", "label": "return", "type": "return", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L33_C0", "vector": [13, 1, 0.367, 0.0092, 1, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rotResid, dispResid "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L42_C0", "label": "camTlaser", "type": "function", "loc": [42, 46], "level": 0, "parent": null, "vector": [2, 0, 0.4037, 0.0459, 0, 0.66, 0.25, 184, 0, 1, 1, 0, 0, 0, 12], "semantic": {"name": "camTlaser", "arg_names": ["res"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def camTlaser( res = np.zeros(7) ):\n # @ Duke, res = np.array([0.8, 0.9, -1.7, 3.1, 0.061, 0.032, -0.035 ])\n rot = tr.Ry( math.radians( 0.0 + res[0] )) * tr.Rz( math.radians( 0.0 + res[1] )) * tr.Rx( math.radians( -90.0 + res[2] )) * tr.Rz( math.radians( -90.0 + res[3]))\n disp = np.matrix([ res[4], res[5], res[6] ]).T + np.matrix([ 0.0, 0.0, 0.0 ]).T\n return tr.composeHomogeneousTransform(rot, disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L44_C4", "label": "rot =", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L42_C0", "vector": [14, 1, 0.4037, 0.0092, 1, 0.97, 0.0, 812, 4, 0, 0, 0, 0, 0, 8], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot = tr.Ry( math.radians( 0.0 + res[0] )) * tr.Rz( math.radians( 0.0 + res[1] )) * tr.Rx( math.radians( -90.0 + res[2] )) * tr.Rz( math.radians( -90.0 + res[3]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L45_C4", "label": "disp =", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L42_C0", "vector": [14, 1, 0.4128, 0.0092, 1, 0.97, 0.5, 654, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " disp = np.matrix([ res[4], res[5], res[6] ]).T + np.matrix([ 0.0, 0.0, 0.0 ]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L46_C4", "label": "return", "type": "return", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L42_C0", "vector": [13, 1, 0.422, 0.0092, 1, 0.97, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tr.composeHomogeneousTransform(rot, disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L48_C0", "label": "rollTtool_pointer", "type": "function", "loc": [48, 52], "level": 0, "parent": null, "vector": [2, 0, 0.4587, 0.0459, 0, 0.66, 0.3333, 452, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "rollTtool_pointer", "arg_names": ["residuals"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def rollTtool_pointer( residuals = np.zeros(6) ):\n rotResid, dispResid = residualXform( residuals )\n rot = rotResid * tr.Rz( math.radians( -10.0 ))\n disp = dispResid + np.matrix([ 0.008, 0.0, 0.0 ]).T\n return tr.composeHomogeneousTransform(rot, disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L49_C4", "label": "rotResid, dispResid = residualXform()", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L48_C0", "vector": [14, 1, 0.4495, 0.0092, 1, 0.1, 0.0, 134, 3, 1, 0, 0, 522, 10, 1], "semantic": {"name": "rotResid, dispResid", "arg_names": [], "import_names": [], "rhs_call_name": "residualXform", "annotation": ""}, "snippet": " rotResid, dispResid = residualXform( residuals )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L50_C4", "label": "rot =", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L48_C0", "vector": [14, 1, 0.4587, 0.0092, 1, 0.1, 0.3333, 812, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot = rotResid * tr.Rz( math.radians( -10.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L51_C4", "label": "disp =", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L48_C0", "vector": [14, 1, 0.4679, 0.0092, 1, 0.1, 0.6667, 654, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " disp = dispResid + np.matrix([ 0.008, 0.0, 0.0 ]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L52_C4", "label": "return", "type": "return", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L48_C0", "vector": [13, 1, 0.4771, 0.0092, 1, 0.1, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tr.composeHomogeneousTransform(rot, disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L54_C0", "label": "rollTtool_MA", "type": "function", "loc": [54, 58], "level": 0, "parent": null, "vector": [2, 0, 0.5138, 0.0459, 0, 0.66, 0.4167, 485, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "rollTtool_MA", "arg_names": ["residuals"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def rollTtool_MA( residuals = np.zeros(6) ):\n rotResid, dispResid = residualXform( residuals )\n rot = rotResid * tr.Ry( math.radians( -90.0 ))\n disp = dispResid + np.matrix([ 0.0476, 0.0, 0.0 ]).T\n return tr.composeHomogeneousTransform(rot, disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L55_C4", "label": "rotResid, dispResid = residualXform()", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L54_C0", "vector": [14, 1, 0.5046, 0.0092, 1, 0.03, 0.0, 134, 3, 1, 0, 0, 522, 10, 1], "semantic": {"name": "rotResid, dispResid", "arg_names": [], "import_names": [], "rhs_call_name": "residualXform", "annotation": ""}, "snippet": " rotResid, dispResid = residualXform( residuals )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L56_C4", "label": "rot =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L54_C0", "vector": [14, 1, 0.5138, 0.0092, 1, 0.03, 0.3333, 812, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot = rotResid * tr.Ry( math.radians( -90.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L57_C4", "label": "disp =", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L54_C0", "vector": [14, 1, 0.5229, 0.0092, 1, 0.03, 0.6667, 654, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " disp = dispResid + np.matrix([ 0.0476, 0.0, 0.0 ]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L58_C4", "label": "return", "type": "return", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L54_C0", "vector": [13, 1, 0.5321, 0.0092, 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 tr.composeHomogeneousTransform(rot, disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L61_C0", "label": "panTroll", "type": "function", "loc": [61, 65], "level": 0, "parent": null, "vector": [2, 0, 0.578, 0.0459, 0, 0.66, 0.5, 892, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "panTroll", "arg_names": ["rollAng", "residuals"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def panTroll(rollAng, residuals = np.zeros(6) ):\n rotResid, dispResid = residualXform( residuals )\n rot = rotResid * tr.Rx( -1.0 * rollAng )\n disp = dispResid + np.matrix([0.02021, 0.0, 0.04236 ]).T\n return tr.composeHomogeneousTransform(rot, disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L62_C4", "label": "rotResid, dispResid = residualXform()", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L61_C0", "vector": [14, 1, 0.5688, 0.0092, 1, 0.5, 0.0, 134, 3, 1, 0, 0, 522, 10, 1], "semantic": {"name": "rotResid, dispResid", "arg_names": [], "import_names": [], "rhs_call_name": "residualXform", "annotation": ""}, "snippet": " rotResid, dispResid = residualXform( residuals )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L63_C4", "label": "rot =", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L61_C0", "vector": [14, 1, 0.578, 0.0092, 1, 0.5, 0.3333, 812, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot = rotResid * tr.Rx( -1.0 * rollAng )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L64_C4", "label": "disp =", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L61_C0", "vector": [14, 1, 0.5872, 0.0092, 1, 0.5, 0.6667, 654, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " disp = dispResid + np.matrix([0.02021, 0.0, 0.04236 ]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L65_C4", "label": "return", "type": "return", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L61_C0", "vector": [13, 1, 0.5963, 0.0092, 1, 0.5, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tr.composeHomogeneousTransform(rot, disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L67_C0", "label": "tiltTpan", "type": "function", "loc": [67, 71], "level": 0, "parent": null, "vector": [2, 0, 0.633, 0.0459, 0, 0.66, 0.5833, 119, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "tiltTpan", "arg_names": ["panAng", "residuals"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def tiltTpan(panAng, residuals = np.zeros(6) ):\n rotResid, dispResid = residualXform( residuals )\n rot = rotResid * tr.Rz( -1.0 * panAng )\n disp = dispResid + np.matrix([ 0.07124, 0.0, 0.02243 ]).T\n return tr.composeHomogeneousTransform(rot, disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L68_C4", "label": "rotResid, dispResid = residualXform()", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L67_C0", "vector": [14, 1, 0.6239, 0.0092, 1, 0.76, 0.0, 134, 3, 1, 0, 0, 522, 10, 1], "semantic": {"name": "rotResid, dispResid", "arg_names": [], "import_names": [], "rhs_call_name": "residualXform", "annotation": ""}, "snippet": " rotResid, dispResid = residualXform( residuals )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L69_C4", "label": "rot =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L67_C0", "vector": [14, 1, 0.633, 0.0092, 1, 0.76, 0.3333, 812, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot = rotResid * tr.Rz( -1.0 * panAng )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L70_C4", "label": "disp =", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L67_C0", "vector": [14, 1, 0.6422, 0.0092, 1, 0.76, 0.6667, 654, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " disp = dispResid + np.matrix([ 0.07124, 0.0, 0.02243 ]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L71_C4", "label": "return", "type": "return", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L67_C0", "vector": [13, 1, 0.6514, 0.0092, 1, 0.76, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tr.composeHomogeneousTransform(rot, disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L73_C0", "label": "laserTtilt", "type": "function", "loc": [73, 77], "level": 0, "parent": null, "vector": [2, 0, 0.6881, 0.0459, 0, 0.66, 0.6667, 724, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "laserTtilt", "arg_names": ["tiltAng", "residuals"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def laserTtilt(tiltAng, residuals = np.zeros(6) ):\n rotResid, dispResid = residualXform( residuals )\n rot = rotResid * tr.Ry( +1.0 * tiltAng )\n disp = dispResid + np.matrix([ 0.03354, 0.0, 0.23669 ]).T\n return tr.composeHomogeneousTransform(rot, disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L74_C4", "label": "rotResid, dispResid = residualXform()", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L73_C0", "vector": [14, 1, 0.6789, 0.0092, 1, 0.48, 0.0, 134, 3, 1, 0, 0, 522, 10, 1], "semantic": {"name": "rotResid, dispResid", "arg_names": [], "import_names": [], "rhs_call_name": "residualXform", "annotation": ""}, "snippet": " rotResid, dispResid = residualXform( residuals )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L75_C4", "label": "rot =", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L73_C0", "vector": [14, 1, 0.6881, 0.0092, 1, 0.48, 0.3333, 812, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot = rotResid * tr.Ry( +1.0 * tiltAng )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L76_C4", "label": "disp =", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L73_C0", "vector": [14, 1, 0.6972, 0.0092, 1, 0.48, 0.6667, 654, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " disp = dispResid + np.matrix([ 0.03354, 0.0, 0.23669 ]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L77_C4", "label": "return", "type": "return", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L73_C0", "vector": [13, 1, 0.7064, 0.0092, 1, 0.48, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tr.composeHomogeneousTransform(rot, disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L79_C0", "label": "laserTtool_pointer", "type": "function", "loc": [79, 89], "level": 0, "parent": null, "vector": [2, 0, 0.7706, 0.1009, 0, 0.66, 0.75, 594, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "laserTtool_pointer", "arg_names": ["rollAng", "panAng", "tiltAng", "residuals"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def laserTtool_pointer(rollAng, panAng, tiltAng, residuals = np.zeros([4,6])):\n '''\n This is specifically for the off-axis laser pointer! Tool coordinate frame will change for each tool.\n Here, residuals are 4x6 array where:\n res[0] = rollTtool\n res[1] = panTroll\n res[2] = tiltTpan\n res[3] = laserTtilt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Expr_L80_C4", "label": "expression", "type": "expression", "loc": [80, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L79_C0", "vector": [8, 1, 0.7661, 0.0734, 1, 0.39, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n This is specifically for the off-axis laser pointer! Tool coordinate frame will change for each tool.\n Here, residuals are 4x6 array where:\n res[0] = rollTtool\n res[1] = panTroll\n res[2] = tiltTpan\n res[3] = laserTtilt\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L88_C4", "label": "res =", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L79_C0", "vector": [14, 1, 0.8073, 0.0092, 1, 0.39, 0.5, 413, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " res = residuals"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L89_C4", "label": "return", "type": "return", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L79_C0", "vector": [13, 1, 0.8165, 0.0092, 1, 0.39, 1.0, 0, 4, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return laserTtilt(tiltAng, res[3] ) * tiltTpan(panAng, res[2] ) * panTroll(rollAng, res[1] ) * rollTtool_pointer(res[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L91_C0", "label": "tool_pointerTlaser", "type": "function", "loc": [91, 92], "level": 0, "parent": null, "vector": [2, 0, 0.8394, 0.0183, 0, 0.66, 0.8333, 212, 0, 4, 1, 0, 0, 0, 3], "semantic": {"name": "tool_pointerTlaser", "arg_names": ["rollAng", "panAng", "tiltAng", "residuals"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def tool_pointerTlaser(rollAng, panAng, tiltAng, residuals = np.zeros([4,6])):\n return tr.invertHomogeneousTransform( laserTtool_pointer(rollAng, panAng, tiltAng, residuals) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L92_C4", "label": "return", "type": "return", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L91_C0", "vector": [13, 1, 0.844, 0.0092, 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 tr.invertHomogeneousTransform( laserTtool_pointer(rollAng, panAng, tiltAng, residuals) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L95_C0", "label": "laserTtool_MA", "type": "function", "loc": [95, 105], "level": 0, "parent": null, "vector": [2, 0, 0.9174, 0.1009, 0, 0.66, 0.9167, 893, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "laserTtool_MA", "arg_names": ["rollAng", "panAng", "tiltAng", "residuals"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def laserTtool_MA(rollAng, panAng, tiltAng, residuals = np.zeros([4,6])):\n '''\n This is specifically for the multi-antenna (MA) tool attachment! Tool coordinate frame will change for each tool.\n Here, residuals are 4x6 array where:\n res[0] = rollTtool\n res[1] = panTroll\n res[2] = tiltTpan\n res[3] = laserTtilt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Expr_L96_C4", "label": "expression", "type": "expression", "loc": [96, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L95_C0", "vector": [8, 1, 0.9128, 0.0734, 1, 0.8, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n This is specifically for the multi-antenna (MA) tool attachment! Tool coordinate frame will change for each tool.\n Here, residuals are 4x6 array where:\n res[0] = rollTtool\n res[1] = panTroll\n res[2] = tiltTpan\n res[3] = laserTtilt\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L104_C4", "label": "res =", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L95_C0", "vector": [14, 1, 0.9541, 0.0092, 1, 0.8, 0.5, 413, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " res = residuals"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L105_C4", "label": "return", "type": "return", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L95_C0", "vector": [13, 1, 0.9633, 0.0092, 1, 0.8, 1.0, 0, 4, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return laserTtilt(tiltAng, res[3] ) * tiltTpan(panAng, res[2] ) * panTroll(rollAng, res[1] ) * rollTtool_MA(res[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L107_C0", "label": "tool_MATlaser", "type": "function", "loc": [107, 108], "level": 0, "parent": null, "vector": [2, 0, 0.9862, 0.0183, 0, 0.66, 1.0, 62, 0, 4, 1, 0, 0, 0, 3], "semantic": {"name": "tool_MATlaser", "arg_names": ["rollAng", "panAng", "tiltAng", "residuals"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def tool_MATlaser(rollAng, panAng, tiltAng, residuals = np.zeros([4,6])):\n return tr.invertHomogeneousTransform( laserTtool_MA(rollAng, panAng, tiltAng, residuals) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L108_C4", "label": "return", "type": "return", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L107_C0", "vector": [13, 1, 0.9908, 0.0092, 1, 0.56, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tr.invertHomogeneousTransform( laserTtool_MA(rollAng, panAng, tiltAng, residuals) )"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Expr_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Expr_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Expr_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99722:FunctionDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99722:Return_L108_C4"}]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ''' Coordinate frames for testing ROS-interface (copied from Cody). ''' import numpy as np, math import copy import hrl_lib.transforms as tr # dictionary for transforming different coorsinate frames to global coord frame # global is NOT the world or fixed frame, its just a convenient global frame _globalT = { 'torso' : None, 'thok0' : None, 'utm0' : None, 'utmcam0': None, 'mecanum': None } def create_globalTDict(): """ call the create functions for all the coord frames """ createTorsoTransform() createThok0Transform() createUtm0Transform() createMecanumTransform() def createTorsoTransform(): ''' torso frame -> global frame ''' disp = np.matrix([0.,0.,0.]).T rot = np.matrix(np.eye(3)) t = tr.composeHomogeneousTransform(rot,disp) _globalT['torso'] = t def createThok0Transform(): ''' thok0 frame -> global frame ''' disp = np.matrix([0.,0.,0.09]).T rot = np.matrix(np.eye(3)) t = tr.composeHomogeneousTransform(rot,disp) _globalT['thok0'] = t def createUtm0Transform(): ''' utm0 frame -> global frame ''' disp = copy.copy(tr.getDispSubMat(_globalT['thok0'])) disp[2,0] += 0.055 rot = np.matrix(np.eye(3)) t = tr.composeHomogeneousTransform(rot,disp) _globalT['utm0'] = t def createMecanumTransform(): ''' mecanum frame -> global frame (ignores the zenither) ''' disp = np.matrix([-0.25,0.,0.0]).T rot = np.matrix(np.eye(3)) t = tr.composeHomogeneousTransform(rot,disp) _globalT['mecanum'] = t create_globalTDict() def globalTmecanum(p,floating_vector=False): ''' 3x1 vector from mecanum to global. ''' p_hom = tr.xyzToHomogenous(p, floating_vector) p_gl = _globalT['mecanum'] * p_hom if floating_vector == False: return p_gl[0:3]/p_gl[3] else: return p_gl[0:3] def mecanumTglobal(p,floating_vector=False): ''' 3x1 vector from global to mecanum. ''' p_hom = tr.xyzToHomogenous(p, floating_vector) p_gl = tr.invertHomogeneousTransform(_globalT['mecanum']) * p_hom if floating_vector == False: return p_gl[0:3]/p_gl[3] else: return p_gl[0:3] def globalTtorso(p,floating_vector=False): ''' 3x1 vector from torso to global. ''' p_hom = tr.xyzToHomogenous(p, floating_vector) p_gl = _globalT['torso'] * p_hom if floating_vector == False: return p_gl[0:3]/p_gl[3] else: return p_gl[0:3] def torsoTglobal(p,floating_vector=False): ''' 3x1 vector from global to torso. ''' p_hom = tr.xyzToHomogenous(p, floating_vector) p_gl = tr.invertHomogeneousTransform(_globalT['torso']) * p_hom if floating_vector == False: return p_gl[0:3]/p_gl[3] else: return p_gl[0:3] def globalTthok0(p,floating_vector=False): ''' 3x1 vector from thok0 to global. ''' p_hom = tr.xyzToHomogenous(p, floating_vector) p_gl = _globalT['thok0'] * p_hom if floating_vector == False: return p_gl[0:3]/p_gl[3] else: return p_gl[0:3] def thok0Tglobal(p,floating_vector=False): ''' 3x1 vector from global to thok0. ''' p_hom = tr.xyzToHomogenous(p, floating_vector) p_gl = tr.invertHomogeneousTransform(_globalT['thok0']) * p_hom if floating_vector == False: return p_gl[0:3]/p_gl[3] else: return p_gl[0:3] def globalTutm0(p,floating_vector=False): ''' 3x1 vector from utm0 to global. ''' p_hom = tr.xyzToHomogenous(p, floating_vector) p_gl = _globalT['utm0'] * p_hom if floating_vector == False: return p_gl[0:3]/p_gl[3] else: return p_gl[0:3] def utm0Tglobal(p,floating_vector=False): ''' 3x1 vector from global to utm0. ''' p_hom = tr.xyzToHomogenous(p, floating_vector) p_gl = tr.invertHomogeneousTransform(_globalT['utm0']) * p_hom if floating_vector == False: return p_gl[0:3]/p_gl[3] else: return p_gl[0:3] ## transformation matrix to go from global to utmcam0 coord frame. # @param ang - servo angle (in RADIANS) # @return 4x4 transformation matrix. def utmcam0Tglobal_mat(ang): thok0Tglobal_mat = tr.invertHomogeneousTransform(_globalT['thok0']) # servo angle. disp = np.matrix([0.,0.,0.]).T tmat = tr.composeHomogeneousTransform(tr.Ry(ang),disp)*thok0Tglobal_mat # cameraTlaser from thok_cam_calib.py x = 0.012 y = -0.056 z = 0.035 r1 = 0. r2 = 0. r3 = -0.7 disp = np.matrix([-x,-y,-z]).T r = tr.Rz(math.radians(-90))*tr.Ry(math.radians(90.)) disp = r*disp r = r*tr.Rx(math.radians(r1)) r = r*tr.Ry(math.radians(r2)) r = r*tr.Rz(math.radians(r3)) t = tr.composeHomogeneousTransform(r, disp) tmat = t*tmat return tmat ## global to utmcam0 coord frame. # @param p - 3xN np matrix. # @param ang - servo angle (in RADIANS) # @param floating_vector - interpretation of p. False -> position vector. True -> floating vector (rotation only). # @return 3xN np matrix in the new coord frame. def utmcam0Tglobal(p,ang,floating_vector=False): t = utmcam0Tglobal_mat(ang) p_hom = tr.xyzToHomogenous(p, floating_vector) p_c = t * p_hom if floating_vector == False: pt = p_c[0:3]/p_c[3] else: pt = p_c[0:3] return pt ## utmcam0 coord frame to global # @param p - 3xN np matrix. # @param ang - servo angle (in RADIANS) # @param floating_vector - interpretation of p. False -> position vector. True -> floating vector (rotation only). # @return 3xN np matrix in the new coord frame. def globalTutmcam0(p,ang,floating_vector=False): t = utmcam0Tglobal_mat(ang) t = tr.invertHomogeneousTransform(t) p_hom = tr.xyzToHomogenous(p, floating_vector) p_c = t * p_hom if floating_vector == False: pt = p_c[0:3]/p_c[3] else: pt = p_c[0:3] return pt
ajibawa-2023/Python-Code-Large/train/row_99723
128
228
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L28_C0", "label": "expression", "type": "expression", "loc": [28, 29], "level": 0, "parent": null, "vector": [8, 0, 0.125, 0.0088, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "''' Coordinate frames for testing ROS-interface (copied from Cody).\n'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Import_L31_C0", "label": "numpy import np, math", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.136, 0.0044, 0, 0.66, 0.0476, 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_99723:Import_L32_C0", "label": "copy import copy", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.1404, 0.0044, 0, 0.66, 0.0952, 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_99723:Import_L33_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.1447, 0.0044, 0, 0.66, 0.1429, 82, 0, 1, 0, 0, 82, 0, 0], "semantic": {"name": "hrl_lib.transforms", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L37_C0", "label": "_globalT =", "type": "assigned_variable", "loc": [37, 43], "level": 0, "parent": null, "vector": [14, 0, 0.1754, 0.0307, 0, 0.66, 0.1905, 276, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "_globalT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_globalT = {\n 'torso' : None,\n 'thok0' : None,\n 'utm0' : None,\n 'utmcam0': None,\n 'mecanum': None\n}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L45_C0", "label": "create_globalTDict", "type": "function", "loc": [45, 51], "level": 0, "parent": null, "vector": [2, 0, 0.2105, 0.0307, 0, 0.66, 0.2381, 430, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "create_globalTDict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_globalTDict():\n \"\"\" call the create functions for all the coord frames\n \"\"\"\n createTorsoTransform()\n createThok0Transform()\n createUtm0Transform()\n createMecanumTransform()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L46_C4", "label": "expression", "type": "expression", "loc": [46, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L45_C0", "vector": [8, 1, 0.2039, 0.0088, 1, 0.2, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" call the create functions for all the coord frames\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L48_C4", "label": "createTorsoTransform()", "type": "expression", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L45_C0", "vector": [8, 1, 0.2105, 0.0044, 1, 0.2, 0.25, 911, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "createTorsoTransform", "arg_names": [], "import_names": [], "rhs_call_name": "createTorsoTransform", "annotation": ""}, "snippet": " createTorsoTransform()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L49_C4", "label": "createThok0Transform()", "type": "expression", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L45_C0", "vector": [8, 1, 0.2149, 0.0044, 1, 0.2, 0.5, 480, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "createThok0Transform", "arg_names": [], "import_names": [], "rhs_call_name": "createThok0Transform", "annotation": ""}, "snippet": " createThok0Transform()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L50_C4", "label": "createUtm0Transform()", "type": "expression", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L45_C0", "vector": [8, 1, 0.2193, 0.0044, 1, 0.2, 0.75, 84, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "createUtm0Transform", "arg_names": [], "import_names": [], "rhs_call_name": "createUtm0Transform", "annotation": ""}, "snippet": " createUtm0Transform()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L51_C4", "label": "createMecanumTransform()", "type": "expression", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L45_C0", "vector": [8, 1, 0.2237, 0.0044, 1, 0.2, 1.0, 361, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "createMecanumTransform", "arg_names": [], "import_names": [], "rhs_call_name": "createMecanumTransform", "annotation": ""}, "snippet": " createMecanumTransform()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L53_C0", "label": "createTorsoTransform", "type": "function", "loc": [53, 59], "level": 0, "parent": null, "vector": [2, 0, 0.2456, 0.0307, 0, 0.66, 0.2857, 911, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "createTorsoTransform", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def createTorsoTransform():\n ''' torso frame -> global frame\n '''\n disp = np.matrix([0.,0.,0.]).T\n rot = np.matrix(np.eye(3))\n t = tr.composeHomogeneousTransform(rot,disp)\n _globalT['torso'] = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L54_C4", "label": "expression", "type": "expression", "loc": [54, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L53_C0", "vector": [8, 1, 0.239, 0.0088, 1, 0.48, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' torso frame -> global frame\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L56_C4", "label": "disp =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L53_C0", "vector": [14, 1, 0.2456, 0.0044, 1, 0.48, 0.25, 654, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " disp = np.matrix([0.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L57_C4", "label": "rot = matrix()", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L53_C0", "vector": [14, 1, 0.25, 0.0044, 1, 0.48, 0.5, 812, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " rot = np.matrix(np.eye(3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L58_C4", "label": "t = composeHomogeneousTransform()", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L53_C0", "vector": [14, 1, 0.2544, 0.0044, 1, 0.48, 0.75, 15, 3, 2, 0, 0, 126, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "composeHomogeneousTransform", "annotation": ""}, "snippet": " t = tr.composeHomogeneousTransform(rot,disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L59_C4", "label": "assign", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L53_C0", "vector": [14, 1, 0.2588, 0.0044, 1, 0.48, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _globalT['torso'] = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L61_C0", "label": "createThok0Transform", "type": "function", "loc": [61, 67], "level": 0, "parent": null, "vector": [2, 0, 0.2807, 0.0307, 0, 0.66, 0.3333, 480, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "createThok0Transform", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def createThok0Transform():\n ''' thok0 frame -> global frame\n '''\n disp = np.matrix([0.,0.,0.09]).T\n rot = np.matrix(np.eye(3))\n t = tr.composeHomogeneousTransform(rot,disp)\n _globalT['thok0'] = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L62_C4", "label": "expression", "type": "expression", "loc": [62, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L61_C0", "vector": [8, 1, 0.2741, 0.0088, 1, 0.83, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' thok0 frame -> global frame\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L64_C4", "label": "disp =", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L61_C0", "vector": [14, 1, 0.2807, 0.0044, 1, 0.83, 0.25, 654, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " disp = np.matrix([0.,0.,0.09]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L65_C4", "label": "rot = matrix()", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L61_C0", "vector": [14, 1, 0.2851, 0.0044, 1, 0.83, 0.5, 812, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " rot = np.matrix(np.eye(3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L66_C4", "label": "t = composeHomogeneousTransform()", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L61_C0", "vector": [14, 1, 0.2895, 0.0044, 1, 0.83, 0.75, 15, 3, 2, 0, 0, 126, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "composeHomogeneousTransform", "annotation": ""}, "snippet": " t = tr.composeHomogeneousTransform(rot,disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L67_C4", "label": "assign", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L61_C0", "vector": [14, 1, 0.2939, 0.0044, 1, 0.83, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _globalT['thok0'] = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L69_C0", "label": "createUtm0Transform", "type": "function", "loc": [69, 76], "level": 0, "parent": null, "vector": [2, 0, 0.318, 0.0351, 0, 0.66, 0.381, 84, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "createUtm0Transform", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def createUtm0Transform():\n ''' utm0 frame -> global frame\n '''\n disp = copy.copy(tr.getDispSubMat(_globalT['thok0']))\n disp[2,0] += 0.055\n rot = np.matrix(np.eye(3))\n t = tr.composeHomogeneousTransform(rot,disp)\n _globalT['utm0'] = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L70_C4", "label": "expression", "type": "expression", "loc": [70, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L69_C0", "vector": [8, 1, 0.3092, 0.0088, 1, 0.59, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' utm0 frame -> global frame\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L72_C4", "label": "disp = copy()", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L69_C0", "vector": [14, 1, 0.3158, 0.0044, 1, 0.59, 0.25, 654, 3, 1, 0, 0, 739, 10, 2], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " disp = copy.copy(tr.getDispSubMat(_globalT['thok0']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L74_C4", "label": "rot = matrix()", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L69_C0", "vector": [14, 1, 0.3246, 0.0044, 1, 0.59, 0.5, 812, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " rot = np.matrix(np.eye(3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L75_C4", "label": "t = composeHomogeneousTransform()", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L69_C0", "vector": [14, 1, 0.3289, 0.0044, 1, 0.59, 0.75, 15, 3, 2, 0, 0, 126, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "composeHomogeneousTransform", "annotation": ""}, "snippet": " t = tr.composeHomogeneousTransform(rot,disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L76_C4", "label": "assign", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L69_C0", "vector": [14, 1, 0.3333, 0.0044, 1, 0.59, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _globalT['utm0'] = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L78_C0", "label": "createMecanumTransform", "type": "function", "loc": [78, 84], "level": 0, "parent": null, "vector": [2, 0, 0.3553, 0.0307, 0, 0.66, 0.4286, 361, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "createMecanumTransform", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def createMecanumTransform():\n ''' mecanum frame -> global frame (ignores the zenither)\n '''\n disp = np.matrix([-0.25,0.,0.0]).T\n rot = np.matrix(np.eye(3))\n t = tr.composeHomogeneousTransform(rot,disp)\n _globalT['mecanum'] = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L79_C4", "label": "expression", "type": "expression", "loc": [79, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L78_C0", "vector": [8, 1, 0.3487, 0.0088, 1, 0.01, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' mecanum frame -> global frame (ignores the zenither)\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L81_C4", "label": "disp =", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L78_C0", "vector": [14, 1, 0.3553, 0.0044, 1, 0.01, 0.25, 654, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " disp = np.matrix([-0.25,0.,0.0]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L82_C4", "label": "rot = matrix()", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L78_C0", "vector": [14, 1, 0.3596, 0.0044, 1, 0.01, 0.5, 812, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " rot = np.matrix(np.eye(3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L83_C4", "label": "t = composeHomogeneousTransform()", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L78_C0", "vector": [14, 1, 0.364, 0.0044, 1, 0.01, 0.75, 15, 3, 2, 0, 0, 126, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "composeHomogeneousTransform", "annotation": ""}, "snippet": " t = tr.composeHomogeneousTransform(rot,disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L84_C4", "label": "assign", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L78_C0", "vector": [14, 1, 0.3684, 0.0044, 1, 0.01, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _globalT['mecanum'] = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L86_C0", "label": "create_globalTDict()", "type": "expression", "loc": [86, 86], "level": 0, "parent": null, "vector": [8, 0, 0.3772, 0.0044, 0, 0.66, 0.4762, 430, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "create_globalTDict", "arg_names": [], "import_names": [], "rhs_call_name": "create_globalTDict", "annotation": ""}, "snippet": "create_globalTDict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L89_C0", "label": "globalTmecanum", "type": "function", "loc": [89, 97], "level": 0, "parent": null, "vector": [2, 0, 0.4079, 0.0395, 0, 0.66, 0.5238, 734, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "globalTmecanum", "arg_names": ["p", "floating_vector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def globalTmecanum(p,floating_vector=False):\n ''' 3x1 vector from mecanum to global.\n '''\n p_hom = tr.xyzToHomogenous(p, floating_vector)\n p_gl = _globalT['mecanum'] * p_hom\n if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L90_C4", "label": "expression", "type": "expression", "loc": [90, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L89_C0", "vector": [8, 1, 0.3969, 0.0088, 1, 0.44, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' 3x1 vector from mecanum to global.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L92_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L89_C0", "vector": [14, 1, 0.4035, 0.0044, 1, 0.44, 0.3333, 254, 3, 2, 0, 0, 438, 10, 1], "semantic": {"name": "p_hom", "arg_names": [], "import_names": [], "rhs_call_name": "xyzToHomogenous", "annotation": ""}, "snippet": " p_hom = tr.xyzToHomogenous(p, floating_vector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L93_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L89_C0", "vector": [14, 1, 0.4079, 0.0044, 1, 0.44, 0.6667, 258, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_gl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_gl = _globalT['mecanum'] * p_hom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L94_C4", "label": "if", "type": "if", "loc": [94, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L89_C0", "vector": [4, 1, 0.4189, 0.0175, 1, 0.44, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:\n return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L95_C8", "label": "return", "type": "return", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L94_C4", "vector": [13, 2, 0.4167, 0.0044, 2, 0.4, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]/p_gl[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L97_C8", "label": "return", "type": "return", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L94_C4", "vector": [13, 2, 0.4254, 0.0044, 2, 0.4, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L99_C0", "label": "mecanumTglobal", "type": "function", "loc": [99, 107], "level": 0, "parent": null, "vector": [2, 0, 0.4518, 0.0395, 0, 0.66, 0.5714, 406, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "mecanumTglobal", "arg_names": ["p", "floating_vector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def mecanumTglobal(p,floating_vector=False):\n ''' 3x1 vector from global to mecanum.\n '''\n p_hom = tr.xyzToHomogenous(p, floating_vector)\n p_gl = tr.invertHomogeneousTransform(_globalT['mecanum']) * p_hom\n if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L100_C4", "label": "expression", "type": "expression", "loc": [100, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L99_C0", "vector": [8, 1, 0.4408, 0.0088, 1, 0.18, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' 3x1 vector from global to mecanum.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L102_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L99_C0", "vector": [14, 1, 0.4474, 0.0044, 1, 0.18, 0.3333, 254, 3, 2, 0, 0, 438, 10, 1], "semantic": {"name": "p_hom", "arg_names": [], "import_names": [], "rhs_call_name": "xyzToHomogenous", "annotation": ""}, "snippet": " p_hom = tr.xyzToHomogenous(p, floating_vector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L103_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L99_C0", "vector": [14, 1, 0.4518, 0.0044, 1, 0.18, 0.6667, 258, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p_gl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_gl = tr.invertHomogeneousTransform(_globalT['mecanum']) * p_hom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L104_C4", "label": "if", "type": "if", "loc": [104, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L99_C0", "vector": [4, 1, 0.4627, 0.0175, 1, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:\n return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L105_C8", "label": "return", "type": "return", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L104_C4", "vector": [13, 2, 0.4605, 0.0044, 2, 0.13, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]/p_gl[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L107_C8", "label": "return", "type": "return", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L104_C4", "vector": [13, 2, 0.4693, 0.0044, 2, 0.13, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L109_C0", "label": "globalTtorso", "type": "function", "loc": [109, 117], "level": 0, "parent": null, "vector": [2, 0, 0.4956, 0.0395, 0, 0.66, 0.619, 609, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "globalTtorso", "arg_names": ["p", "floating_vector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def globalTtorso(p,floating_vector=False):\n ''' 3x1 vector from torso to global.\n '''\n p_hom = tr.xyzToHomogenous(p, floating_vector)\n p_gl = _globalT['torso'] * p_hom\n if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L110_C4", "label": "expression", "type": "expression", "loc": [110, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L109_C0", "vector": [8, 1, 0.4846, 0.0088, 1, 0.02, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' 3x1 vector from torso to global.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L112_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L109_C0", "vector": [14, 1, 0.4912, 0.0044, 1, 0.02, 0.3333, 254, 3, 2, 0, 0, 438, 10, 1], "semantic": {"name": "p_hom", "arg_names": [], "import_names": [], "rhs_call_name": "xyzToHomogenous", "annotation": ""}, "snippet": " p_hom = tr.xyzToHomogenous(p, floating_vector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L113_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L109_C0", "vector": [14, 1, 0.4956, 0.0044, 1, 0.02, 0.6667, 258, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_gl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_gl = _globalT['torso'] * p_hom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L114_C4", "label": "if", "type": "if", "loc": [114, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L109_C0", "vector": [4, 1, 0.5066, 0.0175, 1, 0.02, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:\n return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L115_C8", "label": "return", "type": "return", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L114_C4", "vector": [13, 2, 0.5044, 0.0044, 2, 0.41, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]/p_gl[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L117_C8", "label": "return", "type": "return", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L114_C4", "vector": [13, 2, 0.5132, 0.0044, 2, 0.41, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L119_C0", "label": "torsoTglobal", "type": "function", "loc": [119, 127], "level": 0, "parent": null, "vector": [2, 0, 0.5395, 0.0395, 0, 0.66, 0.6667, 309, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "torsoTglobal", "arg_names": ["p", "floating_vector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def torsoTglobal(p,floating_vector=False):\n ''' 3x1 vector from global to torso.\n '''\n p_hom = tr.xyzToHomogenous(p, floating_vector)\n p_gl = tr.invertHomogeneousTransform(_globalT['torso']) * p_hom\n if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L120_C4", "label": "expression", "type": "expression", "loc": [120, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L119_C0", "vector": [8, 1, 0.5285, 0.0088, 1, 0.4, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' 3x1 vector from global to torso.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L122_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L119_C0", "vector": [14, 1, 0.5351, 0.0044, 1, 0.4, 0.3333, 254, 3, 2, 0, 0, 438, 10, 1], "semantic": {"name": "p_hom", "arg_names": [], "import_names": [], "rhs_call_name": "xyzToHomogenous", "annotation": ""}, "snippet": " p_hom = tr.xyzToHomogenous(p, floating_vector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L123_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L119_C0", "vector": [14, 1, 0.5395, 0.0044, 1, 0.4, 0.6667, 258, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p_gl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_gl = tr.invertHomogeneousTransform(_globalT['torso']) * p_hom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L124_C4", "label": "if", "type": "if", "loc": [124, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L119_C0", "vector": [4, 1, 0.5504, 0.0175, 1, 0.4, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:\n return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L125_C8", "label": "return", "type": "return", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L124_C4", "vector": [13, 2, 0.5482, 0.0044, 2, 0.74, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]/p_gl[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L127_C8", "label": "return", "type": "return", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L124_C4", "vector": [13, 2, 0.557, 0.0044, 2, 0.74, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L129_C0", "label": "globalTthok0", "type": "function", "loc": [129, 137], "level": 0, "parent": null, "vector": [2, 0, 0.5833, 0.0395, 0, 0.66, 0.7143, 124, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "globalTthok0", "arg_names": ["p", "floating_vector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def globalTthok0(p,floating_vector=False):\n ''' 3x1 vector from thok0 to global.\n '''\n p_hom = tr.xyzToHomogenous(p, floating_vector)\n p_gl = _globalT['thok0'] * p_hom\n if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L130_C4", "label": "expression", "type": "expression", "loc": [130, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L129_C0", "vector": [8, 1, 0.5724, 0.0088, 1, 0.86, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' 3x1 vector from thok0 to global.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L132_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [132, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L129_C0", "vector": [14, 1, 0.5789, 0.0044, 1, 0.86, 0.3333, 254, 3, 2, 0, 0, 438, 10, 1], "semantic": {"name": "p_hom", "arg_names": [], "import_names": [], "rhs_call_name": "xyzToHomogenous", "annotation": ""}, "snippet": " p_hom = tr.xyzToHomogenous(p, floating_vector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L133_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L129_C0", "vector": [14, 1, 0.5833, 0.0044, 1, 0.86, 0.6667, 258, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_gl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_gl = _globalT['thok0'] * p_hom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L134_C4", "label": "if", "type": "if", "loc": [134, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L129_C0", "vector": [4, 1, 0.5943, 0.0175, 1, 0.86, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:\n return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L135_C8", "label": "return", "type": "return", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L134_C4", "vector": [13, 2, 0.5921, 0.0044, 2, 0.54, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]/p_gl[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L137_C8", "label": "return", "type": "return", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L134_C4", "vector": [13, 2, 0.6009, 0.0044, 2, 0.54, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L139_C0", "label": "thok0Tglobal", "type": "function", "loc": [139, 147], "level": 0, "parent": null, "vector": [2, 0, 0.6272, 0.0395, 0, 0.66, 0.7619, 419, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "thok0Tglobal", "arg_names": ["p", "floating_vector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def thok0Tglobal(p,floating_vector=False):\n ''' 3x1 vector from global to thok0.\n '''\n p_hom = tr.xyzToHomogenous(p, floating_vector)\n p_gl = tr.invertHomogeneousTransform(_globalT['thok0']) * p_hom\n if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L140_C4", "label": "expression", "type": "expression", "loc": [140, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L139_C0", "vector": [8, 1, 0.6162, 0.0088, 1, 0.3, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' 3x1 vector from global to thok0.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L142_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [142, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L139_C0", "vector": [14, 1, 0.6228, 0.0044, 1, 0.3, 0.3333, 254, 3, 2, 0, 0, 438, 10, 1], "semantic": {"name": "p_hom", "arg_names": [], "import_names": [], "rhs_call_name": "xyzToHomogenous", "annotation": ""}, "snippet": " p_hom = tr.xyzToHomogenous(p, floating_vector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L143_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [143, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L139_C0", "vector": [14, 1, 0.6272, 0.0044, 1, 0.3, 0.6667, 258, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p_gl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_gl = tr.invertHomogeneousTransform(_globalT['thok0']) * p_hom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L144_C4", "label": "if", "type": "if", "loc": [144, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L139_C0", "vector": [4, 1, 0.6382, 0.0175, 1, 0.3, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:\n return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L145_C8", "label": "return", "type": "return", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L144_C4", "vector": [13, 2, 0.636, 0.0044, 2, 0.78, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]/p_gl[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L147_C8", "label": "return", "type": "return", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L144_C4", "vector": [13, 2, 0.6447, 0.0044, 2, 0.78, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L149_C0", "label": "globalTutm0", "type": "function", "loc": [149, 157], "level": 0, "parent": null, "vector": [2, 0, 0.6711, 0.0395, 0, 0.66, 0.8095, 942, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "globalTutm0", "arg_names": ["p", "floating_vector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def globalTutm0(p,floating_vector=False):\n ''' 3x1 vector from utm0 to global.\n '''\n p_hom = tr.xyzToHomogenous(p, floating_vector)\n p_gl = _globalT['utm0'] * p_hom\n if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L150_C4", "label": "expression", "type": "expression", "loc": [150, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L149_C0", "vector": [8, 1, 0.6601, 0.0088, 1, 0.1, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' 3x1 vector from utm0 to global.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L152_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [152, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L149_C0", "vector": [14, 1, 0.6667, 0.0044, 1, 0.1, 0.3333, 254, 3, 2, 0, 0, 438, 10, 1], "semantic": {"name": "p_hom", "arg_names": [], "import_names": [], "rhs_call_name": "xyzToHomogenous", "annotation": ""}, "snippet": " p_hom = tr.xyzToHomogenous(p, floating_vector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L153_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [153, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L149_C0", "vector": [14, 1, 0.6711, 0.0044, 1, 0.1, 0.6667, 258, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_gl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_gl = _globalT['utm0'] * p_hom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L154_C4", "label": "if", "type": "if", "loc": [154, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L149_C0", "vector": [4, 1, 0.682, 0.0175, 1, 0.1, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:\n return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L155_C8", "label": "return", "type": "return", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L154_C4", "vector": [13, 2, 0.6798, 0.0044, 2, 0.62, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]/p_gl[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L157_C8", "label": "return", "type": "return", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L154_C4", "vector": [13, 2, 0.6886, 0.0044, 2, 0.62, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L159_C0", "label": "utm0Tglobal", "type": "function", "loc": [159, 167], "level": 0, "parent": null, "vector": [2, 0, 0.7149, 0.0395, 0, 0.66, 0.8571, 692, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "utm0Tglobal", "arg_names": ["p", "floating_vector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def utm0Tglobal(p,floating_vector=False):\n ''' 3x1 vector from global to utm0.\n '''\n p_hom = tr.xyzToHomogenous(p, floating_vector)\n p_gl = tr.invertHomogeneousTransform(_globalT['utm0']) * p_hom\n if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L160_C4", "label": "expression", "type": "expression", "loc": [160, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L159_C0", "vector": [8, 1, 0.7039, 0.0088, 1, 0.91, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' 3x1 vector from global to utm0.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L162_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [162, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L159_C0", "vector": [14, 1, 0.7105, 0.0044, 1, 0.91, 0.3333, 254, 3, 2, 0, 0, 438, 10, 1], "semantic": {"name": "p_hom", "arg_names": [], "import_names": [], "rhs_call_name": "xyzToHomogenous", "annotation": ""}, "snippet": " p_hom = tr.xyzToHomogenous(p, floating_vector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L163_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [163, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L159_C0", "vector": [14, 1, 0.7149, 0.0044, 1, 0.91, 0.6667, 258, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p_gl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_gl = tr.invertHomogeneousTransform(_globalT['utm0']) * p_hom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L164_C4", "label": "if", "type": "if", "loc": [164, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L159_C0", "vector": [4, 1, 0.7259, 0.0175, 1, 0.91, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:\n return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L165_C8", "label": "return", "type": "return", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L164_C4", "vector": [13, 2, 0.7237, 0.0044, 2, 0.37, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]/p_gl[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L167_C8", "label": "return", "type": "return", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L164_C4", "vector": [13, 2, 0.7325, 0.0044, 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 p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "label": "utmcam0Tglobal_mat", "type": "function", "loc": [172, 194], "level": 0, "parent": null, "vector": [2, 0, 0.8026, 0.1009, 0, 0.66, 0.9048, 670, 0, 1, 1, 0, 0, 0, 16], "semantic": {"name": "utmcam0Tglobal_mat", "arg_names": ["ang"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def utmcam0Tglobal_mat(ang):\n thok0Tglobal_mat = tr.invertHomogeneousTransform(_globalT['thok0'])\n # servo angle.\n disp = np.matrix([0.,0.,0.]).T\n tmat = tr.composeHomogeneousTransform(tr.Ry(ang),disp)*thok0Tglobal_mat\n\n # cameraTlaser from thok_cam_calib.py\n x = 0.012"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L173_C4", "label": "thok0Tglobal_mat = invertHomogeneousTransform()", "type": "assigned_variable", "loc": [173, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "vector": [14, 1, 0.7588, 0.0044, 1, 0.11, 0.0, 214, 3, 1, 0, 0, 505, 10, 1], "semantic": {"name": "thok0Tglobal_mat", "arg_names": [], "import_names": [], "rhs_call_name": "invertHomogeneousTransform", "annotation": ""}, "snippet": " thok0Tglobal_mat = tr.invertHomogeneousTransform(_globalT['thok0'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L175_C4", "label": "disp =", "type": "assigned_variable", "loc": [175, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "vector": [14, 1, 0.7675, 0.0044, 1, 0.11, 0.0588, 654, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " disp = np.matrix([0.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L176_C4", "label": "tmat =", "type": "assigned_variable", "loc": [176, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "vector": [14, 1, 0.7719, 0.0044, 1, 0.11, 0.1176, 205, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "tmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tmat = tr.composeHomogeneousTransform(tr.Ry(ang),disp)*thok0Tglobal_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L179_C4", "label": "x =", "type": "assigned_variable", "loc": [179, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "vector": [14, 1, 0.7851, 0.0044, 1, 0.11, 0.1765, 190, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = 0.012"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L180_C4", "label": "y =", "type": "assigned_variable", "loc": [180, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "vector": [14, 1, 0.7895, 0.0044, 1, 0.11, 0.2353, 304, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = -0.056"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L181_C4", "label": "z =", "type": "assigned_variable", "loc": [181, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "vector": [14, 1, 0.7939, 0.0044, 1, 0.11, 0.2941, 859, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = 0.035"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L182_C4", "label": "r1 =", "type": "assigned_variable", "loc": [182, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "vector": [14, 1, 0.7982, 0.0044, 1, 0.11, 0.3529, 648, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "r1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r1 = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L183_C4", "label": "r2 =", "type": "assigned_variable", "loc": [183, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "vector": [14, 1, 0.8026, 0.0044, 1, 0.11, 0.4118, 959, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "r2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r2 = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L184_C4", "label": "r3 =", "type": "assigned_variable", "loc": [184, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "vector": [14, 1, 0.807, 0.0044, 1, 0.11, 0.4706, 837, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r3", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r3 = -0.7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L185_C4", "label": "disp =", "type": "assigned_variable", "loc": [185, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "vector": [14, 1, 0.8114, 0.0044, 1, 0.11, 0.5294, 654, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " disp = np.matrix([-x,-y,-z]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L186_C4", "label": "r =", "type": "assigned_variable", "loc": [186, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "vector": [14, 1, 0.8158, 0.0044, 1, 0.11, 0.5882, 436, 4, 0, 0, 0, 0, 0, 4], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = tr.Rz(math.radians(-90))*tr.Ry(math.radians(90.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L187_C4", "label": "disp =", "type": "assigned_variable", "loc": [187, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "vector": [14, 1, 0.8202, 0.0044, 1, 0.11, 0.6471, 654, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " disp = r*disp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L188_C4", "label": "r =", "type": "assigned_variable", "loc": [188, 188], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "vector": [14, 1, 0.8246, 0.0044, 1, 0.11, 0.7059, 436, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = r*tr.Rx(math.radians(r1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L189_C4", "label": "r =", "type": "assigned_variable", "loc": [189, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "vector": [14, 1, 0.8289, 0.0044, 1, 0.11, 0.7647, 436, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = r*tr.Ry(math.radians(r2))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L190_C4", "label": "r =", "type": "assigned_variable", "loc": [190, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "vector": [14, 1, 0.8333, 0.0044, 1, 0.11, 0.8235, 436, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = r*tr.Rz(math.radians(r3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L192_C4", "label": "t = composeHomogeneousTransform()", "type": "assigned_variable", "loc": [192, 192], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "vector": [14, 1, 0.8421, 0.0044, 1, 0.11, 0.8824, 15, 3, 2, 0, 0, 126, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "composeHomogeneousTransform", "annotation": ""}, "snippet": " t = tr.composeHomogeneousTransform(r, disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L193_C4", "label": "tmat =", "type": "assigned_variable", "loc": [193, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "vector": [14, 1, 0.8465, 0.0044, 1, 0.11, 0.9412, 205, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tmat = t*tmat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L194_C4", "label": "return", "type": "return", "loc": [194, 194], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "vector": [13, 1, 0.8509, 0.0044, 1, 0.11, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tmat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L201_C0", "label": "utmcam0Tglobal", "type": "function", "loc": [201, 210], "level": 0, "parent": null, "vector": [2, 0, 0.9013, 0.0439, 0, 0.66, 0.9524, 894, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "utmcam0Tglobal", "arg_names": ["p", "ang", "floating_vector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def utmcam0Tglobal(p,ang,floating_vector=False):\n t = utmcam0Tglobal_mat(ang)\n p_hom = tr.xyzToHomogenous(p, floating_vector)\n p_c = t * p_hom\n if floating_vector == False:\n pt = p_c[0:3]/p_c[3]\n else:\n pt = p_c[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L202_C4", "label": "t = utmcam0Tglobal_mat()", "type": "assigned_variable", "loc": [202, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L201_C0", "vector": [14, 1, 0.886, 0.0044, 1, 0.01, 0.0, 15, 3, 1, 0, 0, 670, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "utmcam0Tglobal_mat", "annotation": ""}, "snippet": " t = utmcam0Tglobal_mat(ang)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L203_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [203, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L201_C0", "vector": [14, 1, 0.8904, 0.0044, 1, 0.01, 0.25, 254, 3, 2, 0, 0, 438, 10, 1], "semantic": {"name": "p_hom", "arg_names": [], "import_names": [], "rhs_call_name": "xyzToHomogenous", "annotation": ""}, "snippet": " p_hom = tr.xyzToHomogenous(p, floating_vector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L204_C4", "label": "p_c =", "type": "assigned_variable", "loc": [204, 204], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L201_C0", "vector": [14, 1, 0.8947, 0.0044, 1, 0.01, 0.5, 748, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_c = t * p_hom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L205_C4", "label": "if", "type": "if", "loc": [205, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L201_C0", "vector": [4, 1, 0.9057, 0.0175, 1, 0.01, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if floating_vector == False:\n pt = p_c[0:3]/p_c[3]\n else:\n pt = p_c[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L206_C8", "label": "pt =", "type": "assigned_variable", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L205_C4", "vector": [14, 2, 0.9035, 0.0044, 2, 0.28, 0.0, 989, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = p_c[0:3]/p_c[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L208_C8", "label": "pt =", "type": "assigned_variable", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L205_C4", "vector": [14, 2, 0.9123, 0.0044, 2, 0.28, 1.0, 989, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = p_c[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L210_C4", "label": "return", "type": "return", "loc": [210, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L201_C0", "vector": [13, 1, 0.9211, 0.0044, 1, 0.01, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L217_C0", "label": "globalTutmcam0", "type": "function", "loc": [217, 227], "level": 0, "parent": null, "vector": [2, 0, 0.9737, 0.0482, 0, 0.66, 1.0, 741, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "globalTutmcam0", "arg_names": ["p", "ang", "floating_vector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def globalTutmcam0(p,ang,floating_vector=False):\n t = utmcam0Tglobal_mat(ang)\n t = tr.invertHomogeneousTransform(t)\n p_hom = tr.xyzToHomogenous(p, floating_vector)\n p_c = t * p_hom\n if floating_vector == False:\n pt = p_c[0:3]/p_c[3]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L218_C4", "label": "t = utmcam0Tglobal_mat()", "type": "assigned_variable", "loc": [218, 218], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L217_C0", "vector": [14, 1, 0.9561, 0.0044, 1, 0.54, 0.0, 15, 3, 1, 0, 0, 670, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "utmcam0Tglobal_mat", "annotation": ""}, "snippet": " t = utmcam0Tglobal_mat(ang)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L219_C4", "label": "t = invertHomogeneousTransform()", "type": "assigned_variable", "loc": [219, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L217_C0", "vector": [14, 1, 0.9605, 0.0044, 1, 0.54, 0.2, 15, 3, 1, 0, 0, 505, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "invertHomogeneousTransform", "annotation": ""}, "snippet": " t = tr.invertHomogeneousTransform(t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L220_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [220, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L217_C0", "vector": [14, 1, 0.9649, 0.0044, 1, 0.54, 0.4, 254, 3, 2, 0, 0, 438, 10, 1], "semantic": {"name": "p_hom", "arg_names": [], "import_names": [], "rhs_call_name": "xyzToHomogenous", "annotation": ""}, "snippet": " p_hom = tr.xyzToHomogenous(p, floating_vector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L221_C4", "label": "p_c =", "type": "assigned_variable", "loc": [221, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L217_C0", "vector": [14, 1, 0.9693, 0.0044, 1, 0.54, 0.6, 748, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_c = t * p_hom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L222_C4", "label": "if", "type": "if", "loc": [222, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L217_C0", "vector": [4, 1, 0.9803, 0.0175, 1, 0.54, 0.8, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if floating_vector == False:\n pt = p_c[0:3]/p_c[3]\n else:\n pt = p_c[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L223_C8", "label": "pt =", "type": "assigned_variable", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L222_C4", "vector": [14, 2, 0.9781, 0.0044, 2, 0.63, 0.0, 989, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = p_c[0:3]/p_c[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L225_C8", "label": "pt =", "type": "assigned_variable", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L222_C4", "vector": [14, 2, 0.9868, 0.0044, 2, 0.63, 1.0, 989, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = p_c[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L227_C4", "label": "return", "type": "return", "loc": [227, 227], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L217_C0", "vector": [13, 1, 0.9956, 0.0044, 1, 0.54, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pt"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Expr_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L186_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L190_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L218_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L220_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L222_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:If_L222_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Assign_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99723:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99723:Return_L227_C4"}]
#! /usr/bin/env python # # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) import scanner #import processor import configuration #import hrl_lib.util as ut # #import roslib; roslib.load_manifest('laser_camera_segmentation') #import hrl_hokuyo.hokuyo_scan as hs #import hrl_hokuyo.hokuyo_scan as hokuyo_scan #import opencv as cv #from opencv import highgui # #import pylab #from matplotlib.patches import Rectangle # #my_svm = cv.CvSVM() ##print CvSVM::train(const CvMat* _train_data, const CvMat* _responses, const CvMat* _var_idx=0, const CvMat* _sample_idx=0, CvSVMParams _params=CvSVMParams()) #train_data = cv.cvCreateMat(10,2,cv.CV_32FC1) #CvMat* cvCreateMat(int rows, int cols, int type) #train_data[0][0] = 1 #train_data[1][0] = 2 #train_data[2][0] = 3 #train_data[3][0] = 4 #train_data[4][0] = 5 #train_data[5][0] = 6 #train_data[6][0] = 7 #train_data[7][0] = 8 #train_data[8][0] = 9 #train_data[9][0] = 10 #train_data[0][1] = 1 #train_data[1][1] = 2 #train_data[2][1] = 3 #train_data[3][1] = 4 #train_data[4][1] = 5 #train_data[5][1] = 6 #train_data[6][1] = 7 #train_data[7][1] = 8 #train_data[8][1] = 9 #train_data[9][1] = 10 # #for i in range(10): # print train_data[i][0] # print train_data[i][1] # print '###' # #responses = cv.cvCreateMat(10,1,cv.CV_32FC1) #responses[0] = 1 #responses[1] = 1 #responses[2] = 1 #responses[3] = 1 #responses[4] = 1 #responses[5] = 0 #responses[6] = 0 #responses[7] = 0 #responses[8] = 0 #responses[9] = 0 # # #params = cv.CvSVMParams() #params.svm_type = cv.CvSVM.C_SVC ## Type of SVM, one of the following types: ## CvSVM::C_SVC - n-class classification (n>=2), allows imperfect separation of classes with penalty multiplier C for outliers. ## CvSVM::NU_SVC - n-class classification with possible imperfect separation. Parameter nu (in the range 0..1, the larger the value, the smoother the decision boundary) is used instead of C. ## CvSVM::ONE_CLASS - one-class SVM. All the training data are from the same class, SVM builds a boundary that separates the class from the rest of the feature space. ## CvSVM::EPS_SVR - regression. The distance between feature vectors from the training set and the fitting hyperplane must be less than p. For outliers the penalty multiplier C is used. ## CvSVM::NU_SVR - regression; nu is used instead of p. #params.kernel_type = cv.CvSVM.SIGMOID ##CvSVM::LINEAR - no mapping is done, linear discrimination (or regression) is done in the original feature space. It is the fastest option. d(x,y) = x*y == (x,y) ##CvSVM::POLY - polynomial kernel: d(x,y) = (gamma*(x*y)+coef0)degree ##CvSVM::RBF - radial-basis-function kernel; a good choice in most cases: d(x,y) = exp(-gamma*|x-y|2) ##CvSVM::SIGMOID - sigmoid function is used as a kernel: d(x,y) = tanh(gamma*(x*y)+coef0) # #print my_svm.train_auto(train_data, responses,None,None,params) #print my_svm.get_params() #test = cv.cvCreateMat(1,2,cv.CV_32FC1) #test[0] = 6 #test[1] = 8.7878 #print my_svm.predict(test) # #import matplotlib.pyplot as plt #import matplotlib.image as mpimg #import numpy as np # #n = 100 #m = 100 #results = np.array(-1*np.ones((n,m))) # #for i in range(n): # for j in range(m): # test[0]=i # test[1]=j # results[i][j] = my_svm.predict(test) # #print str(i) + ' ' + str(j) + ' ' + ' -> ' + str(results[i][j]) # ##print results # #imgplot = plt.imshow(results, cmap=pylab.cm.gray, interpolation='nearest') ##imgplot = plt.imshow(np.array(train_data).transpose()) ##imgscatter = plt.scatter(np.array(train_data)[:,0], np.array(train_data)[:,1]) #plt.show() # # # ##pylab.ion() #interactive ##pylab.figure(figsize=(8,4)) ##pylab.hold(True) ##pylab.subplot(121) ##pylab.title('test') ##pylab.imshow(responses, cmap=pylab.cm.gray, interpolation='nearest') ## ##pylab.draw() # # # ##cfg = configuration.configuration('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling') ###sc = scanner.scanner(cfg) ##pc = processor.processor(cfg) ## ###name = ut.formatted_time() ###sc.capture_and_save(name) ###pc.load_raw_data(name) ## ##id = '2009Sep14_095609' ##pc.load_raw_data(id) ##pc.load_metadata(id) ##print pc.scan_dataset.id ##print pc.scan_dataset.polygons ##pc.create_polygon_images() ##pc.process_raw_data() ###pc.save_mapped_image(name) ##pc.display_all_data() ## ##print pc.scan_dataset.polygons[0].cvImage[400] # # ##! /usr/bin/env python # # # cfg = configuration.configuration('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/calib') cfg.webcam_id = 0 sc = scanner.scanner(cfg) ##pc = processor.processor(cfg) ## ###name = ut.formatted_time() sc.capture_and_save('calib') ## ##pc.load_raw_data('2009Oct17_114217') ##pc.process_raw_data() ##pc.display_all_data() # # print 'done'
ajibawa-2023/Python-Code-Large/train/row_99724
7
190
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99724:Import_L32_C0", "label": "scanner import scanner", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.1684, 0.0053, 0, 0.66, 0.0, 802, 0, 1, 0, 0, 802, 0, 0], "semantic": {"name": "scanner", "arg_names": [], "import_names": ["scanner"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scanner "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99724:Import_L34_C0", "label": "configuration import configuration", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.1789, 0.0053, 0, 0.66, 0.1667, 627, 0, 1, 0, 0, 627, 0, 0], "semantic": {"name": "configuration", "arg_names": [], "import_names": ["configuration"], "rhs_call_name": "", "annotation": ""}, "snippet": "import configuration "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99724:Assign_L171_C0", "label": "cfg = configuration()", "type": "assigned_variable", "loc": [171, 171], "level": 0, "parent": null, "vector": [14, 0, 0.9, 0.0053, 0, 0.66, 0.3333, 46, 3, 1, 0, 0, 627, 10, 1], "semantic": {"name": "cfg", "arg_names": [], "import_names": [], "rhs_call_name": "configuration", "annotation": ""}, "snippet": "cfg = configuration.configuration('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/calib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99724:Assign_L172_C0", "label": "cfg.webcam_id =", "type": "assigned_variable", "loc": [172, 172], "level": 0, "parent": null, "vector": [14, 0, 0.9053, 0.0053, 0, 0.66, 0.5, 485, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "cfg.webcam_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "cfg.webcam_id = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99724:Assign_L173_C0", "label": "sc = scanner()", "type": "assigned_variable", "loc": [173, 173], "level": 0, "parent": null, "vector": [14, 0, 0.9105, 0.0053, 0, 0.66, 0.6667, 356, 3, 1, 0, 0, 802, 10, 1], "semantic": {"name": "sc", "arg_names": [], "import_names": [], "rhs_call_name": "scanner", "annotation": ""}, "snippet": "sc = scanner.scanner(cfg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99724:Expr_L177_C0", "label": "capture_and_save()", "type": "expression", "loc": [177, 177], "level": 0, "parent": null, "vector": [8, 0, 0.9316, 0.0053, 0, 0.66, 0.8333, 272, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "capture_and_save", "arg_names": [], "import_names": [], "rhs_call_name": "capture_and_save", "annotation": ""}, "snippet": "sc.capture_and_save('calib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99724:Expr_L185_C0", "label": "print()", "type": "expression", "loc": [185, 185], "level": 0, "parent": null, "vector": [8, 0, 0.9737, 0.0053, 0, 0.66, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('done')"}]
[]
#!/usr/bin/env python # # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) ##import roslib; roslib.load_manifest('laser_camera_segmentation') ##import rospy ##from std_msgs.msg import String import hrl_tilting_hokuyo.processing_3d as p3d from enthought.mayavi import mlab import hrl_lib.util as ut import numpy as np, math #import numpy.core as np?? import scipy from scipy import stats ##import scanr as scanr ##import nearesNeighbourGather.NearestLaserPoint as NearestLaserPoint if __name__ == '__main__': ## print 'test' ## scanr = scanr.scanr() ## scanr.verify_laser_cam_callib() dict = ut.load_pickle('../../data/2009Aug31_172113_dict.pkl') pts = p3d.generate_pointcloud(dict['pos_list'],dict['scan_list'], math.radians(-60),math.radians(60),dict['l1'],dict['l2'], min_tilt=math.radians(-20),max_tilt=math.radians(20)) hist = scipy.stats.histogram(pts[2],30) hist_max_index = hist[0].argmax() z_min = hist[1] + hist_max_index * hist[2] z_max = z_min + hist[2] scalar_list = list() for x,y,z in np.asarray(pts.T): #scalar_list.append(x) if z_min < z < z_max: scalar_list.append(29) else: scalar_list.append(x) mlab.points3d(pts[0,:].A1,pts[1,:].A1,pts[2,:].A1,scalar_list,mode='point',scale_factor=0.01)#,colormap='winter' mlab.colorbar() #scipy.stats.histogram(pts[2],30)[0].argmax() ##mlab.triangular_mesh([[0,0,0]], [[0,1,0]], [[0,1,1]], [(0,1,2)]) mlab.show()
ajibawa-2023/Python-Code-Large/train/row_99725
21
79
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99725:Import_L39_C0", "label": "hrl_tilting_hokuyo.processing_3d import p3d", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.4937, 0.0127, 0, 0.66, 0.0, 307, 0, 1, 0, 0, 307, 0, 0], "semantic": {"name": "hrl_tilting_hokuyo.processing_3d", "arg_names": [], "import_names": ["p3d"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_tilting_hokuyo.processing_3d as p3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99725:ImportFrom_L40_C0", "label": "from enthought.mayavi import mlab", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.5063, 0.0127, 0, 0.66, 0.1667, 226, 0, 1, 0, 0, 226, 0, 0], "semantic": {"name": "enthought.mayavi", "arg_names": [], "import_names": ["mlab"], "rhs_call_name": "", "annotation": ""}, "snippet": "from enthought.mayavi import mlab"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99725:Import_L43_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.5443, 0.0127, 0, 0.66, 0.3333, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99725:Import_L44_C0", "label": "numpy import np, math", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.557, 0.0127, 0, 0.66, 0.5, 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 #import numpy.core as np??"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99725:Import_L45_C0", "label": "scipy import scipy", "type": "import", "loc": [45, 45], "level": 0, "parent": null, "vector": [1, 0, 0.5696, 0.0127, 0, 0.66, 0.6667, 265, 0, 1, 0, 0, 265, 0, 0], "semantic": {"name": "scipy", "arg_names": [], "import_names": ["scipy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99725:ImportFrom_L46_C0", "label": "from scipy import stats", "type": "import", "loc": [46, 46], "level": 0, "parent": null, "vector": [1, 0, 0.5823, 0.0127, 0, 0.66, 0.8333, 265, 0, 1, 0, 0, 265, 0, 0], "semantic": {"name": "scipy", "arg_names": [], "import_names": ["stats"], "rhs_call_name": "", "annotation": ""}, "snippet": "from scipy import stats"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "label": "if", "type": "if", "loc": [51, 79], "level": 0, "parent": null, "vector": [4, 0, 0.8228, 0.3671, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n\t\t\n##\tprint 'test'\n##\tscanr = scanr.scanr()\n##\tscanr.verify_laser_cam_callib()\n\n\n\tdict = ut.load_pickle('../../data/2009Aug31_172113_dict.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99725:Assign_L58_C1", "label": "dict = load_pickle()", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "vector": [14, 1, 0.7342, 0.0127, 1, 0.5, 0.0, 827, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "dict", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": "\tdict = ut.load_pickle('../../data/2009Aug31_172113_dict.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99725:Assign_L59_C1", "label": "pts = generate_pointcloud()", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "vector": [14, 1, 0.7468, 0.0127, 1, 0.5, 0.1, 195, 3, 8, 0, 0, 989, 10, 5], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "generate_pointcloud", "annotation": ""}, "snippet": "\tpts = p3d.generate_pointcloud(dict['pos_list'],dict['scan_list'], math.radians(-60),math.radians(60),dict['l1'],dict['l2'], min_tilt=math.radians(-20),max_tilt=math.radians(20))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99725:Assign_L61_C1", "label": "hist = histogram()", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "vector": [14, 1, 0.7722, 0.0127, 1, 0.5, 0.2, 353, 3, 2, 0, 0, 428, 10, 1], "semantic": {"name": "hist", "arg_names": [], "import_names": [], "rhs_call_name": "histogram", "annotation": ""}, "snippet": "\thist = scipy.stats.histogram(pts[2],30)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99725:Assign_L62_C1", "label": "hist_max_index = argmax()", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "vector": [14, 1, 0.7848, 0.0127, 1, 0.5, 0.3, 736, 3, 0, 0, 0, 593, 10, 1], "semantic": {"name": "hist_max_index", "arg_names": [], "import_names": [], "rhs_call_name": "argmax", "annotation": ""}, "snippet": "\thist_max_index = hist[0].argmax()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99725:Assign_L63_C1", "label": "z_min =", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "vector": [14, 1, 0.7975, 0.0127, 1, 0.5, 0.4, 566, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z_min", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tz_min = hist[1] + hist_max_index * hist[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99725:Assign_L64_C1", "label": "z_max =", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "vector": [14, 1, 0.8101, 0.0127, 1, 0.5, 0.5, 465, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z_max", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tz_max = z_min + hist[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99725:Assign_L65_C1", "label": "scalar_list = list()", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "vector": [14, 1, 0.8228, 0.0127, 1, 0.5, 0.6, 678, 3, 0, 0, 0, 430, 10, 1], "semantic": {"name": "scalar_list", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": "\tscalar_list = list()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99725:For_L66_C1", "label": "for x, y, z", "type": "for", "loc": [66, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "vector": [6, 1, 0.8671, 0.0759, 1, 0.5, 0.7, 971, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "x, y, z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor x,y,z in np.asarray(pts.T):\n\t\t#scalar_list.append(x)\n\t\tif z_min < z < z_max:\n\t\t\tscalar_list.append(29)\n\t\telse:\n\t\t\tscalar_list.append(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L68_C2", "label": "if", "type": "if", "loc": [68, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99725:For_L66_C1", "vector": [4, 2, 0.8797, 0.0506, 2, 0.81, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif z_min < z < z_max:\n\t\t\tscalar_list.append(29)\n\t\telse:\n\t\t\tscalar_list.append(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99725:Expr_L69_C3", "label": "append()", "type": "expression", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L68_C2", "vector": [8, 3, 0.8734, 0.0127, 3, 0.89, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tscalar_list.append(29)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99725:Expr_L71_C3", "label": "append()", "type": "expression", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L68_C2", "vector": [8, 3, 0.8987, 0.0127, 3, 0.89, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tscalar_list.append(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99725:Expr_L73_C1", "label": "points3d()", "type": "expression", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "vector": [8, 1, 0.9241, 0.0127, 1, 0.5, 0.8, 243, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "points3d", "arg_names": [], "import_names": [], "rhs_call_name": "points3d", "annotation": ""}, "snippet": "\tmlab.points3d(pts[0,:].A1,pts[1,:].A1,pts[2,:].A1,scalar_list,mode='point',scale_factor=0.01)#,colormap='winter'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99725:Expr_L74_C1", "label": "colorbar()", "type": "expression", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "vector": [8, 1, 0.9367, 0.0127, 1, 0.5, 0.9, 915, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "colorbar", "arg_names": [], "import_names": [], "rhs_call_name": "colorbar", "annotation": ""}, "snippet": "\tmlab.colorbar()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99725:Expr_L79_C1", "label": "show()", "type": "expression", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "vector": [8, 1, 1.0, 0.0127, 1, 0.5, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": "\tmlab.show()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99725:Assign_L58_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99725:Assign_L59_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99725:Assign_L61_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99725:Assign_L62_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99725:Assign_L63_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99725:Assign_L64_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99725:Assign_L65_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99725:For_L66_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99725:For_L66_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L68_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L68_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99725:Expr_L69_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L68_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99725:Expr_L71_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99725:Expr_L73_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99725:Expr_L74_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99725:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99725:Expr_L79_C1"}]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) import numpy as np,math class configuration(object): ''' classdocs ''' def __init__(self, path = '../data/', device = 'desktopScanner'): ''' set default values ''' self.path = path self.pointcloud_max_dist = 5.0 self.pointcloud_min_dist = 0.1 self.device = device if device == 'desktopScanner': import webcam_config as cc self.webcam_id = 1 #most code from travis scanr-class: # Initialize webcam self.cam_name = 'DesktopWebcam' cp = cc.webcam_parameters[self.cam_name] fx = cp['focal_length_x_in_pixels'] fy = cp['focal_length_y_in_pixels'] self.cam_proj_mat = np.matrix([[fx, 0, 0, 0], [0, fy, 0, 0], [0, 0, 1, 0]]) self.cam_centers = ( cp['optical_center_x_in_pixels'], cp['optical_center_y_in_pixels'] ) # cam_vec came from a previous laser_cam_callibration #self.cam_vec = np.array([0.8, 0.9, -1.7, 3.1, 0.061, 0.032, -0.035 ]) #self.cam_vec = np.array([1.2000, 1.2000 , -1.4000 , 3.6000 , 0.0600 , 0.0330 ,-0.0200]) #self.cam_vec = np.array([0.9000 , 0.8000 , -2.2000 , 3.1000 , 0.0620 , 0.0320, -0.0270 ]) self.cam_vec = np.array([ 1.8000 , 1.7000 , -2.6000 , 4.7500 , 0.0620 , 0.0320 , -0.0270 ]) #self.cam_vec = np.array([ 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ]) self.cam_deltas = np.array([0.1, 0.1, 0.1, 0.1, 0.001, 0.001, 0.001 ]) self.cam_names = ['Ry_0', 'Rz_0', 'Rx_-90', 'Rz_-90', 'dx', 'dy', 'dz'] import scanr_transforms as trs self.camTlaser = trs.camTlaser(self.cam_vec) self.scanner_metal_plate_offset = 0.05 #TODO # Initialize THOK self.thok_l1 = 0 self.thok_l2 = 0.035 self.thok_tilt_angles = (math.radians(40.0),math.radians(-40.0)) self.thok_devname = '/dev/robot/desktopServos' self.thok_servonum = 19 self.thok_hoknum = 0 self.thok_scan_speed = math.radians(5.0) elif device == 'codyRobot': import hrl_camera.camera_config as cc self.webcam_id = 0 #values from equilibrium_point_control/lpi.py self.cam_name = 'mekabotUTM' cp = cc.camera_parameters[self.cam_name] fx = cp['focal_length_x_in_pixels'] fy = cp['focal_length_y_in_pixels'] self.cam_proj_mat = np.matrix([[fx, 0, 0, 0], [0, fy, 0, 0], [0, 0, 1, 0]]) self.cam_centers = ( cp['optical_center_x_in_pixels'], cp['optical_center_y_in_pixels'] ) #self.camTlaser = mcf.utmcam0Tglobal(mcf.globalTthok0(m),self.image_angle) # Initialize THOK self.thok_l1 = 0 self.thok_l2 = -0.055 self.thok_tilt_angles = (math.radians(40.0),math.radians(-40.0)) self.thok_devname = '/dev/robot/servo0' self.thok_servonum = 5 self.thok_hoknum = 0 self.thok_scan_speed = math.radians(10.0) #speed=10 in lpi elif device == 'dummyScanner': #just for testing/demonstration without dependencies outside of gt-ros-pkgk self.webcam_id = 0 #values from equilibrium_point_control/lpi.py self.cam_name = 'dummyUTM' import opencv as cv #values copied from Cody cp = {'calibration_image_width' : 640.0, 'calibration_image_height' : 480.0, 'focal_length_x_in_pixels' : 362.381, 'focal_length_y_in_pixels' : 362.260, 'optical_center_x_in_pixels' : 275.630, 'optical_center_y_in_pixels' : 267.914, 'lens_distortion_radial_1' : -0.270544, 'lens_distortion_radial_2' : 0.0530850, 'lens_distortion_tangential_1' : 0, 'lens_distortion_tangential_2' : 0, 'opencv_bayer_pattern' : cv.CV_BayerBG2BGR, 'color': True, 'uid': 8520228 } fx = cp['focal_length_x_in_pixels'] fy = cp['focal_length_y_in_pixels'] self.cam_proj_mat = np.matrix([[fx, 0, 0, 0], [0, fy, 0, 0], [0, 0, 1, 0]]) self.cam_centers = ( cp['optical_center_x_in_pixels'], cp['optical_center_y_in_pixels'] ) #self.camTlaser = mcf.utmcam0Tglobal(mcf.globalTthok0(m),self.image_angle) # Initialize THOK self.thok_l1 = 0 self.thok_l2 = -0.055 self.thok_tilt_angles = (math.radians(40.0),math.radians(-40.0)) self.thok_devname = '/dev/robot/servo0' self.thok_servonum = 5 self.thok_hoknum = 0 self.thok_scan_speed = math.radians(10.0) #speed=10 in lpi else: print 'ERROR: unknown device',device
ajibawa-2023/Python-Code-Large/train/row_99726
64
164
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Import_L31_C0", "label": "numpy import np, math", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.189, 0.0061, 0, 0.66, 0.0, 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_99726:ClassDef_L34_C0", "label": "configuration", "type": "class", "loc": [34, 164], "level": 0, "parent": null, "vector": [3, 0, 0.6037, 0.7988, 0, 0.66, 1.0, 627, 0, 1, 0, 0, 186, 0, 16], "semantic": {"name": "configuration", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class configuration(object):\n '''\n classdocs\n '''\n\n\n def __init__(self, path = '../data/', device = 'desktopScanner'):\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Expr_L35_C4", "label": "expression", "type": "expression", "loc": [35, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:ClassDef_L34_C0", "vector": [8, 1, 0.2195, 0.0183, 1, 0.64, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n classdocs\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:FunctionDef_L40_C4", "label": "__init__", "type": "function", "loc": [40, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:ClassDef_L34_C0", "vector": [2, 1, 0.622, 0.7622, 1, 0.64, 1.0, 555, 0, 3, 0, 0, 0, 0, 16], "semantic": {"name": "__init__", "arg_names": ["self", "path", "device"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, path = '../data/', device = 'desktopScanner'):\n \n '''\n set default values\n '''\n self.path = path\n self.pointcloud_max_dist = 5.0\n self.pointcloud_min_dist = 0.1 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Expr_L42_C8", "label": "expression", "type": "expression", "loc": [42, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:FunctionDef_L40_C4", "vector": [8, 2, 0.2622, 0.0183, 2, 0.11, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n set default values\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L45_C8", "label": "self.path =", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:FunctionDef_L40_C4", "vector": [14, 2, 0.2744, 0.0061, 2, 0.11, 0.2, 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_99726:Assign_L46_C8", "label": "self.pointcloud_max_dist =", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:FunctionDef_L40_C4", "vector": [14, 2, 0.2805, 0.0061, 2, 0.11, 0.4, 340, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.pointcloud_max_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pointcloud_max_dist = 5.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L47_C8", "label": "self.pointcloud_min_dist =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:FunctionDef_L40_C4", "vector": [14, 2, 0.2866, 0.0061, 2, 0.11, 0.6, 42, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.pointcloud_min_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pointcloud_min_dist = 0.1 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L49_C8", "label": "self.device =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:FunctionDef_L40_C4", "vector": [14, 2, 0.2988, 0.0061, 2, 0.11, 0.8, 993, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.device", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.device = device"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "label": "if", "type": "if", "loc": [51, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:FunctionDef_L40_C4", "vector": [4, 2, 0.6555, 0.6951, 2, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if device == 'desktopScanner':\n import webcam_config as cc\n self.webcam_id = 1\n \n #most code from travis scanr-class:\n # Initialize webcam\n self.cam_name = 'DesktopWebcam'\n cp = cc.webcam_parameters[self.cam_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Import_L52_C12", "label": "webcam_config import cc", "type": "import", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [1, 3, 0.3171, 0.0061, 3, 0.72, 0.0, 880, 0, 1, 0, 0, 880, 0, 0], "semantic": {"name": "webcam_config", "arg_names": [], "import_names": ["cc"], "rhs_call_name": "", "annotation": ""}, "snippet": " import webcam_config as cc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L53_C12", "label": "self.webcam_id =", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [14, 3, 0.3232, 0.0061, 3, 0.72, 0.0476, 890, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.webcam_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.webcam_id = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L57_C12", "label": "self.cam_name =", "type": "assigned_variable", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [14, 3, 0.3476, 0.0061, 3, 0.72, 0.0952, 516, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.cam_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cam_name = 'DesktopWebcam'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L58_C12", "label": "cp =", "type": "assigned_variable", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [14, 3, 0.3537, 0.0061, 3, 0.72, 0.1429, 70, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cp = cc.webcam_parameters[self.cam_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L59_C12", "label": "fx =", "type": "assigned_variable", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [14, 3, 0.3598, 0.0061, 3, 0.72, 0.1905, 322, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fx = cp['focal_length_x_in_pixels']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L60_C12", "label": "fy =", "type": "assigned_variable", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [14, 3, 0.3659, 0.0061, 3, 0.72, 0.2381, 8, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fy = cp['focal_length_y_in_pixels']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L61_C12", "label": "self.cam_proj_mat = matrix()", "type": "assigned_variable", "loc": [61, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [14, 3, 0.378, 0.0183, 3, 0.72, 0.2857, 245, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "self.cam_proj_mat", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " self.cam_proj_mat = np.matrix([[fx, 0, 0, 0],\n [0, fy, 0, 0],\n [0, 0, 1, 0]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L65_C12", "label": "self.cam_centers =", "type": "assigned_variable", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [14, 3, 0.3963, 0.0061, 3, 0.72, 0.3333, 76, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.cam_centers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cam_centers = ( cp['optical_center_x_in_pixels'], cp['optical_center_y_in_pixels'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L71_C12", "label": "self.cam_vec = array()", "type": "assigned_variable", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [14, 3, 0.4329, 0.0061, 3, 0.72, 0.381, 23, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "self.cam_vec", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " self.cam_vec = np.array([ 1.8000 , 1.7000 , -2.6000 , 4.7500 , 0.0620 , 0.0320 , -0.0270 ]) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L75_C12", "label": "self.cam_deltas = array()", "type": "assigned_variable", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [14, 3, 0.4573, 0.0061, 3, 0.72, 0.4286, 687, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "self.cam_deltas", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " self.cam_deltas = np.array([0.1, 0.1, 0.1, 0.1, 0.001, 0.001, 0.001 ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L76_C12", "label": "self.cam_names =", "type": "assigned_variable", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [14, 3, 0.4634, 0.0061, 3, 0.72, 0.4762, 649, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.cam_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cam_names = ['Ry_0', 'Rz_0', 'Rx_-90', 'Rz_-90', 'dx', 'dy', 'dz']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Import_L77_C12", "label": "scanr_transforms import trs", "type": "import", "loc": [77, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [1, 3, 0.4695, 0.0061, 3, 0.72, 0.5238, 488, 0, 1, 0, 0, 488, 0, 0], "semantic": {"name": "scanr_transforms", "arg_names": [], "import_names": ["trs"], "rhs_call_name": "", "annotation": ""}, "snippet": " import scanr_transforms as trs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L78_C12", "label": "self.camTlaser = camTlaser()", "type": "assigned_variable", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [14, 3, 0.4756, 0.0061, 3, 0.72, 0.5714, 451, 3, 1, 0, 0, 184, 10, 1], "semantic": {"name": "self.camTlaser", "arg_names": [], "import_names": [], "rhs_call_name": "camTlaser", "annotation": ""}, "snippet": " self.camTlaser = trs.camTlaser(self.cam_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L81_C12", "label": "self.scanner_metal_plate_offset =", "type": "assigned_variable", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [14, 3, 0.4939, 0.0061, 3, 0.72, 0.619, 665, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.scanner_metal_plate_offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.scanner_metal_plate_offset = 0.05 #TODO"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L84_C12", "label": "self.thok_l1 =", "type": "assigned_variable", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [14, 3, 0.5122, 0.0061, 3, 0.72, 0.6667, 475, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.thok_l1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thok_l1 = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L85_C12", "label": "self.thok_l2 =", "type": "assigned_variable", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [14, 3, 0.5183, 0.0061, 3, 0.72, 0.7143, 623, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.thok_l2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thok_l2 = 0.035"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L86_C12", "label": "self.thok_tilt_angles =", "type": "assigned_variable", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [14, 3, 0.5244, 0.0061, 3, 0.72, 0.7619, 884, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "self.thok_tilt_angles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thok_tilt_angles = (math.radians(40.0),math.radians(-40.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L87_C12", "label": "self.thok_devname =", "type": "assigned_variable", "loc": [87, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [14, 3, 0.5305, 0.0061, 3, 0.72, 0.8095, 404, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.thok_devname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thok_devname = '/dev/robot/desktopServos'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L88_C12", "label": "self.thok_servonum =", "type": "assigned_variable", "loc": [88, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [14, 3, 0.5366, 0.0061, 3, 0.72, 0.8571, 81, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.thok_servonum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thok_servonum = 19"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L89_C12", "label": "self.thok_hoknum =", "type": "assigned_variable", "loc": [89, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [14, 3, 0.5427, 0.0061, 3, 0.72, 0.9048, 168, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.thok_hoknum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thok_hoknum = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L90_C12", "label": "self.thok_scan_speed = radians()", "type": "assigned_variable", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [14, 3, 0.5488, 0.0061, 3, 0.72, 0.9524, 362, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "self.thok_scan_speed", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " self.thok_scan_speed = math.radians(5.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "label": "if", "type": "if", "loc": [92, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "vector": [4, 3, 0.7805, 0.4451, 3, 0.72, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif device == 'codyRobot':\n import hrl_camera.camera_config as cc\n \n self.webcam_id = 0\n \n #values from equilibrium_point_control/lpi.py\n self.cam_name = 'mekabotUTM'\n cp = cc.camera_parameters[self.cam_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Import_L93_C12", "label": "hrl_camera.camera_config import cc", "type": "import", "loc": [93, 93], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "vector": [1, 4, 0.5671, 0.0061, 4, 0.44, 0.0, 159, 0, 1, 0, 0, 159, 0, 0], "semantic": {"name": "hrl_camera.camera_config", "arg_names": [], "import_names": ["cc"], "rhs_call_name": "", "annotation": ""}, "snippet": " import hrl_camera.camera_config as cc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L95_C12", "label": "self.webcam_id =", "type": "assigned_variable", "loc": [95, 95], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "vector": [14, 4, 0.5793, 0.0061, 4, 0.44, 0.0667, 890, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.webcam_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.webcam_id = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L98_C12", "label": "self.cam_name =", "type": "assigned_variable", "loc": [98, 98], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "vector": [14, 4, 0.5976, 0.0061, 4, 0.44, 0.1333, 516, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.cam_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cam_name = 'mekabotUTM'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L99_C12", "label": "cp =", "type": "assigned_variable", "loc": [99, 99], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "vector": [14, 4, 0.6037, 0.0061, 4, 0.44, 0.2, 70, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cp = cc.camera_parameters[self.cam_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L100_C12", "label": "fx =", "type": "assigned_variable", "loc": [100, 100], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "vector": [14, 4, 0.6098, 0.0061, 4, 0.44, 0.2667, 322, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fx = cp['focal_length_x_in_pixels']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L101_C12", "label": "fy =", "type": "assigned_variable", "loc": [101, 101], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "vector": [14, 4, 0.6159, 0.0061, 4, 0.44, 0.3333, 8, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fy = cp['focal_length_y_in_pixels']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L103_C12", "label": "self.cam_proj_mat = matrix()", "type": "assigned_variable", "loc": [103, 105], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "vector": [14, 4, 0.6341, 0.0183, 4, 0.44, 0.4, 245, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "self.cam_proj_mat", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " self.cam_proj_mat = np.matrix([[fx, 0, 0, 0],\n [0, fy, 0, 0],\n [0, 0, 1, 0]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L106_C12", "label": "self.cam_centers =", "type": "assigned_variable", "loc": [106, 106], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "vector": [14, 4, 0.6463, 0.0061, 4, 0.44, 0.4667, 76, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.cam_centers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cam_centers = ( cp['optical_center_x_in_pixels'], cp['optical_center_y_in_pixels'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L113_C12", "label": "self.thok_l1 =", "type": "assigned_variable", "loc": [113, 113], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "vector": [14, 4, 0.689, 0.0061, 4, 0.44, 0.5333, 475, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.thok_l1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thok_l1 = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L114_C12", "label": "self.thok_l2 =", "type": "assigned_variable", "loc": [114, 114], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "vector": [14, 4, 0.6951, 0.0061, 4, 0.44, 0.6, 623, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.thok_l2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thok_l2 = -0.055"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L115_C12", "label": "self.thok_tilt_angles =", "type": "assigned_variable", "loc": [115, 115], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "vector": [14, 4, 0.7012, 0.0061, 4, 0.44, 0.6667, 884, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "self.thok_tilt_angles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thok_tilt_angles = (math.radians(40.0),math.radians(-40.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L116_C12", "label": "self.thok_devname =", "type": "assigned_variable", "loc": [116, 116], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "vector": [14, 4, 0.7073, 0.0061, 4, 0.44, 0.7333, 404, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.thok_devname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thok_devname = '/dev/robot/servo0'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L117_C12", "label": "self.thok_servonum =", "type": "assigned_variable", "loc": [117, 117], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "vector": [14, 4, 0.7134, 0.0061, 4, 0.44, 0.8, 81, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.thok_servonum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thok_servonum = 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L118_C12", "label": "self.thok_hoknum =", "type": "assigned_variable", "loc": [118, 118], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "vector": [14, 4, 0.7195, 0.0061, 4, 0.44, 0.8667, 168, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.thok_hoknum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thok_hoknum = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L119_C12", "label": "self.thok_scan_speed = radians()", "type": "assigned_variable", "loc": [119, 119], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "vector": [14, 4, 0.7256, 0.0061, 4, 0.44, 0.9333, 362, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "self.thok_scan_speed", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " self.thok_scan_speed = math.radians(10.0) #speed=10 in lpi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "label": "if", "type": "if", "loc": [121, 164], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "vector": [4, 4, 0.8689, 0.2683, 4, 0.44, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif device == 'dummyScanner': #just for testing/demonstration without dependencies outside of gt-ros-pkgk\n self.webcam_id = 0\n \n #values from equilibrium_point_control/lpi.py\n self.cam_name = 'dummyUTM'\n import opencv as cv\n #values copied from Cody\n cp = {'calibration_image_width' : 640.0,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L122_C12", "label": "self.webcam_id =", "type": "assigned_variable", "loc": [122, 122], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "vector": [14, 5, 0.7439, 0.0061, 5, 0.49, 0.0, 890, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.webcam_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.webcam_id = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L125_C12", "label": "self.cam_name =", "type": "assigned_variable", "loc": [125, 125], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "vector": [14, 5, 0.7622, 0.0061, 5, 0.49, 0.0667, 516, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.cam_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cam_name = 'dummyUTM'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Import_L126_C12", "label": "opencv import cv", "type": "import", "loc": [126, 126], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "vector": [1, 5, 0.7683, 0.0061, 5, 0.49, 0.1333, 437, 0, 1, 0, 0, 437, 0, 0], "semantic": {"name": "opencv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": " import opencv as cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L128_C12", "label": "cp =", "type": "assigned_variable", "loc": [128, 141], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "vector": [14, 5, 0.8201, 0.0854, 5, 0.49, 0.2, 70, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "cp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cp = {'calibration_image_width' : 640.0,\n 'calibration_image_height' : 480.0, \n 'focal_length_x_in_pixels' : 362.381,\n 'focal_length_y_in_pixels' : 362.260,\n 'optical_center_x_in_pixels' : 275.630,\n 'optical_center_y_in_pixels' : 267.914,\n 'lens_distortion_radial_1' : -0.270544,\n 'lens_distortion_radial_2' : 0.0530850,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L142_C12", "label": "fx =", "type": "assigned_variable", "loc": [142, 142], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "vector": [14, 5, 0.8659, 0.0061, 5, 0.49, 0.2667, 322, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fx = cp['focal_length_x_in_pixels']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L143_C12", "label": "fy =", "type": "assigned_variable", "loc": [143, 143], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "vector": [14, 5, 0.872, 0.0061, 5, 0.49, 0.3333, 8, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fy = cp['focal_length_y_in_pixels']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L145_C12", "label": "self.cam_proj_mat = matrix()", "type": "assigned_variable", "loc": [145, 147], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "vector": [14, 5, 0.8902, 0.0183, 5, 0.49, 0.4, 245, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "self.cam_proj_mat", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " self.cam_proj_mat = np.matrix([[fx, 0, 0, 0],\n [0, fy, 0, 0],\n [0, 0, 1, 0]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L148_C12", "label": "self.cam_centers =", "type": "assigned_variable", "loc": [148, 148], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "vector": [14, 5, 0.9024, 0.0061, 5, 0.49, 0.4667, 76, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.cam_centers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cam_centers = ( cp['optical_center_x_in_pixels'], cp['optical_center_y_in_pixels'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L155_C12", "label": "self.thok_l1 =", "type": "assigned_variable", "loc": [155, 155], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "vector": [14, 5, 0.9451, 0.0061, 5, 0.49, 0.5333, 475, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.thok_l1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thok_l1 = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L156_C12", "label": "self.thok_l2 =", "type": "assigned_variable", "loc": [156, 156], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "vector": [14, 5, 0.9512, 0.0061, 5, 0.49, 0.6, 623, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.thok_l2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thok_l2 = -0.055"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L157_C12", "label": "self.thok_tilt_angles =", "type": "assigned_variable", "loc": [157, 157], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "vector": [14, 5, 0.9573, 0.0061, 5, 0.49, 0.6667, 884, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "self.thok_tilt_angles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thok_tilt_angles = (math.radians(40.0),math.radians(-40.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L158_C12", "label": "self.thok_devname =", "type": "assigned_variable", "loc": [158, 158], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "vector": [14, 5, 0.9634, 0.0061, 5, 0.49, 0.7333, 404, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.thok_devname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thok_devname = '/dev/robot/servo0'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L159_C12", "label": "self.thok_servonum =", "type": "assigned_variable", "loc": [159, 159], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "vector": [14, 5, 0.9695, 0.0061, 5, 0.49, 0.8, 81, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.thok_servonum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thok_servonum = 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L160_C12", "label": "self.thok_hoknum =", "type": "assigned_variable", "loc": [160, 160], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "vector": [14, 5, 0.9756, 0.0061, 5, 0.49, 0.8667, 168, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.thok_hoknum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thok_hoknum = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L161_C12", "label": "self.thok_scan_speed = radians()", "type": "assigned_variable", "loc": [161, 161], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "vector": [14, 5, 0.9817, 0.0061, 5, 0.49, 0.9333, 362, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "self.thok_scan_speed", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " self.thok_scan_speed = math.radians(10.0) #speed=10 in lpi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99726:Expr_L164_C12", "label": "print()", "type": "expression", "loc": [164, 164], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "vector": [8, 5, 1.0, 0.0061, 5, 0.49, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('ERROR: unknown device',device)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99726:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Expr_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Import_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Import_L77_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Import_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L115_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Import_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L128_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L142_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L159_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L160_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Assign_L161_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99726:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99726:Expr_L164_C12"}]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) from classifier import classifier import opencv as cv import hrl_lib.util as ut import numpy as np from hrl_lib.util import getTime import os import processor import ransac class boosted_tree_classifier(classifier) : ''' classdocs ''' cv_classifier = None #def __init__(selfparams): # ''' # Constructor # ''' def create_train_datastructures(self): #loop through all marked datasets self.processor.scan_dataset = self.processor.scans_database.get_dataset(0) training_set_size = 0 data = [] #get size of training set in total while False != self.processor.scan_dataset: if self.processor.scan_dataset.is_training_set: filename = self.processor.get_features_filename(True) print 'loading', filename dict = ut.load_pickle(filename) # make an equal size of points for each class: use object labels more often: difference = np.sum(dict['labels'] == processor.LABEL_SURFACE) - np.sum(dict['labels'] == processor.LABEL_CLUTTER) #print getTime(), filename #print getTime(), 'surface',np.sum(dict['labels'] == LABEL_SURFACE) #print getTime(), 'clutter',np.sum(dict['labels'] == LABEL_CLUTTER) #print getTime(), difference, "difference = np.sum(dict['labels'] == LABEL_SURFACE) - np.sum(dict['labels'] == LABEL_CLUTTER)" #print getTime(), '' if difference > 0: clutter_features = (dict['features'])[np.nonzero(dict['labels'] == processor.LABEL_CLUTTER)] if len(clutter_features) > 0: #if there are none, do nothin' dict['set_size'] += difference dict['features'] = np.vstack((dict['features'], clutter_features[np.random.randint(0,len(clutter_features),size=difference)])) dict['labels'] = np.hstack((dict['labels'], np.ones(difference) * processor.LABEL_CLUTTER)) elif difference < 0: surface_features = (dict['features'])[np.nonzero(dict['labels'] == processor.LABEL_SURFACE)] if len(surface_features) > 0: #if there are none, do nothin' difference = -difference dict['set_size'] += difference dict['features'] = np.vstack((dict['features'], surface_features[np.random.randint(0,len(surface_features),size=difference)])) dict['labels'] = np.hstack((dict['labels'], np.ones(difference) * processor.LABEL_SURFACE)) training_set_size += dict['set_size'] data.append(dict) #get next one self.processor.scan_dataset = self.processor.scans_database.get_next_dataset() #print getTime(), self.scan_dataset #create training set: self.processor.scan_dataset = self.processor.scans_database.get_dataset(0) current_training_set_index = 0 feature_vector_length = len(self.processor.features.get_indexvector(self.features)) print getTime(), feature_vector_length #create dataset matrices: print getTime(), '#training set size ', training_set_size #deactivate for now: max_traning_size = 1800000#2040000 #if training_set_size < max_traning_size: if True: train_data = cv.cvCreateMat(training_set_size,feature_vector_length,cv.CV_32FC1) #CvMat* cvCreateMat(int rows, int cols, int type) train_labels = cv.cvCreateMat(training_set_size,1,cv.CV_32FC1) for dict in data: for index in range(dict['set_size']): #only train on surface and clutter if dict['labels'][index] == processor.LABEL_SURFACE or dict['labels'][index]== processor.LABEL_CLUTTER: #print getTime(), point3d #print getTime(), 'fvindexv',self.get_features_indexvector(features) #print getTime(), 'len', len(self.get_features_indexvector(features)) fv = (dict['features'][index])[self.processor.features.get_indexvector(self.features)] #print getTime(), 'fv',fv #print getTime(), np.shape(fv) for fv_index, fv_value in enumerate(fv): train_data[current_training_set_index][fv_index] = fv_value train_labels[current_training_set_index] = dict['labels'][index] # for fv_index, fv_value in enumerate(fv): # print getTime(), train_data[current_training_set_index][fv_index] # print getTime(), '##',train_labels[current_training_set_index],'##' #print getTime(), 'fv ', fv #print getTime(), 'tr ',train_data[index] current_training_set_index = current_training_set_index + 1 #if current_training_set_index % 4096 == 0: # print getTime(), 'label', dict['labels'][index], 'fv', fv if current_training_set_index % 16384 == 0: print getTime(), 'reading features:', current_training_set_index, 'of', training_set_size, '(',(float(current_training_set_index)/float(training_set_size)*100.0),'%)' else: print getTime(), 'more than',max_traning_size,'features, sample from them...' #select 2040000 features: all_data = [] all_labels = [] for dict in data: for index in range(dict['set_size']): if dict['labels'][index] == processor.LABEL_SURFACE or dict['labels'][index]== processor.LABEL_CLUTTER: fv = (dict['features'][index])[self.processor.features.get_indexvector(self.features)] all_data += [fv] all_labels += [dict['labels'][index]] current_training_set_index = current_training_set_index + 1 if current_training_set_index % 16384 == 0: print getTime(), 'reading features:', current_training_set_index, 'of', training_set_size, '(',(float(current_training_set_index)/float(training_set_size)*100.0),'%)' del data import random indices = np.array(random.sample(xrange(len(all_labels)),max_traning_size)) all_data = np.asarray(all_data) all_labels = np.asarray(all_labels) all_data = all_data[indices] all_labels = all_labels[indices] train_data = cv.cvCreateMat(max_traning_size,feature_vector_length,cv.CV_32FC1) #CvMat* cvCreateMat(int rows, int cols, int type) train_labels = cv.cvCreateMat(max_traning_size,1,cv.CV_32FC1) for index in range(max_traning_size): for fv_index, fv_value in enumerate(all_data[index]): train_data[index][fv_index] = fv_value train_labels[index] = all_labels[index] if index % 16384 == 0: print getTime(), 'setting features:', (float(index)/float(max_traning_size)) print getTime(), 'start training Classifier' type_mask = cv.cvCreateMat(1, feature_vector_length+1, cv.CV_8UC1) cv.cvSet( type_mask, cv.CV_VAR_NUMERICAL, 0) type_mask[feature_vector_length] = cv.CV_VAR_CATEGORICAL return (train_data, train_labels, type_mask) def train(self): #cv_boost_params = cv.CvBoostParams() #priors = cv.cvCreateMat(1,2,cv.CV_32FC1) #priors[0] = 10 #priors[1] = 1 #cv_boost_params.max_categories = 2 #cv_boost_params.priors = priors #TODO: activate them self.cv_classifier = cv.CvDTree() #cv.CvBoost() train_datastructures = self.create_train_datastructures() (train_data, train_labels, type_mask) = train_datastructures print 'WARNING! use CvDTree (single decision trees) for now as load/save works!'#'boost' print getTime(), self.cv_classifier.train(train_data, cv.CV_ROW_SAMPLE, train_labels, None, None, type_mask ) print getTime(), 'traning finished' #self.release_train_datastructures(train_datastructures) #unused - is that necessary in python? how does it work?? def release_train_datastructures(self, train_datastructures): if None != train_datastructures: (train_data, train_labels, type_mask) = train_datastructures cv.cvReleaseMat(train_data) cv.cvReleaseMat(train_labels) cv.cvReleaseMat(type_mask) #test on current scan: def test(self, feature_data = None): #test on current scan: print getTime(), 'test on:', self.processor.scan_dataset.id if feature_data == None: filename = self.processor.get_features_filename() print 'loading', filename dict = ut.load_pickle(filename) else: dict = feature_data #print getTime(), dict current_set_size = dict['set_size'] feature_vector_length = len(self.processor.features.get_indexvector(self.features)) print getTime(), feature_vector_length labels = np.array(np.zeros(len(self.processor.map_polys))) print 'test: length of labels vector:', len(labels) test = cv.cvCreateMat(1,feature_vector_length,cv.CV_32FC1) if current_set_size == 0: print getTime(), 'ERROR: test dataset is empty!' return labels, 1, 1, 1 count = 0 for index in dict['point_indices']: fv = (dict['features'][count])[self.processor.features.get_indexvector(self.features)] #print getTime(), fv, dict['features'][count] for fv_index, fv_value in enumerate(fv): test[fv_index] = fv_value #print 'class',self.cv_classifier label = self.cv_classifier.predict(test) #print label.value labels[index] = label.value #print 'tdone' if count % 4096 == 0: print getTime(), 'testing:', count, 'of', current_set_size, '(',(float(count)/float(current_set_size)*100.0),'%)' count += 1 #save for later use for postprocessing: self.test_feature_dict = dict self.test_labels = labels #cv.cvReleaseMat(test) return labels, self.test_results(dict, labels) #test() has to be called before to create intermediate results! def test_postprocess(self): labels = self.postprocess(self.test_labels) return labels, self.test_results(self.test_feature_dict, labels) def postprocess(self, labels): debug = False model = ransac.PlaneLeastSquaresModel(debug) data_idx = np.where(np.asarray(labels) == processor.LABEL_SURFACE)[0] data = np.asarray(self.processor.pts3d_bound).T[data_idx] n, _ = np.shape(data) if n < 5000: k = 700 else: k = 2000 # run RANSAC algorithm ransac_fit, ransac_data = ransac.ransac(data,model, 3, k, 0.04, len(data_idx)/2.5, # misc. parameters debug=debug,return_all=True) print 'ransac: model',ransac_fit print 'ransac:',ransac_data print 'len inlier',len(ransac_data['inliers']),'shape pts',np.shape(self.processor.pts3d_bound) #labels[data_idx[ransac_data['inliers']]] = processor.LABEL_CLUTTER #all non-plane pts fancy = np.zeros(len(np.asarray(labels))).astype(bool) fancy[data_idx] = True fancy[data_idx[ransac_data['inliers']]] = False labels[fancy] = processor.LABEL_CLUTTER #all surface-labeled non-plane pts #DEBUG: #from enthought.mayavi import mlab #inliers = np.asarray(self.processor.pts3d_bound).T[data_idx[ransac_data['inliers']]].T #mlab.points3d(inliers[0,:],inliers[1,:],inliers[2,:],inliers[0,:],mode='sphere',resolution=8,scale_factor=0.0015,scale_mode='none',scale_factor=0.01,colormap='jet')#,colormap='winter' #mlab.quiver3d([ransac_fit[0][0]], [ransac_fit[0][1]], [ransac_fit[0][2]], [ransac_fit[1][0]], [ransac_fit[1][1]], [ransac_fit[1][2]], scale_factor=0.4, color=(1,0,0)) return labels def save(self): classifier_filename = self.get_filename() #if file doesn't exist: create it if False == os.path.isfile(classifier_filename): open(classifier_filename,'w') self.cv_classifier.save(classifier_filename) def load(self): self.cv_classifier = cv.CvDTree() #cv.CvBoost() print getTime(), 'loading Classifier',self.features self.cv_classifier.load(self.get_filename())
ajibawa-2023/Python-Code-Large/train/row_99727
152
319
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99727:ImportFrom_L30_C0", "label": "from classifier import classifier", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.094, 0.0031, 0, 0.66, 0.0, 71, 0, 1, 0, 0, 71, 0, 0], "semantic": {"name": "classifier", "arg_names": [], "import_names": ["classifier"], "rhs_call_name": "", "annotation": ""}, "snippet": "from classifier import classifier"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Import_L32_C0", "label": "opencv import cv", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.1003, 0.0031, 0, 0.66, 0.125, 437, 0, 1, 0, 0, 437, 0, 0], "semantic": {"name": "opencv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import opencv as cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Import_L33_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.1034, 0.0031, 0, 0.66, 0.25, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Import_L34_C0", "label": "numpy import np", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.1066, 0.0031, 0, 0.66, 0.375, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:ImportFrom_L35_C0", "label": "from hrl_lib.util import getTime", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.1097, 0.0031, 0, 0.66, 0.5, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["getTime"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_lib.util import getTime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Import_L36_C0", "label": "os import os", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.1129, 0.0031, 0, 0.66, 0.625, 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_99727:Import_L38_C0", "label": "processor import processor", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.1191, 0.0031, 0, 0.66, 0.75, 177, 0, 1, 0, 0, 177, 0, 0], "semantic": {"name": "processor", "arg_names": [], "import_names": ["processor"], "rhs_call_name": "", "annotation": ""}, "snippet": "import processor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Import_L40_C0", "label": "ransac import ransac", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.1254, 0.0031, 0, 0.66, 0.875, 32, 0, 1, 0, 0, 32, 0, 0], "semantic": {"name": "ransac", "arg_names": [], "import_names": ["ransac"], "rhs_call_name": "", "annotation": ""}, "snippet": "import ransac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:ClassDef_L44_C0", "label": "boosted_tree_classifier", "type": "class", "loc": [44, 317], "level": 0, "parent": null, "vector": [3, 0, 0.5658, 0.8589, 0, 0.66, 1.0, 802, 0, 8, 0, 0, 71, 0, 99], "semantic": {"name": "boosted_tree_classifier", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class boosted_tree_classifier(classifier) :\n '''\n classdocs\n '''\n\n cv_classifier = None\n\n #def __init__(selfparams):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L45_C4", "label": "expression", "type": "expression", "loc": [45, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:ClassDef_L44_C0", "vector": [8, 1, 0.1442, 0.0094, 1, 0.64, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n classdocs\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L49_C4", "label": "cv_classifier =", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:ClassDef_L44_C0", "vector": [14, 1, 0.1536, 0.0031, 1, 0.64, 0.1111, 210, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "cv_classifier", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cv_classifier = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "label": "create_train_datastructures", "type": "function", "loc": [57, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:ClassDef_L44_C0", "vector": [2, 1, 0.3793, 0.4044, 1, 0.64, 0.2222, 389, 0, 1, 1, 0, 0, 0, 64], "semantic": {"name": "create_train_datastructures", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_train_datastructures(self):\n #loop through all marked datasets\n self.processor.scan_dataset = self.processor.scans_database.get_dataset(0)\n \n training_set_size = 0\n \n data = []\n #get size of training set in total"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L59_C8", "label": "self.processor.scan_dataset = get_dataset()", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "vector": [14, 2, 0.185, 0.0031, 2, 0.54, 0.0, 356, 3, 1, 0, 0, 941, 10, 1], "semantic": {"name": "self.processor.scan_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "get_dataset", "annotation": ""}, "snippet": " self.processor.scan_dataset = self.processor.scans_database.get_dataset(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L61_C8", "label": "training_set_size =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "vector": [14, 2, 0.1912, 0.0031, 2, 0.54, 0.0667, 335, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "training_set_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " training_set_size = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L63_C8", "label": "data =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "vector": [14, 2, 0.1975, 0.0031, 2, 0.54, 0.1333, 929, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:While_L65_C8", "label": "while", "type": "while", "loc": [65, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "vector": [5, 2, 0.2524, 0.1003, 2, 0.54, 0.2, 0, 0, 0, 0, 0, 0, 0, 21], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while False != self.processor.scan_dataset:\n if self.processor.scan_dataset.is_training_set:\n \n filename = self.processor.get_features_filename(True)\n print('loading', filename)\n dict = ut.load_pickle(filename)\n\n # make an equal size of points for each class: use object labels more often:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L66_C12", "label": "if", "type": "if", "loc": [66, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:While_L65_C8", "vector": [4, 3, 0.2508, 0.0909, 3, 0.12, 0.0, 0, 7, 0, 0, 0, 0, 0, 20], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.processor.scan_dataset.is_training_set:\n \n filename = self.processor.get_features_filename(True)\n print('loading', filename)\n dict = ut.load_pickle(filename)\n\n # make an equal size of points for each class: use object labels more often:\n difference = np.sum(dict['labels'] == processor.LABEL_SURFACE) - np.sum(dict['labels'] == processor.LABEL_CLUTTER)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L68_C16", "label": "filename = get_features_filename()", "type": "assigned_variable", "loc": [68, 68], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L66_C12", "vector": [14, 4, 0.2132, 0.0031, 4, 0.56, 0.0, 275, 3, 1, 0, 0, 49, 10, 1], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "get_features_filename", "annotation": ""}, "snippet": " filename = self.processor.get_features_filename(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L69_C16", "label": "print()", "type": "expression", "loc": [69, 69], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L66_C12", "vector": [8, 4, 0.2163, 0.0031, 4, 0.56, 0.2, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('loading', filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L70_C16", "label": "dict = load_pickle()", "type": "assigned_variable", "loc": [70, 70], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L66_C12", "vector": [14, 4, 0.2194, 0.0031, 4, 0.56, 0.4, 827, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "dict", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " dict = ut.load_pickle(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L73_C16", "label": "difference =", "type": "assigned_variable", "loc": [73, 73], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L66_C12", "vector": [14, 4, 0.2288, 0.0031, 4, 0.56, 0.6, 498, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "difference", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " difference = np.sum(dict['labels'] == processor.LABEL_SURFACE) - np.sum(dict['labels'] == processor.LABEL_CLUTTER)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L79_C16", "label": "if", "type": "if", "loc": [79, 91], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L66_C12", "vector": [4, 4, 0.2665, 0.0408, 4, 0.56, 0.8, 0, 0, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if difference > 0:\n clutter_features = (dict['features'])[np.nonzero(dict['labels'] == processor.LABEL_CLUTTER)]\n if len(clutter_features) > 0: #if there are none, do nothin'\n dict['set_size'] += difference\n dict['features'] = np.vstack((dict['features'], clutter_features[np.random.randint(0,len(clutter_features),size=difference)]))\n dict['labels'] = np.hstack((dict['labels'], np.ones(difference) * processor.LABEL_CLUTTER))\n elif difference < 0: \n surface_features = (dict['features'])[np.nonzero(dict['labels'] == processor.LABEL_SURFACE)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L80_C20", "label": "clutter_features =", "type": "assigned_variable", "loc": [80, 80], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L79_C16", "vector": [14, 5, 0.2508, 0.0031, 5, 0.86, 0.0, 134, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clutter_features", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " clutter_features = (dict['features'])[np.nonzero(dict['labels'] == processor.LABEL_CLUTTER)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L81_C20", "label": "if", "type": "if", "loc": [81, 84], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L79_C16", "vector": [4, 5, 0.2586, 0.0125, 5, 0.86, 0.5, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(clutter_features) > 0: #if there are none, do nothin'\n dict['set_size'] += difference\n dict['features'] = np.vstack((dict['features'], clutter_features[np.random.randint(0,len(clutter_features),size=difference)]))\n dict['labels'] = np.hstack((dict['labels'], np.ones(difference) * processor.LABEL_CLUTTER))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L83_C24", "label": " = vstack()", "type": "assigned_variable", "loc": [83, 83], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L81_C20", "vector": [14, 6, 0.2602, 0.0031, 6, 0.46, 0.0, 0, 3, 1, 0, 0, 269, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "vstack", "annotation": ""}, "snippet": " dict['features'] = np.vstack((dict['features'], clutter_features[np.random.randint(0,len(clutter_features),size=difference)]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L84_C24", "label": " = hstack()", "type": "assigned_variable", "loc": [84, 84], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L81_C20", "vector": [14, 6, 0.2633, 0.0031, 6, 0.46, 1.0, 0, 3, 1, 0, 0, 85, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "hstack", "annotation": ""}, "snippet": " dict['labels'] = np.hstack((dict['labels'], np.ones(difference) * processor.LABEL_CLUTTER))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L85_C16", "label": "if", "type": "if", "loc": [85, 91], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L79_C16", "vector": [4, 5, 0.2759, 0.0219, 5, 0.86, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif difference < 0: \n surface_features = (dict['features'])[np.nonzero(dict['labels'] == processor.LABEL_SURFACE)]\n if len(surface_features) > 0: #if there are none, do nothin'\n difference = -difference\n dict['set_size'] += difference\n dict['features'] = np.vstack((dict['features'], surface_features[np.random.randint(0,len(surface_features),size=difference)]))\n dict['labels'] = np.hstack((dict['labels'], np.ones(difference) * processor.LABEL_SURFACE))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L86_C20", "label": "surface_features =", "type": "assigned_variable", "loc": [86, 86], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L85_C16", "vector": [14, 6, 0.2696, 0.0031, 6, 0.14, 0.0, 618, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "surface_features", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " surface_features = (dict['features'])[np.nonzero(dict['labels'] == processor.LABEL_SURFACE)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L87_C20", "label": "if", "type": "if", "loc": [87, 91], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L85_C16", "vector": [4, 6, 0.279, 0.0157, 6, 0.14, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(surface_features) > 0: #if there are none, do nothin'\n difference = -difference\n dict['set_size'] += difference\n dict['features'] = np.vstack((dict['features'], surface_features[np.random.randint(0,len(surface_features),size=difference)]))\n dict['labels'] = np.hstack((dict['labels'], np.ones(difference) * processor.LABEL_SURFACE))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L88_C24", "label": "difference =", "type": "assigned_variable", "loc": [88, 88], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L87_C20", "vector": [14, 7, 0.2759, 0.0031, 7, 0.47, 0.0, 498, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "difference", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " difference = -difference"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L90_C24", "label": " = vstack()", "type": "assigned_variable", "loc": [90, 90], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L87_C20", "vector": [14, 7, 0.2821, 0.0031, 7, 0.47, 0.5, 0, 3, 1, 0, 0, 269, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "vstack", "annotation": ""}, "snippet": " dict['features'] = np.vstack((dict['features'], surface_features[np.random.randint(0,len(surface_features),size=difference)]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L91_C24", "label": " = hstack()", "type": "assigned_variable", "loc": [91, 91], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L87_C20", "vector": [14, 7, 0.2853, 0.0031, 7, 0.47, 1.0, 0, 3, 1, 0, 0, 85, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "hstack", "annotation": ""}, "snippet": " dict['labels'] = np.hstack((dict['labels'], np.ones(difference) * processor.LABEL_SURFACE))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L94_C16", "label": "append()", "type": "expression", "loc": [94, 94], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L66_C12", "vector": [8, 4, 0.2947, 0.0031, 4, 0.56, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " data.append(dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L96_C12", "label": "self.processor.scan_dataset = get_next_dataset()", "type": "assigned_variable", "loc": [96, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:While_L65_C8", "vector": [14, 3, 0.3009, 0.0031, 3, 0.12, 1.0, 356, 3, 0, 0, 0, 672, 10, 1], "semantic": {"name": "self.processor.scan_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "get_next_dataset", "annotation": ""}, "snippet": " self.processor.scan_dataset = self.processor.scans_database.get_next_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L100_C8", "label": "self.processor.scan_dataset = get_dataset()", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "vector": [14, 2, 0.3135, 0.0031, 2, 0.54, 0.2667, 356, 3, 1, 0, 0, 941, 10, 1], "semantic": {"name": "self.processor.scan_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "get_dataset", "annotation": ""}, "snippet": " self.processor.scan_dataset = self.processor.scans_database.get_dataset(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L101_C8", "label": "current_training_set_index =", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "vector": [14, 2, 0.3166, 0.0031, 2, 0.54, 0.3333, 841, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "current_training_set_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " current_training_set_index = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L104_C8", "label": "feature_vector_length = len()", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "vector": [14, 2, 0.326, 0.0031, 2, 0.54, 0.4, 71, 3, 1, 0, 0, 890, 10, 2], "semantic": {"name": "feature_vector_length", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " feature_vector_length = len(self.processor.features.get_indexvector(self.features))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L105_C8", "label": "print()", "type": "expression", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "vector": [8, 2, 0.3292, 0.0031, 2, 0.54, 0.4667, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), feature_vector_length)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L107_C8", "label": "print()", "type": "expression", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "vector": [8, 2, 0.3354, 0.0031, 2, 0.54, 0.5333, 535, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), '#training set size ', training_set_size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L110_C8", "label": "max_traning_size =", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "vector": [14, 2, 0.3448, 0.0031, 2, 0.54, 0.6, 163, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "max_traning_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_traning_size = 1800000#2040000"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "label": "if", "type": "if", "loc": [112, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "vector": [4, 2, 0.4514, 0.2038, 2, 0.54, 0.6667, 0, 1, 0, 0, 0, 0, 0, 31], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if True: \n train_data = cv.cvCreateMat(training_set_size,feature_vector_length,cv.CV_32FC1) #CvMat* cvCreateMat(int rows, int cols, int type)\n train_labels = cv.cvCreateMat(training_set_size,1,cv.CV_32FC1)\n \n for dict in data: \n for index in range(dict['set_size']):\n #only train on surface and clutter\n if dict['labels'][index] == processor.LABEL_SURFACE or dict['labels'][index]== processor.LABEL_CLUTTER:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L113_C12", "label": "train_data = cvCreateMat()", "type": "assigned_variable", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "vector": [14, 3, 0.3542, 0.0031, 3, 0.38, 0.0, 774, 3, 3, 0, 0, 223, 10, 1], "semantic": {"name": "train_data", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateMat", "annotation": ""}, "snippet": " train_data = cv.cvCreateMat(training_set_size,feature_vector_length,cv.CV_32FC1) #CvMat* cvCreateMat(int rows, int cols, int type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L114_C12", "label": "train_labels = cvCreateMat()", "type": "assigned_variable", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "vector": [14, 3, 0.3574, 0.0031, 3, 0.38, 0.0667, 887, 3, 3, 0, 0, 223, 10, 1], "semantic": {"name": "train_labels", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateMat", "annotation": ""}, "snippet": " train_labels = cv.cvCreateMat(training_set_size,1,cv.CV_32FC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L116_C12", "label": "for dict", "type": "for", "loc": [116, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "vector": [6, 3, 0.4028, 0.0815, 3, 0.38, 0.1333, 827, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for dict in data: \n for index in range(dict['set_size']):\n #only train on surface and clutter\n if dict['labels'][index] == processor.LABEL_SURFACE or dict['labels'][index]== processor.LABEL_CLUTTER:\n \n #print getTime(), point3d\n #print getTime(), 'fvindexv',self.get_features_indexvector(features)\n #print getTime(), 'len', len(self.get_features_indexvector(features))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L117_C16", "label": "for index", "type": "for", "loc": [117, 141], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L116_C12", "vector": [6, 4, 0.4044, 0.0784, 4, 0.62, 0.0, 780, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index in range(dict['set_size']):\n #only train on surface and clutter\n if dict['labels'][index] == processor.LABEL_SURFACE or dict['labels'][index]== processor.LABEL_CLUTTER:\n \n #print getTime(), point3d\n #print getTime(), 'fvindexv',self.get_features_indexvector(features)\n #print getTime(), 'len', len(self.get_features_indexvector(features))\n fv = (dict['features'][index])[self.processor.features.get_indexvector(self.features)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L119_C20", "label": "if", "type": "if", "loc": [119, 141], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L117_C16", "vector": [4, 5, 0.4075, 0.0721, 5, 0.6, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dict['labels'][index] == processor.LABEL_SURFACE or dict['labels'][index]== processor.LABEL_CLUTTER:\n \n #print getTime(), point3d\n #print getTime(), 'fvindexv',self.get_features_indexvector(features)\n #print getTime(), 'len', len(self.get_features_indexvector(features))\n fv = (dict['features'][index])[self.processor.features.get_indexvector(self.features)]\n \n #print getTime(), 'fv',fv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L124_C24", "label": "fv =", "type": "assigned_variable", "loc": [124, 124], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L119_C20", "vector": [14, 6, 0.3887, 0.0031, 6, 0.54, 0.0, 914, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fv = (dict['features'][index])[self.processor.features.get_indexvector(self.features)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L128_C24", "label": "for fv_index, fv_value", "type": "for", "loc": [128, 129], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L119_C20", "vector": [6, 6, 0.4028, 0.0063, 6, 0.54, 0.25, 81, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fv_index, fv_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for fv_index, fv_value in enumerate(fv):\n train_data[current_training_set_index][fv_index] = fv_value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L129_C28", "label": "assign", "type": "assigned_variable", "loc": [129, 129], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L128_C24", "vector": [14, 7, 0.4044, 0.0031, 7, 0.84, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " train_data[current_training_set_index][fv_index] = fv_value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L130_C24", "label": "assign", "type": "assigned_variable", "loc": [130, 130], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L119_C20", "vector": [14, 6, 0.4075, 0.0031, 6, 0.54, 0.5, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " train_labels[current_training_set_index] = dict['labels'][index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L136_C24", "label": "current_training_set_index =", "type": "assigned_variable", "loc": [136, 136], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L119_C20", "vector": [14, 6, 0.4263, 0.0031, 6, 0.54, 0.75, 841, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "current_training_set_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " current_training_set_index = current_training_set_index + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L140_C24", "label": "if", "type": "if", "loc": [140, 141], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L119_C20", "vector": [4, 6, 0.4404, 0.0063, 6, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if current_training_set_index % 16384 == 0:\n print(getTime(), 'reading features:', current_training_set_index, 'of', training_set_size, '(',(float(current_training_set_index)/float(training_set_size)*100.0),'%)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L141_C28", "label": "print()", "type": "expression", "loc": [141, 141], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L140_C24", "vector": [8, 7, 0.442, 0.0031, 7, 0.49, 0.0, 535, 3, 8, 0, 0, 0, 0, 4], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), 'reading features:', current_training_set_index, 'of', training_set_size, '(',(float(current_training_set_index)/float(training_set_size)*100.0),'%)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L144_C12", "label": "print()", "type": "expression", "loc": [144, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "vector": [8, 3, 0.4514, 0.0031, 3, 0.38, 0.2, 535, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), 'more than',max_traning_size,'features, sample from them...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L146_C12", "label": "all_data =", "type": "assigned_variable", "loc": [146, 146], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "vector": [14, 3, 0.4577, 0.0031, 3, 0.38, 0.2667, 688, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "all_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " all_data = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L147_C12", "label": "all_labels =", "type": "assigned_variable", "loc": [147, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "vector": [14, 3, 0.4608, 0.0031, 3, 0.38, 0.3333, 675, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "all_labels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " all_labels = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L148_C12", "label": "for dict", "type": "for", "loc": [148, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "vector": [6, 3, 0.4781, 0.0313, 3, 0.38, 0.4, 827, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for dict in data: \n for index in range(dict['set_size']):\n if dict['labels'][index] == processor.LABEL_SURFACE or dict['labels'][index]== processor.LABEL_CLUTTER:\n fv = (dict['features'][index])[self.processor.features.get_indexvector(self.features)]\n all_data += [fv]\n all_labels += [dict['labels'][index]]\n \n current_training_set_index = current_training_set_index + 1 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L149_C16", "label": "for index", "type": "for", "loc": [149, 157], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L148_C12", "vector": [6, 4, 0.4796, 0.0282, 4, 0.37, 0.0, 780, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index in range(dict['set_size']):\n if dict['labels'][index] == processor.LABEL_SURFACE or dict['labels'][index]== processor.LABEL_CLUTTER:\n fv = (dict['features'][index])[self.processor.features.get_indexvector(self.features)]\n all_data += [fv]\n all_labels += [dict['labels'][index]]\n \n current_training_set_index = current_training_set_index + 1 \n if current_training_set_index % 16384 == 0:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L150_C20", "label": "if", "type": "if", "loc": [150, 157], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L149_C16", "vector": [4, 5, 0.4812, 0.0251, 5, 0.33, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dict['labels'][index] == processor.LABEL_SURFACE or dict['labels'][index]== processor.LABEL_CLUTTER:\n fv = (dict['features'][index])[self.processor.features.get_indexvector(self.features)]\n all_data += [fv]\n all_labels += [dict['labels'][index]]\n \n current_training_set_index = current_training_set_index + 1 \n if current_training_set_index % 16384 == 0:\n print(getTime(), 'reading features:', current_training_set_index, 'of', training_set_size, '(',(float(current_training_set_index)/float(training_set_size)*100.0),'%)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L151_C24", "label": "fv =", "type": "assigned_variable", "loc": [151, 151], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L150_C20", "vector": [14, 6, 0.4734, 0.0031, 6, 0.72, 0.0, 914, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fv = (dict['features'][index])[self.processor.features.get_indexvector(self.features)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L155_C24", "label": "current_training_set_index =", "type": "assigned_variable", "loc": [155, 155], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L150_C20", "vector": [14, 6, 0.4859, 0.0031, 6, 0.72, 0.5, 841, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "current_training_set_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " current_training_set_index = current_training_set_index + 1 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L156_C24", "label": "if", "type": "if", "loc": [156, 157], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L150_C20", "vector": [4, 6, 0.4906, 0.0063, 6, 0.72, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if current_training_set_index % 16384 == 0:\n print(getTime(), 'reading features:', current_training_set_index, 'of', training_set_size, '(',(float(current_training_set_index)/float(training_set_size)*100.0),'%)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L157_C28", "label": "print()", "type": "expression", "loc": [157, 157], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L156_C24", "vector": [8, 7, 0.4922, 0.0031, 7, 0.29, 0.0, 535, 3, 8, 0, 0, 0, 0, 4], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), 'reading features:', current_training_set_index, 'of', training_set_size, '(',(float(current_training_set_index)/float(training_set_size)*100.0),'%)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Import_L160_C12", "label": "random import random", "type": "import", "loc": [160, 160], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "vector": [1, 3, 0.5016, 0.0031, 3, 0.38, 0.4667, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rhs_call_name": "", "annotation": ""}, "snippet": " import random"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L161_C12", "label": "indices = array()", "type": "assigned_variable", "loc": [161, 161], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "vector": [14, 3, 0.5047, 0.0031, 3, 0.38, 0.5333, 478, 3, 1, 0, 0, 80, 10, 4], "semantic": {"name": "indices", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " indices = np.array(random.sample(xrange(len(all_labels)),max_traning_size))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L162_C12", "label": "all_data = asarray()", "type": "assigned_variable", "loc": [162, 162], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "vector": [14, 3, 0.5078, 0.0031, 3, 0.38, 0.6, 688, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "all_data", "arg_names": [], "import_names": [], "rhs_call_name": "asarray", "annotation": ""}, "snippet": " all_data = np.asarray(all_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L163_C12", "label": "all_labels = asarray()", "type": "assigned_variable", "loc": [163, 163], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "vector": [14, 3, 0.511, 0.0031, 3, 0.38, 0.6667, 675, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "all_labels", "arg_names": [], "import_names": [], "rhs_call_name": "asarray", "annotation": ""}, "snippet": " all_labels = np.asarray(all_labels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L165_C12", "label": "all_data =", "type": "assigned_variable", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "vector": [14, 3, 0.5172, 0.0031, 3, 0.38, 0.7333, 688, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "all_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " all_data = all_data[indices]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L166_C12", "label": "all_labels =", "type": "assigned_variable", "loc": [166, 166], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "vector": [14, 3, 0.5204, 0.0031, 3, 0.38, 0.8, 675, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "all_labels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " all_labels = all_labels[indices]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L168_C12", "label": "train_data = cvCreateMat()", "type": "assigned_variable", "loc": [168, 168], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "vector": [14, 3, 0.5266, 0.0031, 3, 0.38, 0.8667, 774, 3, 3, 0, 0, 223, 10, 1], "semantic": {"name": "train_data", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateMat", "annotation": ""}, "snippet": " train_data = cv.cvCreateMat(max_traning_size,feature_vector_length,cv.CV_32FC1) #CvMat* cvCreateMat(int rows, int cols, int type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L169_C12", "label": "train_labels = cvCreateMat()", "type": "assigned_variable", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "vector": [14, 3, 0.5298, 0.0031, 3, 0.38, 0.9333, 887, 3, 3, 0, 0, 223, 10, 1], "semantic": {"name": "train_labels", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateMat", "annotation": ""}, "snippet": " train_labels = cv.cvCreateMat(max_traning_size,1,cv.CV_32FC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L171_C12", "label": "for index", "type": "for", "loc": [171, 176], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "vector": [6, 3, 0.5439, 0.0188, 3, 0.38, 1.0, 780, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index in range(max_traning_size):\n for fv_index, fv_value in enumerate(all_data[index]):\n train_data[index][fv_index] = fv_value\n train_labels[index] = all_labels[index]\n if index % 16384 == 0:\n print(getTime(), 'setting features:', (float(index)/float(max_traning_size)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L172_C16", "label": "for fv_index, fv_value", "type": "for", "loc": [172, 174], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L171_C12", "vector": [6, 4, 0.5423, 0.0094, 4, 0.83, 0.0, 81, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fv_index, fv_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for fv_index, fv_value in enumerate(all_data[index]):\n train_data[index][fv_index] = fv_value\n train_labels[index] = all_labels[index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L173_C20", "label": "assign", "type": "assigned_variable", "loc": [173, 173], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L172_C16", "vector": [14, 5, 0.5423, 0.0031, 5, 0.49, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " train_data[index][fv_index] = fv_value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L174_C20", "label": "assign", "type": "assigned_variable", "loc": [174, 174], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L172_C16", "vector": [14, 5, 0.5455, 0.0031, 5, 0.49, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " train_labels[index] = all_labels[index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L175_C16", "label": "if", "type": "if", "loc": [175, 176], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L171_C12", "vector": [4, 4, 0.5502, 0.0063, 4, 0.83, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if index % 16384 == 0:\n print(getTime(), 'setting features:', (float(index)/float(max_traning_size)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L176_C20", "label": "print()", "type": "expression", "loc": [176, 176], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L175_C16", "vector": [8, 5, 0.5517, 0.0031, 5, 0.47, 0.0, 535, 3, 3, 0, 0, 0, 0, 4], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), 'setting features:', (float(index)/float(max_traning_size)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L179_C8", "label": "print()", "type": "expression", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "vector": [8, 2, 0.5611, 0.0031, 2, 0.54, 0.7333, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), 'start training Classifier')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L181_C8", "label": "type_mask = cvCreateMat()", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "vector": [14, 2, 0.5674, 0.0031, 2, 0.54, 0.8, 974, 3, 3, 0, 0, 223, 10, 1], "semantic": {"name": "type_mask", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateMat", "annotation": ""}, "snippet": " type_mask = cv.cvCreateMat(1, feature_vector_length+1, cv.CV_8UC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L182_C8", "label": "cvSet()", "type": "expression", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "vector": [8, 2, 0.5705, 0.0031, 2, 0.54, 0.8667, 26, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "cvSet", "arg_names": [], "import_names": [], "rhs_call_name": "cvSet", "annotation": ""}, "snippet": " cv.cvSet( type_mask, cv.CV_VAR_NUMERICAL, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L183_C8", "label": "assign", "type": "assigned_variable", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "vector": [14, 2, 0.5737, 0.0031, 2, 0.54, 0.9333, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " type_mask[feature_vector_length] = cv.CV_VAR_CATEGORICAL"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Return_L185_C8", "label": "return", "type": "return", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "vector": [13, 2, 0.5799, 0.0031, 2, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (train_data, train_labels, type_mask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L189_C4", "label": "train", "type": "function", "loc": [189, 204], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:ClassDef_L44_C0", "vector": [2, 1, 0.616, 0.0502, 1, 0.64, 0.3333, 371, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "train", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def train(self):\n #cv_boost_params = cv.CvBoostParams()\n\n #priors = cv.cvCreateMat(1,2,cv.CV_32FC1)\n #priors[0] = 10\n #priors[1] = 1\n \n #cv_boost_params.max_categories = 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L198_C8", "label": "self.cv_classifier = CvDTree()", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L189_C4", "vector": [14, 2, 0.6207, 0.0031, 2, 0.33, 0.0, 784, 3, 0, 0, 0, 653, 10, 1], "semantic": {"name": "self.cv_classifier", "arg_names": [], "import_names": [], "rhs_call_name": "CvDTree", "annotation": ""}, "snippet": " self.cv_classifier = cv.CvDTree() #cv.CvBoost()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L199_C8", "label": "train_datastructures = create_train_datastructures()", "type": "assigned_variable", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L189_C4", "vector": [14, 2, 0.6238, 0.0031, 2, 0.33, 0.25, 405, 3, 0, 0, 0, 389, 10, 1], "semantic": {"name": "train_datastructures", "arg_names": [], "import_names": [], "rhs_call_name": "create_train_datastructures", "annotation": ""}, "snippet": " train_datastructures = self.create_train_datastructures()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L201_C8", "label": "train_data, train_labels, type_mask =", "type": "assigned_variable", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L189_C4", "vector": [14, 2, 0.6301, 0.0031, 2, 0.33, 0.5, 422, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "train_data, train_labels, type_mask", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " (train_data, train_labels, type_mask) = train_datastructures"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L202_C8", "label": "print()", "type": "expression", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L189_C4", "vector": [8, 2, 0.6332, 0.0031, 2, 0.33, 0.75, 535, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), self.cv_classifier.train(train_data, cv.CV_ROW_SAMPLE, train_labels, None, None, type_mask ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L204_C8", "label": "print()", "type": "expression", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L189_C4", "vector": [8, 2, 0.6395, 0.0031, 2, 0.33, 1.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), 'traning finished')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L209_C4", "label": "release_train_datastructures", "type": "function", "loc": [209, 214], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:ClassDef_L44_C0", "vector": [2, 1, 0.663, 0.0188, 1, 0.64, 0.4444, 766, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "release_train_datastructures", "arg_names": ["self", "train_datastructures"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def release_train_datastructures(self, train_datastructures):\n if None != train_datastructures:\n (train_data, train_labels, type_mask) = train_datastructures\n cv.cvReleaseMat(train_data)\n cv.cvReleaseMat(train_labels)\n cv.cvReleaseMat(type_mask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L210_C8", "label": "if", "type": "if", "loc": [210, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L209_C4", "vector": [4, 2, 0.6646, 0.0157, 2, 0.59, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if None != train_datastructures:\n (train_data, train_labels, type_mask) = train_datastructures\n cv.cvReleaseMat(train_data)\n cv.cvReleaseMat(train_labels)\n cv.cvReleaseMat(type_mask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L211_C12", "label": "train_data, train_labels, type_mask =", "type": "assigned_variable", "loc": [211, 211], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L210_C8", "vector": [14, 3, 0.6614, 0.0031, 3, 0.73, 0.0, 422, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "train_data, train_labels, type_mask", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " (train_data, train_labels, type_mask) = train_datastructures"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L212_C12", "label": "cvReleaseMat()", "type": "expression", "loc": [212, 212], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L210_C8", "vector": [8, 3, 0.6646, 0.0031, 3, 0.73, 0.3333, 91, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "cvReleaseMat", "arg_names": [], "import_names": [], "rhs_call_name": "cvReleaseMat", "annotation": ""}, "snippet": " cv.cvReleaseMat(train_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L213_C12", "label": "cvReleaseMat()", "type": "expression", "loc": [213, 213], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L210_C8", "vector": [8, 3, 0.6677, 0.0031, 3, 0.73, 0.6667, 91, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "cvReleaseMat", "arg_names": [], "import_names": [], "rhs_call_name": "cvReleaseMat", "annotation": ""}, "snippet": " cv.cvReleaseMat(train_labels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L214_C12", "label": "cvReleaseMat()", "type": "expression", "loc": [214, 214], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L210_C8", "vector": [8, 3, 0.6708, 0.0031, 3, 0.73, 1.0, 91, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "cvReleaseMat", "arg_names": [], "import_names": [], "rhs_call_name": "cvReleaseMat", "annotation": ""}, "snippet": " cv.cvReleaseMat(type_mask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "label": "test", "type": "function", "loc": [217, 263], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:ClassDef_L44_C0", "vector": [2, 1, 0.7524, 0.1473, 1, 0.64, 0.5556, 224, 0, 2, 1, 0, 0, 0, 25], "semantic": {"name": "test", "arg_names": ["self", "feature_data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def test(self, feature_data = None):\n #test on current scan:\n print(getTime(), 'test on:', self.processor.scan_dataset.id)\n \n if feature_data == None:\n filename = self.processor.get_features_filename()\n print('loading', filename)\n dict = ut.load_pickle(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L219_C8", "label": "print()", "type": "expression", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "vector": [8, 2, 0.6865, 0.0031, 2, 0.26, 0.0, 535, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), 'test on:', self.processor.scan_dataset.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L221_C8", "label": "if", "type": "if", "loc": [221, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "vector": [4, 2, 0.7006, 0.0188, 2, 0.26, 0.0769, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if feature_data == None:\n filename = self.processor.get_features_filename()\n print('loading', filename)\n dict = ut.load_pickle(filename)\n else:\n dict = feature_data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L222_C12", "label": "filename = get_features_filename()", "type": "assigned_variable", "loc": [222, 222], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L221_C8", "vector": [14, 3, 0.6959, 0.0031, 3, 0.22, 0.0, 275, 3, 0, 0, 0, 49, 10, 1], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "get_features_filename", "annotation": ""}, "snippet": " filename = self.processor.get_features_filename()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L223_C12", "label": "print()", "type": "expression", "loc": [223, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L221_C8", "vector": [8, 3, 0.6991, 0.0031, 3, 0.22, 0.3333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('loading', filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L224_C12", "label": "dict = load_pickle()", "type": "assigned_variable", "loc": [224, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L221_C8", "vector": [14, 3, 0.7022, 0.0031, 3, 0.22, 0.6667, 827, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "dict", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " dict = ut.load_pickle(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L226_C12", "label": "dict =", "type": "assigned_variable", "loc": [226, 226], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L221_C8", "vector": [14, 3, 0.7085, 0.0031, 3, 0.22, 1.0, 827, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dict = feature_data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L229_C8", "label": "current_set_size =", "type": "assigned_variable", "loc": [229, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "vector": [14, 2, 0.7179, 0.0031, 2, 0.26, 0.1538, 575, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "current_set_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " current_set_size = dict['set_size']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L230_C8", "label": "feature_vector_length = len()", "type": "assigned_variable", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "vector": [14, 2, 0.721, 0.0031, 2, 0.26, 0.2308, 71, 3, 1, 0, 0, 890, 10, 2], "semantic": {"name": "feature_vector_length", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " feature_vector_length = len(self.processor.features.get_indexvector(self.features))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L231_C8", "label": "print()", "type": "expression", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "vector": [8, 2, 0.7241, 0.0031, 2, 0.26, 0.3077, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), feature_vector_length)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L232_C8", "label": "labels = array()", "type": "assigned_variable", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "vector": [14, 2, 0.7273, 0.0031, 2, 0.26, 0.3846, 283, 3, 1, 0, 0, 80, 10, 3], "semantic": {"name": "labels", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " labels = np.array(np.zeros(len(self.processor.map_polys)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L233_C8", "label": "print()", "type": "expression", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "vector": [8, 2, 0.7304, 0.0031, 2, 0.26, 0.4615, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('test: length of labels vector:', len(labels))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L234_C8", "label": "test = cvCreateMat()", "type": "assigned_variable", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "vector": [14, 2, 0.7335, 0.0031, 2, 0.26, 0.5385, 224, 3, 3, 0, 0, 223, 10, 1], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateMat", "annotation": ""}, "snippet": " test = cv.cvCreateMat(1,feature_vector_length,cv.CV_32FC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L236_C8", "label": "if", "type": "if", "loc": [236, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "vector": [4, 2, 0.7429, 0.0094, 2, 0.26, 0.6154, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if current_set_size == 0:\n print(getTime(), 'ERROR: test dataset is empty!')\n return labels, 1, 1, 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L237_C12", "label": "print()", "type": "expression", "loc": [237, 237], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L236_C8", "vector": [8, 3, 0.7429, 0.0031, 3, 0.84, 0.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), 'ERROR: test dataset is empty!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Return_L238_C12", "label": "return", "type": "return", "loc": [238, 238], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L236_C8", "vector": [13, 3, 0.7461, 0.0031, 3, 0.84, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return labels, 1, 1, 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L240_C8", "label": "count =", "type": "assigned_variable", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "vector": [14, 2, 0.7524, 0.0031, 2, 0.26, 0.6923, 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_99727:For_L241_C8", "label": "for index", "type": "for", "loc": [241, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "vector": [6, 2, 0.779, 0.0502, 2, 0.26, 0.7692, 780, 6, 0, 0, 0, 0, 0, 7], "semantic": {"name": "index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index in dict['point_indices']:\n fv = (dict['features'][count])[self.processor.features.get_indexvector(self.features)]\n #print getTime(), fv, dict['features'][count]\n\n for fv_index, fv_value in enumerate(fv):\n test[fv_index] = fv_value\n \n #print 'class',self.cv_classifier"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L242_C12", "label": "fv =", "type": "assigned_variable", "loc": [242, 242], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L241_C8", "vector": [14, 3, 0.7586, 0.0031, 3, 0.68, 0.0, 914, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fv = (dict['features'][count])[self.processor.features.get_indexvector(self.features)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L245_C12", "label": "for fv_index, fv_value", "type": "for", "loc": [245, 246], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L241_C8", "vector": [6, 3, 0.7696, 0.0063, 3, 0.68, 0.25, 81, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fv_index, fv_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for fv_index, fv_value in enumerate(fv):\n test[fv_index] = fv_value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L246_C16", "label": "assign", "type": "assigned_variable", "loc": [246, 246], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L245_C12", "vector": [14, 4, 0.7712, 0.0031, 4, 0.41, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test[fv_index] = fv_value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L249_C12", "label": "label = predict()", "type": "assigned_variable", "loc": [249, 249], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L241_C8", "vector": [14, 3, 0.7806, 0.0031, 3, 0.68, 0.5, 811, 3, 1, 0, 0, 127, 10, 1], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "predict", "annotation": ""}, "snippet": " label = self.cv_classifier.predict(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L251_C12", "label": "assign", "type": "assigned_variable", "loc": [251, 251], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L241_C8", "vector": [14, 3, 0.7868, 0.0031, 3, 0.68, 0.75, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labels[index] = label.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L253_C12", "label": "if", "type": "if", "loc": [253, 254], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L241_C8", "vector": [4, 3, 0.7947, 0.0063, 3, 0.68, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if count % 4096 == 0:\n print(getTime(), 'testing:', count, 'of', current_set_size, '(',(float(count)/float(current_set_size)*100.0),'%)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L254_C16", "label": "print()", "type": "expression", "loc": [254, 254], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L253_C12", "vector": [8, 4, 0.7962, 0.0031, 4, 0.51, 0.0, 535, 3, 8, 0, 0, 0, 0, 4], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), 'testing:', count, 'of', current_set_size, '(',(float(count)/float(current_set_size)*100.0),'%)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L260_C8", "label": "self.test_feature_dict =", "type": "assigned_variable", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "vector": [14, 2, 0.815, 0.0031, 2, 0.26, 0.8462, 797, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.test_feature_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.test_feature_dict = dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L261_C8", "label": "self.test_labels =", "type": "assigned_variable", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "vector": [14, 2, 0.8182, 0.0031, 2, 0.26, 0.9231, 563, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.test_labels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.test_labels = labels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Return_L263_C8", "label": "return", "type": "return", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "vector": [13, 2, 0.8245, 0.0031, 2, 0.26, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return labels, self.test_results(dict, labels) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L267_C4", "label": "test_postprocess", "type": "function", "loc": [267, 269], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:ClassDef_L44_C0", "vector": [2, 1, 0.8401, 0.0094, 1, 0.64, 0.6667, 203, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "test_postprocess", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def test_postprocess(self):\n labels = self.postprocess(self.test_labels)\n return labels, self.test_results(self.test_feature_dict, labels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L268_C8", "label": "labels = postprocess()", "type": "assigned_variable", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L267_C4", "vector": [14, 2, 0.8401, 0.0031, 2, 0.06, 0.0, 283, 3, 1, 0, 0, 16, 10, 1], "semantic": {"name": "labels", "arg_names": [], "import_names": [], "rhs_call_name": "postprocess", "annotation": ""}, "snippet": " labels = self.postprocess(self.test_labels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Return_L269_C8", "label": "return", "type": "return", "loc": [269, 269], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L267_C4", "vector": [13, 2, 0.8433, 0.0031, 2, 0.06, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return labels, self.test_results(self.test_feature_dict, labels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "label": "postprocess", "type": "function", "loc": [271, 303], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:ClassDef_L44_C0", "vector": [2, 1, 0.8997, 0.1034, 1, 0.64, 0.7778, 16, 0, 2, 1, 0, 0, 0, 16], "semantic": {"name": "postprocess", "arg_names": ["self", "labels"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def postprocess(self, labels):\n \n debug = False\n model = ransac.PlaneLeastSquaresModel(debug)\n data_idx = np.where(np.asarray(labels) == processor.LABEL_SURFACE)[0]\n data = np.asarray(self.processor.pts3d_bound).T[data_idx]\n n, _ = np.shape(data)\n if n < 5000:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L273_C8", "label": "debug =", "type": "assigned_variable", "loc": [273, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "vector": [14, 2, 0.8558, 0.0031, 2, 0.82, 0.0, 924, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " debug = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L274_C8", "label": "model = PlaneLeastSquaresModel()", "type": "assigned_variable", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "vector": [14, 2, 0.8589, 0.0031, 2, 0.82, 0.0714, 722, 3, 1, 0, 0, 15, 10, 1], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "PlaneLeastSquaresModel", "annotation": ""}, "snippet": " model = ransac.PlaneLeastSquaresModel(debug)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L275_C8", "label": "data_idx =", "type": "assigned_variable", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "vector": [14, 2, 0.8621, 0.0031, 2, 0.82, 0.1429, 258, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "data_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_idx = np.where(np.asarray(labels) == processor.LABEL_SURFACE)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L276_C8", "label": "data =", "type": "assigned_variable", "loc": [276, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "vector": [14, 2, 0.8652, 0.0031, 2, 0.82, 0.2143, 929, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data = np.asarray(self.processor.pts3d_bound).T[data_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L277_C8", "label": "n, _ = shape()", "type": "assigned_variable", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "vector": [14, 2, 0.8683, 0.0031, 2, 0.82, 0.2857, 466, 3, 1, 0, 0, 381, 10, 1], "semantic": {"name": "n, _", "arg_names": [], "import_names": [], "rhs_call_name": "shape", "annotation": ""}, "snippet": " n, _ = np.shape(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L278_C8", "label": "if", "type": "if", "loc": [278, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "vector": [4, 2, 0.8762, 0.0125, 2, 0.82, 0.3571, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n < 5000:\n k = 700\n else:\n k = 2000"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L279_C12", "label": "k =", "type": "assigned_variable", "loc": [279, 279], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L278_C8", "vector": [14, 3, 0.8746, 0.0031, 3, 0.44, 0.0, 954, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " k = 700"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L281_C12", "label": "k =", "type": "assigned_variable", "loc": [281, 281], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L278_C8", "vector": [14, 3, 0.8809, 0.0031, 3, 0.44, 1.0, 954, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " k = 2000"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L283_C8", "label": "ransac_fit, ransac_data = ransac()", "type": "assigned_variable", "loc": [283, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "vector": [14, 2, 0.8903, 0.0094, 2, 0.82, 0.4286, 711, 3, 8, 0, 0, 32, 10, 2], "semantic": {"name": "ransac_fit, ransac_data", "arg_names": [], "import_names": [], "rhs_call_name": "ransac", "annotation": ""}, "snippet": " ransac_fit, ransac_data = ransac.ransac(data,model,\n 3, k, 0.04, len(data_idx)/2.5, # misc. parameters\n debug=debug,return_all=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L286_C8", "label": "print()", "type": "expression", "loc": [286, 286], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "vector": [8, 2, 0.8966, 0.0031, 2, 0.82, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('ransac: model',ransac_fit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L287_C8", "label": "print()", "type": "expression", "loc": [287, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "vector": [8, 2, 0.8997, 0.0031, 2, 0.82, 0.5714, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('ransac:',ransac_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L288_C8", "label": "print()", "type": "expression", "loc": [288, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "vector": [8, 2, 0.9028, 0.0031, 2, 0.82, 0.6429, 535, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('len inlier',len(ransac_data['inliers']),'shape pts',np.shape(self.processor.pts3d_bound))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L291_C8", "label": "fancy = astype()", "type": "assigned_variable", "loc": [291, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "vector": [14, 2, 0.9122, 0.0031, 2, 0.82, 0.7143, 549, 3, 1, 0, 0, 32, 10, 4], "semantic": {"name": "fancy", "arg_names": [], "import_names": [], "rhs_call_name": "astype", "annotation": ""}, "snippet": " fancy = np.zeros(len(np.asarray(labels))).astype(bool)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L292_C8", "label": "assign", "type": "assigned_variable", "loc": [292, 292], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "vector": [14, 2, 0.9154, 0.0031, 2, 0.82, 0.7857, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fancy[data_idx] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L293_C8", "label": "assign", "type": "assigned_variable", "loc": [293, 293], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "vector": [14, 2, 0.9185, 0.0031, 2, 0.82, 0.8571, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fancy[data_idx[ransac_data['inliers']]] = False "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L294_C8", "label": "assign", "type": "assigned_variable", "loc": [294, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "vector": [14, 2, 0.9216, 0.0031, 2, 0.82, 0.9286, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labels[fancy] = processor.LABEL_CLUTTER #all surface-labeled non-plane pts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Return_L303_C8", "label": "return", "type": "return", "loc": [303, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "vector": [13, 2, 0.9498, 0.0031, 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 labels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L305_C4", "label": "save", "type": "function", "loc": [305, 311], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:ClassDef_L44_C0", "vector": [2, 1, 0.9655, 0.0219, 1, 0.64, 0.8889, 928, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "save", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def save(self):\n classifier_filename = self.get_filename()\n \n #if file doesn't exist: create it\n if False == os.path.isfile(classifier_filename):\n open(classifier_filename,'w')\n self.cv_classifier.save(classifier_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L306_C8", "label": "classifier_filename = get_filename()", "type": "assigned_variable", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L305_C4", "vector": [14, 2, 0.9592, 0.0031, 2, 0.62, 0.0, 285, 3, 0, 0, 0, 676, 10, 1], "semantic": {"name": "classifier_filename", "arg_names": [], "import_names": [], "rhs_call_name": "get_filename", "annotation": ""}, "snippet": " classifier_filename = self.get_filename()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L309_C8", "label": "if", "type": "if", "loc": [309, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L305_C4", "vector": [4, 2, 0.9702, 0.0063, 2, 0.62, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False == os.path.isfile(classifier_filename):\n open(classifier_filename,'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L310_C12", "label": "open()", "type": "expression", "loc": [310, 310], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L309_C8", "vector": [8, 3, 0.9718, 0.0031, 3, 0.87, 0.0, 693, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "open", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " open(classifier_filename,'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L311_C8", "label": "save()", "type": "expression", "loc": [311, 311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L305_C4", "vector": [8, 2, 0.9749, 0.0031, 2, 0.62, 1.0, 928, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "save", "arg_names": [], "import_names": [], "rhs_call_name": "save", "annotation": ""}, "snippet": " self.cv_classifier.save(classifier_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L314_C4", "label": "load", "type": "function", "loc": [314, 317], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:ClassDef_L44_C0", "vector": [2, 1, 0.989, 0.0125, 1, 0.64, 1.0, 37, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "load", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def load(self):\n self.cv_classifier = cv.CvDTree() #cv.CvBoost()\n print(getTime(), 'loading Classifier',self.features)\n self.cv_classifier.load(self.get_filename())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L315_C8", "label": "self.cv_classifier = CvDTree()", "type": "assigned_variable", "loc": [315, 315], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L314_C4", "vector": [14, 2, 0.9875, 0.0031, 2, 0.77, 0.0, 784, 3, 0, 0, 0, 653, 10, 1], "semantic": {"name": "self.cv_classifier", "arg_names": [], "import_names": [], "rhs_call_name": "CvDTree", "annotation": ""}, "snippet": " self.cv_classifier = cv.CvDTree() #cv.CvBoost()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L316_C8", "label": "print()", "type": "expression", "loc": [316, 316], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L314_C4", "vector": [8, 2, 0.9906, 0.0031, 2, 0.77, 0.5, 535, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), 'loading Classifier',self.features)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L317_C8", "label": "load()", "type": "expression", "loc": [317, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L314_C4", "vector": [8, 2, 0.9937, 0.0031, 2, 0.77, 1.0, 37, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": " self.cv_classifier.load(self.get_filename())"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99727:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:While_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:While_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L66_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L68_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L66_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L69_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L66_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L70_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L66_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L73_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L66_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L79_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L79_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L80_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L79_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L81_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L81_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L83_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L81_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L84_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L79_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L85_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L85_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L86_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L85_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L87_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L87_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L88_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L87_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L90_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L87_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L91_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L66_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L94_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:While_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L116_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L117_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L117_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L119_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L119_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L124_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L119_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L128_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L128_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L129_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L119_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L130_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L119_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L136_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L119_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L140_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L140_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L141_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L146_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L148_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L149_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L149_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L150_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L150_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L151_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L150_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L155_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L150_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L156_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L156_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L157_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Import_L160_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L161_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L162_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L163_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L166_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L168_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L171_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L172_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L172_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L173_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L172_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L174_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L171_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L175_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L175_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L176_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Return_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L210_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L211_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L210_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L212_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L210_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L213_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L210_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L214_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L221_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L222_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L221_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L223_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L221_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L224_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L221_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L226_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L236_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L237_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L236_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Return_L238_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L241_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L242_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L241_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L245_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L245_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L246_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L241_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L249_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L241_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L251_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:For_L241_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L253_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L253_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L254_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Return_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L267_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Return_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L279_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L281_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L287_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L288_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L291_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L292_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L293_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L294_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Return_L303_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L305_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L305_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L305_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:If_L309_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L310_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L305_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L311_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L314_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Assign_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L316_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99727:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99727:Expr_L317_C8"}]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Hai Nguyen (Healthcare Robotics Lab, Georgia Tech.) import numpy as np def height_distribution(points, center=None, radius = 1.0): assert(points.shape[0] == 3) np.mean(points, axis=1)
ajibawa-2023/Python-Code-Large/train/row_99728
3
35
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99728:Import_L30_C0", "label": "numpy import np", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.8571, 0.0286, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99728:FunctionDef_L32_C0", "label": "height_distribution", "type": "function", "loc": [32, 34], "level": 0, "parent": null, "vector": [2, 0, 0.9429, 0.0857, 0, 0.66, 1.0, 629, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "height_distribution", "arg_names": ["points", "center", "radius"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def height_distribution(points, center=None, radius = 1.0):\n assert(points.shape[0] == 3)\n np.mean(points, axis=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99728:Expr_L34_C4", "label": "mean()", "type": "expression", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99728:FunctionDef_L32_C0", "vector": [8, 1, 0.9714, 0.0286, 1, 0.39, 0.0, 856, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "mean", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " np.mean(points, axis=1)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99728:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99728:Expr_L34_C4"}]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) from laser_camera_segmentation.srv._Segmentation import * import sensor_msgs import numpy as np import opencv as cv import hrl_lib.util as ut import opencv.highgui as highgui from labeling.label_object import label_object def convert_pointcloud_to_ROS(pts3d, intensities = None, labels = None): ROS_pointcloud = sensor_msgs.msg.PointCloud() ROS_pointcloud.points = [] for point in np.asarray(pts3d.T): ROS_pointcloud.points += [geometry_msgs.msg.Point32(point[0],point[1],point[2])] intensity_channel = sensor_msgs.msg.ChannelFloat32() intensity_channel.name = 'intensities' if intensities != None: for value in intensities: intensity_channel.values += [value] label_channel = sensor_msgs.msg.ChannelFloat32() label_channel.name = 'labels' if labels != None: for value in labels: label_channel.values += [value] ROS_pointcloud.channels = [intensity_channel, label_channel] return ROS_pointcloud def convert_ROS_pointcloud_to_pointcloud(ROS_pointcloud): intensities = [] labels = [] pts3d = [] for point in ROS_pointcloud.points: pts3d += [[point.x, point.y, point.z]] pts3d = np.array(pts3d).T #print pts3d for value in ROS_pointcloud.channels[0].values: intensities += [value] intensities = np.array(intensities) for value in ROS_pointcloud.channels[1].values: labels += [value] labels = np.array(labels) return pts3d, intensities, labels def convert_cvimage_to_ROS(image): imgTmp = cv.cvCloneImage(image) imNP = ut.cv2np(imgTmp,format='BGR') ROS_image = np.reshape(imNP,(1,-1))[0] return ROS_image def convert_ROS_image_to_cvimage(ROS_image, width, height): ROS_image = np.array(ROS_image, dtype='uint8') imNP = np.reshape(ROS_image,(height,width, 3)) cvimage = ut.np2cv(imNP) return cvimage #convert label_object to ROS geometry_msgs.msg.Polygon def convert_polygon_to_ROS(polygon): ROS_polygon = geometry_msgs.msg.Polygon() ROS_polygon.points = [] for point in polygon.get_points(): ROS_polygon.points += [geometry_msgs.msg.Point32(point[0], point[1], 0.)] return ROS_polygon def convert_ROS_polygon_to_polygon(ROS_polygon): polygon = label_object() for point in ROS_polygon.points: polygon.add_point((point.x,point.y)) return polygon
ajibawa-2023/Python-Code-Large/train/row_99730
52
111
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99730:ImportFrom_L30_C0", "label": "from laser_camera_segmentation.srv._Segmentation import *", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.2703, 0.009, 0, 0.66, 0.0, 322, 0, 1, 0, 0, 322, 0, 0], "semantic": {"name": "laser_camera_segmentation.srv._Segmentation", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from laser_camera_segmentation.srv._Segmentation import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Import_L31_C0", "label": "sensor_msgs import sensor_msgs", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.2793, 0.009, 0, 0.66, 0.0833, 61, 0, 1, 0, 0, 61, 0, 0], "semantic": {"name": "sensor_msgs", "arg_names": [], "import_names": ["sensor_msgs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sensor_msgs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Import_L33_C0", "label": "numpy import np", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.2973, 0.009, 0, 0.66, 0.1667, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Import_L35_C0", "label": "opencv import cv", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.3153, 0.009, 0, 0.66, 0.25, 437, 0, 1, 0, 0, 437, 0, 0], "semantic": {"name": "opencv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import opencv as cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Import_L36_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.3243, 0.009, 0, 0.66, 0.3333, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Import_L37_C0", "label": "opencv.highgui import highgui", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.009, 0, 0.66, 0.4167, 453, 0, 1, 0, 0, 453, 0, 0], "semantic": {"name": "opencv.highgui", "arg_names": [], "import_names": ["highgui"], "rhs_call_name": "", "annotation": ""}, "snippet": "import opencv.highgui as highgui"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:ImportFrom_L39_C0", "label": "from labeling.label_object import label_object", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.3514, 0.009, 0, 0.66, 0.5, 52, 0, 1, 0, 0, 52, 0, 0], "semantic": {"name": "labeling.label_object", "arg_names": [], "import_names": ["label_object"], "rhs_call_name": "", "annotation": ""}, "snippet": "from labeling.label_object import label_object"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "label": "convert_pointcloud_to_ROS", "type": "function", "loc": [41, 61], "level": 0, "parent": null, "vector": [2, 0, 0.4595, 0.1892, 0, 0.66, 0.5833, 783, 0, 3, 1, 0, 0, 0, 5], "semantic": {"name": "convert_pointcloud_to_ROS", "arg_names": ["pts3d", "intensities", "labels"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def convert_pointcloud_to_ROS(pts3d, intensities = None, labels = None):\n ROS_pointcloud = sensor_msgs.msg.PointCloud()\n ROS_pointcloud.points = []\n for point in np.asarray(pts3d.T):\n ROS_pointcloud.points += [geometry_msgs.msg.Point32(point[0],point[1],point[2])]\n \n intensity_channel = sensor_msgs.msg.ChannelFloat32()\n intensity_channel.name = 'intensities'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L42_C4", "label": "ROS_pointcloud = PointCloud()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "vector": [14, 1, 0.3784, 0.009, 1, 0.84, 0.0, 223, 3, 0, 0, 0, 428, 10, 1], "semantic": {"name": "ROS_pointcloud", "arg_names": [], "import_names": [], "rhs_call_name": "PointCloud", "annotation": ""}, "snippet": " ROS_pointcloud = sensor_msgs.msg.PointCloud()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L43_C4", "label": "ROS_pointcloud.points =", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "vector": [14, 1, 0.3874, 0.009, 1, 0.84, 0.1, 819, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ROS_pointcloud.points", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROS_pointcloud.points = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:For_L44_C4", "label": "for point", "type": "for", "loc": [44, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "vector": [6, 1, 0.4009, 0.018, 1, 0.84, 0.2, 16, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for point in np.asarray(pts3d.T):\n ROS_pointcloud.points += [geometry_msgs.msg.Point32(point[0],point[1],point[2])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L47_C4", "label": "intensity_channel = ChannelFloat32()", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "vector": [14, 1, 0.4234, 0.009, 1, 0.84, 0.3, 665, 3, 0, 0, 0, 678, 10, 1], "semantic": {"name": "intensity_channel", "arg_names": [], "import_names": [], "rhs_call_name": "ChannelFloat32", "annotation": ""}, "snippet": " intensity_channel = sensor_msgs.msg.ChannelFloat32()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L48_C4", "label": "intensity_channel.name =", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "vector": [14, 1, 0.4324, 0.009, 1, 0.84, 0.4, 196, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "intensity_channel.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " intensity_channel.name = 'intensities'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:If_L49_C4", "label": "if", "type": "if", "loc": [49, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "vector": [4, 1, 0.4505, 0.027, 1, 0.84, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if intensities != None:\n for value in intensities:\n intensity_channel.values += [value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:For_L50_C8", "label": "for value", "type": "for", "loc": [50, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:If_L49_C4", "vector": [6, 2, 0.455, 0.018, 2, 0.13, 0.0, 441, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for value in intensities:\n intensity_channel.values += [value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L53_C4", "label": "label_channel = ChannelFloat32()", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "vector": [14, 1, 0.4775, 0.009, 1, 0.84, 0.6, 56, 3, 0, 0, 0, 678, 10, 1], "semantic": {"name": "label_channel", "arg_names": [], "import_names": [], "rhs_call_name": "ChannelFloat32", "annotation": ""}, "snippet": " label_channel = sensor_msgs.msg.ChannelFloat32() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L54_C4", "label": "label_channel.name =", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "vector": [14, 1, 0.4865, 0.009, 1, 0.84, 0.7, 891, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "label_channel.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label_channel.name = 'labels' "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:If_L55_C4", "label": "if", "type": "if", "loc": [55, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "vector": [4, 1, 0.5045, 0.027, 1, 0.84, 0.8, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if labels != None:\n for value in labels:\n label_channel.values += [value] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:For_L56_C8", "label": "for value", "type": "for", "loc": [56, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:If_L55_C4", "vector": [6, 2, 0.509, 0.018, 2, 0.22, 0.0, 441, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for value in labels:\n label_channel.values += [value] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L60_C4", "label": "ROS_pointcloud.channels =", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "vector": [14, 1, 0.5405, 0.009, 1, 0.84, 0.9, 870, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ROS_pointcloud.channels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROS_pointcloud.channels = [intensity_channel, label_channel]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Return_L61_C4", "label": "return", "type": "return", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "vector": [13, 1, 0.5495, 0.009, 1, 0.84, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ROS_pointcloud"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L63_C0", "label": "convert_ROS_pointcloud_to_pointcloud", "type": "function", "loc": [63, 80], "level": 0, "parent": null, "vector": [2, 0, 0.6441, 0.1622, 0, 0.66, 0.6667, 227, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "convert_ROS_pointcloud_to_pointcloud", "arg_names": ["ROS_pointcloud"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def convert_ROS_pointcloud_to_pointcloud(ROS_pointcloud):\n intensities = []\n labels = []\n pts3d = []\n for point in ROS_pointcloud.points:\n pts3d += [[point.x, point.y, point.z]]\n pts3d = np.array(pts3d).T\n #print pts3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L64_C4", "label": "intensities =", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L63_C0", "vector": [14, 1, 0.5766, 0.009, 1, 0.42, 0.0, 725, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "intensities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " intensities = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L65_C4", "label": "labels =", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L63_C0", "vector": [14, 1, 0.5856, 0.009, 1, 0.42, 0.1111, 283, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "labels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labels = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L66_C4", "label": "pts3d =", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L63_C0", "vector": [14, 1, 0.5946, 0.009, 1, 0.42, 0.2222, 646, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pts3d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts3d = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:For_L67_C4", "label": "for point", "type": "for", "loc": [67, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L63_C0", "vector": [6, 1, 0.6081, 0.018, 1, 0.42, 0.3333, 16, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for point in ROS_pointcloud.points:\n pts3d += [[point.x, point.y, point.z]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L69_C4", "label": "pts3d =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L63_C0", "vector": [14, 1, 0.6216, 0.009, 1, 0.42, 0.4444, 646, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts3d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts3d = np.array(pts3d).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:For_L72_C4", "label": "for value", "type": "for", "loc": [72, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L63_C0", "vector": [6, 1, 0.6532, 0.018, 1, 0.42, 0.5556, 441, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for value in ROS_pointcloud.channels[0].values:\n intensities += [value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L74_C4", "label": "intensities = array()", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L63_C0", "vector": [14, 1, 0.6667, 0.009, 1, 0.42, 0.6667, 725, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "intensities", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " intensities = np.array(intensities) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:For_L76_C4", "label": "for value", "type": "for", "loc": [76, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L63_C0", "vector": [6, 1, 0.6892, 0.018, 1, 0.42, 0.7778, 441, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for value in ROS_pointcloud.channels[1].values:\n labels += [value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L78_C4", "label": "labels = array()", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L63_C0", "vector": [14, 1, 0.7027, 0.009, 1, 0.42, 0.8889, 283, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "labels", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " labels = np.array(labels) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Return_L80_C4", "label": "return", "type": "return", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L63_C0", "vector": [13, 1, 0.7207, 0.009, 1, 0.42, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pts3d, intensities, labels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L83_C0", "label": "convert_cvimage_to_ROS", "type": "function", "loc": [83, 88], "level": 0, "parent": null, "vector": [2, 0, 0.7703, 0.0541, 0, 0.66, 0.75, 573, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "convert_cvimage_to_ROS", "arg_names": ["image"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def convert_cvimage_to_ROS(image):\n imgTmp = cv.cvCloneImage(image)\n imNP = ut.cv2np(imgTmp,format='BGR')\n ROS_image = np.reshape(imNP,(1,-1))[0]\n\n return ROS_image"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L84_C4", "label": "imgTmp = cvCloneImage()", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L83_C0", "vector": [14, 1, 0.7568, 0.009, 1, 0.04, 0.0, 110, 3, 1, 0, 0, 483, 10, 1], "semantic": {"name": "imgTmp", "arg_names": [], "import_names": [], "rhs_call_name": "cvCloneImage", "annotation": ""}, "snippet": " imgTmp = cv.cvCloneImage(image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L85_C4", "label": "imNP = cv2np()", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L83_C0", "vector": [14, 1, 0.7658, 0.009, 1, 0.04, 0.3333, 217, 3, 2, 0, 0, 366, 10, 1], "semantic": {"name": "imNP", "arg_names": [], "import_names": [], "rhs_call_name": "cv2np", "annotation": ""}, "snippet": " imNP = ut.cv2np(imgTmp,format='BGR')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L86_C4", "label": "ROS_image =", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L83_C0", "vector": [14, 1, 0.7748, 0.009, 1, 0.04, 0.6667, 255, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ROS_image", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROS_image = np.reshape(imNP,(1,-1))[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Return_L88_C4", "label": "return", "type": "return", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L83_C0", "vector": [13, 1, 0.7928, 0.009, 1, 0.04, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ROS_image"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L90_C0", "label": "convert_ROS_image_to_cvimage", "type": "function", "loc": [90, 95], "level": 0, "parent": null, "vector": [2, 0, 0.8333, 0.0541, 0, 0.66, 0.8333, 988, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "convert_ROS_image_to_cvimage", "arg_names": ["ROS_image", "width", "height"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def convert_ROS_image_to_cvimage(ROS_image, width, height):\n ROS_image = np.array(ROS_image, dtype='uint8')\n imNP = np.reshape(ROS_image,(height,width, 3))\n cvimage = ut.np2cv(imNP)\n\n return cvimage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L91_C4", "label": "ROS_image = array()", "type": "assigned_variable", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L90_C0", "vector": [14, 1, 0.8198, 0.009, 1, 0.54, 0.0, 255, 3, 2, 0, 0, 80, 10, 1], "semantic": {"name": "ROS_image", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " ROS_image = np.array(ROS_image, dtype='uint8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L92_C4", "label": "imNP = reshape()", "type": "assigned_variable", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L90_C0", "vector": [14, 1, 0.8288, 0.009, 1, 0.54, 0.3333, 217, 3, 2, 0, 0, 276, 10, 1], "semantic": {"name": "imNP", "arg_names": [], "import_names": [], "rhs_call_name": "reshape", "annotation": ""}, "snippet": " imNP = np.reshape(ROS_image,(height,width, 3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L93_C4", "label": "cvimage = np2cv()", "type": "assigned_variable", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L90_C0", "vector": [14, 1, 0.8378, 0.009, 1, 0.54, 0.6667, 103, 3, 1, 0, 0, 672, 10, 1], "semantic": {"name": "cvimage", "arg_names": [], "import_names": [], "rhs_call_name": "np2cv", "annotation": ""}, "snippet": " cvimage = ut.np2cv(imNP)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Return_L95_C4", "label": "return", "type": "return", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L90_C0", "vector": [13, 1, 0.8559, 0.009, 1, 0.54, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cvimage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L99_C0", "label": "convert_polygon_to_ROS", "type": "function", "loc": [99, 104], "level": 0, "parent": null, "vector": [2, 0, 0.9144, 0.0541, 0, 0.66, 0.9167, 23, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "convert_polygon_to_ROS", "arg_names": ["polygon"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def convert_polygon_to_ROS(polygon):\n ROS_polygon = geometry_msgs.msg.Polygon()\n ROS_polygon.points = []\n for point in polygon.get_points():\n ROS_polygon.points += [geometry_msgs.msg.Point32(point[0], point[1], 0.)]\n return ROS_polygon"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L100_C4", "label": "ROS_polygon = Polygon()", "type": "assigned_variable", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L99_C0", "vector": [14, 1, 0.9009, 0.009, 1, 0.73, 0.0, 127, 3, 0, 0, 0, 818, 10, 1], "semantic": {"name": "ROS_polygon", "arg_names": [], "import_names": [], "rhs_call_name": "Polygon", "annotation": ""}, "snippet": " ROS_polygon = geometry_msgs.msg.Polygon()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L101_C4", "label": "ROS_polygon.points =", "type": "assigned_variable", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L99_C0", "vector": [14, 1, 0.9099, 0.009, 1, 0.73, 0.3333, 328, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ROS_polygon.points", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROS_polygon.points = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:For_L102_C4", "label": "for point", "type": "for", "loc": [102, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L99_C0", "vector": [6, 1, 0.9234, 0.018, 1, 0.73, 0.6667, 16, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for point in polygon.get_points():\n ROS_polygon.points += [geometry_msgs.msg.Point32(point[0], point[1], 0.)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Return_L104_C4", "label": "return", "type": "return", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L99_C0", "vector": [13, 1, 0.9369, 0.009, 1, 0.73, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ROS_polygon"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L107_C0", "label": "convert_ROS_polygon_to_polygon", "type": "function", "loc": [107, 111], "level": 0, "parent": null, "vector": [2, 0, 0.982, 0.045, 0, 0.66, 1.0, 250, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "convert_ROS_polygon_to_polygon", "arg_names": ["ROS_polygon"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def convert_ROS_polygon_to_polygon(ROS_polygon):\n polygon = label_object() \n for point in ROS_polygon.points:\n polygon.add_point((point.x,point.y))\n return polygon"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L108_C4", "label": "polygon = label_object()", "type": "assigned_variable", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L107_C0", "vector": [14, 1, 0.973, 0.009, 1, 0.83, 0.0, 854, 3, 0, 0, 0, 589, 10, 1], "semantic": {"name": "polygon", "arg_names": [], "import_names": [], "rhs_call_name": "label_object", "annotation": ""}, "snippet": " polygon = label_object() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:For_L109_C4", "label": "for point", "type": "for", "loc": [109, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L107_C0", "vector": [6, 1, 0.9865, 0.018, 1, 0.83, 0.5, 16, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for point in ROS_polygon.points:\n polygon.add_point((point.x,point.y))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Expr_L110_C8", "label": "add_point()", "type": "expression", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:For_L109_C4", "vector": [8, 2, 0.991, 0.009, 2, 0.97, 0.0, 692, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_point", "arg_names": [], "import_names": [], "rhs_call_name": "add_point", "annotation": ""}, "snippet": " polygon.add_point((point.x,point.y))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99730:Return_L111_C4", "label": "return", "type": "return", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L107_C0", "vector": [13, 1, 1.0, 0.009, 1, 0.83, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return polygon"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:For_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:If_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:For_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:If_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:For_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Return_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:For_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:For_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:For_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Return_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Return_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Return_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:For_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Return_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:For_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:For_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Expr_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99730:FunctionDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99730:Return_L111_C4"}]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) from hrl_lib.util import getTime import processor class classifier(object): ''' classdocs ''' processor = None features = 'all' def __init__(self, processor, features): ''' Constructor ''' self.processor = processor self.features = features def train(self): return None #abstract def test(self, feature_data = None): return None #dict are the loaded features including the ground truth, labels the algorithm output def test_results(self, dict, labels): current_set_size = dict['set_size'] count_correct = 0 count_clutter_correct = 0 count_surface_correct = 0 count_clutter = 0 count_surface = 0 count = 0 for index in dict['point_indices']: label = labels[index] if label == dict['labels'][count]: count_correct += 1 if dict['labels'][count] == processor.LABEL_CLUTTER: count_clutter += 1 if label == dict['labels'][count]: count_clutter_correct += 1 if dict['labels'][count] == processor.LABEL_SURFACE: count_surface += 1 if label == dict['labels'][count]: count_surface_correct += 1 count += 1 print getTime(), '##########################################' print getTime(), '####tested on ', self.features, '###########################' print getTime(), '===================================' print getTime(), 'percent in total: surface:',(float(count_surface)/float(current_set_size)*100), '%, clutter:',(float(count_clutter)/float(current_set_size)*100),'%' print getTime(), '#points surface:',count_surface,'clutter:',count_clutter print getTime(), '#points correct: surface:',count_surface_correct,'clutter:',count_clutter_correct if count_surface > 0: percent_surface_correct = float(count_surface_correct)/float(count_surface) * 100 else: percent_surface_correct = 100 if count_clutter > 0: percent_clutter_correct = float(count_clutter_correct)/float(count_clutter) * 100 else: percent_clutter_correct = 100 print getTime(), '#percent correct: surface:',percent_surface_correct,'clutter:',percent_clutter_correct print getTime(), '===================================' print getTime(), '##########################################' testresults = (count_surface, count_clutter,count_surface_correct, count_clutter_correct, percent_surface_correct, percent_clutter_correct) return testresults def get_filename(self): return self.processor.config.path+'/classifier_'+self.features+'_'+self.processor.feature_type+'_k'+str(self.processor.feature_neighborhood)+'_r'+str(self.processor.feature_radius)+'.XML' def save(self): return None def load(self): return None
ajibawa-2023/Python-Code-Large/train/row_99731
52
117
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99731:ImportFrom_L31_C0", "label": "from hrl_lib.util import getTime", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.265, 0.0085, 0, 0.66, 0.0, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["getTime"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_lib.util import getTime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Import_L33_C0", "label": "processor import processor", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.2821, 0.0085, 0, 0.66, 0.5, 177, 0, 1, 0, 0, 177, 0, 0], "semantic": {"name": "processor", "arg_names": [], "import_names": ["processor"], "rhs_call_name": "", "annotation": ""}, "snippet": "import processor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:ClassDef_L35_C0", "label": "classifier", "type": "class", "loc": [35, 115], "level": 0, "parent": null, "vector": [3, 0, 0.641, 0.6923, 0, 0.66, 1.0, 71, 0, 7, 0, 0, 186, 0, 28], "semantic": {"name": "classifier", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class classifier(object):\n '''\n classdocs\n '''\n\n processor = None\n features = 'all'\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L36_C4", "label": "expression", "type": "expression", "loc": [36, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:ClassDef_L35_C0", "vector": [8, 1, 0.3162, 0.0256, 1, 0.37, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n classdocs\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L40_C4", "label": "processor =", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:ClassDef_L35_C0", "vector": [14, 1, 0.3419, 0.0085, 1, 0.37, 0.1111, 177, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "processor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " processor = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L41_C4", "label": "features =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:ClassDef_L35_C0", "vector": [14, 1, 0.3504, 0.0085, 1, 0.37, 0.2222, 479, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "features", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " features = 'all'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L43_C4", "label": "__init__", "type": "function", "loc": [43, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:ClassDef_L35_C0", "vector": [2, 1, 0.3889, 0.0513, 1, 0.37, 0.3333, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "processor", "features"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, processor, features):\n '''\n Constructor\n '''\n self.processor = processor\n self.features = features"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L44_C8", "label": "expression", "type": "expression", "loc": [44, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L43_C4", "vector": [8, 2, 0.3846, 0.0256, 2, 0.91, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n Constructor\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L47_C8", "label": "self.processor =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L43_C4", "vector": [14, 2, 0.4017, 0.0085, 2, 0.91, 0.5, 855, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.processor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.processor = processor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L48_C8", "label": "self.features =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L43_C4", "vector": [14, 2, 0.4103, 0.0085, 2, 0.91, 1.0, 164, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.features", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.features = features"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L51_C4", "label": "train", "type": "function", "loc": [51, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:ClassDef_L35_C0", "vector": [2, 1, 0.4402, 0.0171, 1, 0.37, 0.4444, 371, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "train", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def train(self):\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Return_L52_C8", "label": "return", "type": "return", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L51_C4", "vector": [13, 2, 0.4444, 0.0085, 2, 0.28, 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_99731:FunctionDef_L55_C4", "label": "test", "type": "function", "loc": [55, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:ClassDef_L35_C0", "vector": [2, 1, 0.4744, 0.0171, 1, 0.37, 0.5556, 224, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "test", "arg_names": ["self", "feature_data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def test(self, feature_data = None):\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Return_L56_C8", "label": "return", "type": "return", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L55_C4", "vector": [13, 2, 0.4786, 0.0085, 2, 0.89, 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_99731:FunctionDef_L59_C4", "label": "test_results", "type": "function", "loc": [59, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:ClassDef_L35_C0", "vector": [2, 1, 0.6923, 0.3846, 1, 0.37, 0.6667, 372, 0, 3, 1, 0, 0, 0, 26], "semantic": {"name": "test_results", "arg_names": ["self", "dict", "labels"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def test_results(self, dict, labels):\n current_set_size = dict['set_size']\n count_correct = 0\n count_clutter_correct = 0\n count_surface_correct = 0\n count_clutter = 0\n count_surface = 0\n count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L60_C8", "label": "current_set_size =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "vector": [14, 2, 0.5128, 0.0085, 2, 0.29, 0.0, 575, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "current_set_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " current_set_size = dict['set_size']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L61_C8", "label": "count_correct =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "vector": [14, 2, 0.5214, 0.0085, 2, 0.29, 0.05, 315, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "count_correct", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count_correct = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L62_C8", "label": "count_clutter_correct =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "vector": [14, 2, 0.5299, 0.0085, 2, 0.29, 0.1, 395, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "count_clutter_correct", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count_clutter_correct = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L63_C8", "label": "count_surface_correct =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "vector": [14, 2, 0.5385, 0.0085, 2, 0.29, 0.15, 545, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "count_surface_correct", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count_surface_correct = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L64_C8", "label": "count_clutter =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "vector": [14, 2, 0.547, 0.0085, 2, 0.29, 0.2, 381, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "count_clutter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count_clutter = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L65_C8", "label": "count_surface =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "vector": [14, 2, 0.5556, 0.0085, 2, 0.29, 0.25, 765, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "count_surface", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count_surface = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L66_C8", "label": "count =", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "vector": [14, 2, 0.5641, 0.0085, 2, 0.29, 0.3, 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_99731:For_L67_C8", "label": "for index", "type": "for", "loc": [67, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "vector": [6, 2, 0.6368, 0.1368, 2, 0.29, 0.35, 780, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index in dict['point_indices']:\n label = labels[index]\n \n if label == dict['labels'][count]:\n count_correct += 1\n \n if dict['labels'][count] == processor.LABEL_CLUTTER:\n count_clutter += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L68_C12", "label": "label =", "type": "assigned_variable", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:For_L67_C8", "vector": [14, 3, 0.5812, 0.0085, 3, 0.66, 0.0, 811, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label = labels[index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L70_C12", "label": "if", "type": "if", "loc": [70, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:For_L67_C8", "vector": [4, 3, 0.6026, 0.0171, 3, 0.66, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if label == dict['labels'][count]:\n count_correct += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L73_C12", "label": "if", "type": "if", "loc": [73, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:For_L67_C8", "vector": [4, 3, 0.6368, 0.0342, 3, 0.66, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dict['labels'][count] == processor.LABEL_CLUTTER:\n count_clutter += 1\n if label == dict['labels'][count]:\n count_clutter_correct += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L75_C16", "label": "if", "type": "if", "loc": [75, 76], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L73_C12", "vector": [4, 4, 0.6453, 0.0171, 4, 0.72, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if label == dict['labels'][count]:\n count_clutter_correct += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L77_C12", "label": "if", "type": "if", "loc": [77, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:For_L67_C8", "vector": [4, 3, 0.6709, 0.0342, 3, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dict['labels'][count] == processor.LABEL_SURFACE:\n count_surface += 1\n if label == dict['labels'][count]:\n count_surface_correct += 1 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L79_C16", "label": "if", "type": "if", "loc": [79, 80], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L77_C12", "vector": [4, 4, 0.6795, 0.0171, 4, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if label == dict['labels'][count]:\n count_surface_correct += 1 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L84_C8", "label": "print()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "vector": [8, 2, 0.7179, 0.0085, 2, 0.29, 0.4, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), '##########################################')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L85_C8", "label": "print()", "type": "expression", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "vector": [8, 2, 0.7265, 0.0085, 2, 0.29, 0.45, 535, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), '####tested on ', self.features, '###########################')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L86_C8", "label": "print()", "type": "expression", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "vector": [8, 2, 0.735, 0.0085, 2, 0.29, 0.5, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), '===================================')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L87_C8", "label": "print()", "type": "expression", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "vector": [8, 2, 0.7436, 0.0085, 2, 0.29, 0.55, 535, 3, 6, 0, 0, 0, 0, 6], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), 'percent in total: surface:',(float(count_surface)/float(current_set_size)*100), '%, clutter:',(float(count_clutter)/float(current_set_size)*100),'%')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L88_C8", "label": "print()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "vector": [8, 2, 0.7521, 0.0085, 2, 0.29, 0.6, 535, 3, 5, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), '#points surface:',count_surface,'clutter:',count_clutter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L89_C8", "label": "print()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "vector": [8, 2, 0.7607, 0.0085, 2, 0.29, 0.65, 535, 3, 5, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), '#points correct: surface:',count_surface_correct,'clutter:',count_clutter_correct)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L90_C8", "label": "if", "type": "if", "loc": [90, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "vector": [4, 2, 0.7821, 0.0342, 2, 0.29, 0.7, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if count_surface > 0:\n percent_surface_correct = float(count_surface_correct)/float(count_surface) * 100\n else:\n percent_surface_correct = 100"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L91_C12", "label": "percent_surface_correct =", "type": "assigned_variable", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L90_C8", "vector": [14, 3, 0.7778, 0.0085, 3, 0.75, 0.0, 486, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "percent_surface_correct", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " percent_surface_correct = float(count_surface_correct)/float(count_surface) * 100"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L93_C12", "label": "percent_surface_correct =", "type": "assigned_variable", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L90_C8", "vector": [14, 3, 0.7949, 0.0085, 3, 0.75, 1.0, 486, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "percent_surface_correct", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " percent_surface_correct = 100"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L94_C8", "label": "if", "type": "if", "loc": [94, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "vector": [4, 2, 0.8162, 0.0342, 2, 0.29, 0.75, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if count_clutter > 0:\n percent_clutter_correct = float(count_clutter_correct)/float(count_clutter) * 100\n else:\n percent_clutter_correct = 100"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L95_C12", "label": "percent_clutter_correct =", "type": "assigned_variable", "loc": [95, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L94_C8", "vector": [14, 3, 0.812, 0.0085, 3, 0.12, 0.0, 363, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "percent_clutter_correct", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " percent_clutter_correct = float(count_clutter_correct)/float(count_clutter) * 100"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L97_C12", "label": "percent_clutter_correct =", "type": "assigned_variable", "loc": [97, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L94_C8", "vector": [14, 3, 0.8291, 0.0085, 3, 0.12, 1.0, 363, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "percent_clutter_correct", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " percent_clutter_correct = 100"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L98_C8", "label": "print()", "type": "expression", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "vector": [8, 2, 0.8376, 0.0085, 2, 0.29, 0.8, 535, 3, 5, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), '#percent correct: surface:',percent_surface_correct,'clutter:',percent_clutter_correct)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L99_C8", "label": "print()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "vector": [8, 2, 0.8462, 0.0085, 2, 0.29, 0.85, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), '===================================')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L100_C8", "label": "print()", "type": "expression", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "vector": [8, 2, 0.8547, 0.0085, 2, 0.29, 0.9, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), '##########################################')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L101_C8", "label": "testresults =", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "vector": [14, 2, 0.8632, 0.0085, 2, 0.29, 0.95, 933, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "testresults", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " testresults = (count_surface, count_clutter,count_surface_correct, count_clutter_correct, percent_surface_correct, percent_clutter_correct)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Return_L103_C8", "label": "return", "type": "return", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "vector": [13, 2, 0.8803, 0.0085, 2, 0.29, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return testresults "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L107_C4", "label": "get_filename", "type": "function", "loc": [107, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:ClassDef_L35_C0", "vector": [2, 1, 0.9188, 0.0171, 1, 0.37, 0.7778, 676, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "get_filename", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_filename(self):\n return self.processor.config.path+'/classifier_'+self.features+'_'+self.processor.feature_type+'_k'+str(self.processor.feature_neighborhood)+'_r'+str(self.processor.feature_radius)+'.XML'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Return_L108_C8", "label": "return", "type": "return", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L107_C4", "vector": [13, 2, 0.9231, 0.0085, 2, 0.41, 0.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.processor.config.path+'/classifier_'+self.features+'_'+self.processor.feature_type+'_k'+str(self.processor.feature_neighborhood)+'_r'+str(self.processor.feature_radius)+'.XML'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L110_C4", "label": "save", "type": "function", "loc": [110, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:ClassDef_L35_C0", "vector": [2, 1, 0.9444, 0.0171, 1, 0.37, 0.8889, 928, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "save", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def save(self):\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Return_L111_C8", "label": "return", "type": "return", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L110_C4", "vector": [13, 2, 0.9487, 0.0085, 2, 0.6, 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_99731:FunctionDef_L114_C4", "label": "load", "type": "function", "loc": [114, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:ClassDef_L35_C0", "vector": [2, 1, 0.9786, 0.0171, 1, 0.37, 1.0, 37, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "load", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def load(self):\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99731:Return_L115_C8", "label": "return", "type": "return", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L114_C4", "vector": [13, 2, 0.9829, 0.0085, 2, 0.01, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99731:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Return_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Return_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:For_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:For_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:For_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L70_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:For_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L75_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:For_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L77_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L77_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L79_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:If_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Expr_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Return_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Return_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Return_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99731:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99731:Return_L115_C8"}]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Hai Nguyen (Healthcare Robotics Lab, Georgia Tech.) import hrl_lib.util as ut import numpy as np import opencv as cv import opencv.highgui as hg ## # calculates eigen values of covariance matrix accumulating statistics of sobel filter responses in an image block # # @param cv_image opencv image to calculate texture over # @param blocksize size of block to accumulate statistics (in pixels) # @param filtersize size of sobel filter to use (in pixels) # @return numpy matrix of size (width, height, 2) where [:,:,0] is the set of first eigen values and [:,:,1] is the second set def eigen_texture(cv_image, blocksize=8, filtersize=3): gray_image = cv.cvCreateImage(cv.cvSize(cv_image.width, cv_image.height), cv.IPL_DEPTH_8U, 1) eig_tex = cv.cvCreateImage(cv.cvSize(cv_image.width*6, cv_image.height), cv.IPL_DEPTH_32F, 1) cv.cvCvtColor(cv_image, gray_image, cv.CV_BGR2GRAY) cv.cvCornerEigenValsAndVecs(gray_image, eig_tex, blocksize, filtersize) eig_tex_np = ut.cv2np(eig_tex) eig_tex_np = np.reshape(eig_tex_np, [cv_image.height, cv_image.width, 6]) return eig_tex_np[:,:,0:2] def visualize(eigens): l1 = eigens[:,:,0] l2 = eigens[:,:,1] m1 = np.min(l1) m2 = np.min(l2) r1 = np.max(l1) - m1 r2 = np.max(l2) - m2 if r1 == 0: r1 = 1 if r2 == 0: r2 = 1 l1cv = ut.np2cv(np.array( (1 - ((l1-m1) / r1)) * 255, dtype='uint8')) l2cv = ut.np2cv(np.array( (1 - ((l2-m2) / r2)) * 255, dtype='uint8')) hg.cvNamedWindow('eigen value 1', 1) hg.cvNamedWindow('eigen value 2', 1) hg.cvShowImage('eigen value 1', l1cv) hg.cvShowImage('eigen value 2', l2cv) while True: k = hg.cvWaitKey(33) if k == ' ': return if k == 'x': exit() if __name__ == '__main__': #import pdb #hg.cvNamedWindow('win', 1) im = hg.cvLoadImage('/home/haidai/svn/robot1/src/projects/08_03_dog_commands/dragonfly_color_calibration/untitled folder/camera_image.png') #hg.cvShowImage('win', im) for i in range(40): s = (i+1) * 2 print s eig_tex_np = eigen_texture(im, blocksize=s, filtersize=3) visualize(eig_tex_np) # pdb.set_trace() # def texture_features(self, block_size=5, filter_size=3): # """ # Calculates the texture features associated with the image. # block_size gives the size of the texture neighborhood to be processed # filter_size gives the size of the Sobel operator used to find gradient information # """ # #block_size = cv.cvSize(block_size, block_size) # # #convert to grayscale float # channels = 1 # self.gray_image = cv.cvCreateImage(cv.cvSize(self.im_width, self.im_height), # cv.IPL_DEPTH_8U, #cv.IPL_DEPTH_16U, #cv.IPL_DEPTH_32F, # channels) # # # #cv.CV_32FC1, #cv.IPL_DEPTH_32F, #cv.IPL_DEPTH_8U, #cv.IPL_DEPTH_16U, # channels = 1 # eig_tex = cv.cvCreateImage(cv.cvSize(self.im_width*6, self.im_height), # cv.IPL_DEPTH_32F, # channels) # # # cv.cvCvtColor(self.image, self.gray_image, cv.CV_BGR2GRAY); # # #cv.cvAdd(const CvArr* src1, const CvArr* src2, CvArr* dst, const CvArr* mask=NULL ); # # #highgui.cvConvertImage(self.image, self.gray_image) # # cv.cvCornerEigenValsAndVecs(self.gray_image, eig_tex,#CvArr* eigenvv, # block_size, filter_size) # # eig_tex = ut.cv2np(eig_tex) # eig_tex = np.reshape(eig_tex, [self.im_height, self.im_width, 6]) # #print eig_tex.shape ## [480,640,3] # ## (l1, l2, x1, y1, x2, y2), where # ## l1, l2 - eigenvalues of M; not sorted # ## (x1, y1) - eigenvector corresponding to l1 # ## (x2, y2) - eigenvector corresponding to l2 # tex_feat = np.zeros([3, self.im_height * self.im_width], dtype=np.float32) # tmp = np.reshape(eig_tex, [self.im_height * self.im_width, 6]).T # s = tmp[0] > tmp[1] # tex_feat[1:3, s] = tmp[0, s] * tmp[2:4, s] # tex_feat[0, s] = tmp[1, s] # tex_feat[1:3, -s] = tmp[1, -s] * tmp[4:6, -s] # tex_feat[0, -s] = tmp[0, -s] # # self.tex_feat = tex_feat.T # self.tex_image = np.reshape(self.tex_feat, [self.im_height, self.im_width, 3])
ajibawa-2023/Python-Code-Large/train/row_99732
42
157
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Import_L31_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.1975, 0.0064, 0, 0.66, 0.0, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Import_L32_C0", "label": "numpy import np", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.2038, 0.0064, 0, 0.66, 0.1667, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Import_L33_C0", "label": "opencv import cv", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.2102, 0.0064, 0, 0.66, 0.3333, 437, 0, 1, 0, 0, 437, 0, 0], "semantic": {"name": "opencv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import opencv as cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Import_L34_C0", "label": "opencv.highgui import hg", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.2166, 0.0064, 0, 0.66, 0.5, 453, 0, 1, 0, 0, 453, 0, 0], "semantic": {"name": "opencv.highgui", "arg_names": [], "import_names": ["hg"], "rhs_call_name": "", "annotation": ""}, "snippet": "import opencv.highgui as hg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L43_C0", "label": "eigen_texture", "type": "function", "loc": [43, 52], "level": 0, "parent": null, "vector": [2, 0, 0.3025, 0.0637, 0, 0.66, 0.6667, 5, 0, 3, 1, 0, 0, 0, 8], "semantic": {"name": "eigen_texture", "arg_names": ["cv_image", "blocksize", "filtersize"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def eigen_texture(cv_image, blocksize=8, filtersize=3):\n gray_image = cv.cvCreateImage(cv.cvSize(cv_image.width, cv_image.height), cv.IPL_DEPTH_8U, 1)\n eig_tex = cv.cvCreateImage(cv.cvSize(cv_image.width*6, cv_image.height), cv.IPL_DEPTH_32F, 1)\n \n cv.cvCvtColor(cv_image, gray_image, cv.CV_BGR2GRAY) \n cv.cvCornerEigenValsAndVecs(gray_image, eig_tex, blocksize, filtersize)\n eig_tex_np = ut.cv2np(eig_tex)\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L44_C4", "label": "gray_image = cvCreateImage()", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L43_C0", "vector": [14, 1, 0.2803, 0.0064, 1, 0.26, 0.0, 749, 3, 3, 0, 0, 953, 10, 2], "semantic": {"name": "gray_image", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateImage", "annotation": ""}, "snippet": " gray_image = cv.cvCreateImage(cv.cvSize(cv_image.width, cv_image.height), cv.IPL_DEPTH_8U, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L45_C4", "label": "eig_tex = cvCreateImage()", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L43_C0", "vector": [14, 1, 0.2866, 0.0064, 1, 0.26, 0.1667, 776, 3, 3, 0, 0, 953, 10, 2], "semantic": {"name": "eig_tex", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateImage", "annotation": ""}, "snippet": " eig_tex = cv.cvCreateImage(cv.cvSize(cv_image.width*6, cv_image.height), cv.IPL_DEPTH_32F, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Expr_L47_C4", "label": "cvCvtColor()", "type": "expression", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L43_C0", "vector": [8, 1, 0.2994, 0.0064, 1, 0.26, 0.3333, 709, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "cvCvtColor", "arg_names": [], "import_names": [], "rhs_call_name": "cvCvtColor", "annotation": ""}, "snippet": " cv.cvCvtColor(cv_image, gray_image, cv.CV_BGR2GRAY) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Expr_L48_C4", "label": "cvCornerEigenValsAndVecs()", "type": "expression", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L43_C0", "vector": [8, 1, 0.3057, 0.0064, 1, 0.26, 0.5, 250, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "cvCornerEigenValsAndVecs", "arg_names": [], "import_names": [], "rhs_call_name": "cvCornerEigenValsAndVecs", "annotation": ""}, "snippet": " cv.cvCornerEigenValsAndVecs(gray_image, eig_tex, blocksize, filtersize)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L49_C4", "label": "eig_tex_np = cv2np()", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L43_C0", "vector": [14, 1, 0.3121, 0.0064, 1, 0.26, 0.6667, 320, 3, 1, 0, 0, 366, 10, 1], "semantic": {"name": "eig_tex_np", "arg_names": [], "import_names": [], "rhs_call_name": "cv2np", "annotation": ""}, "snippet": " eig_tex_np = ut.cv2np(eig_tex)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L51_C4", "label": "eig_tex_np = reshape()", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L43_C0", "vector": [14, 1, 0.3248, 0.0064, 1, 0.26, 0.8333, 320, 3, 2, 0, 0, 276, 10, 1], "semantic": {"name": "eig_tex_np", "arg_names": [], "import_names": [], "rhs_call_name": "reshape", "annotation": ""}, "snippet": " eig_tex_np = np.reshape(eig_tex_np, [cv_image.height, cv_image.width, 6]) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Return_L52_C4", "label": "return", "type": "return", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L43_C0", "vector": [13, 1, 0.3312, 0.0064, 1, 0.26, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return eig_tex_np[:,:,0:2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "label": "visualize", "type": "function", "loc": [54, 76], "level": 0, "parent": null, "vector": [2, 0, 0.414, 0.1465, 0, 0.66, 0.8333, 705, 0, 1, 0, 0, 0, 0, 14], "semantic": {"name": "visualize", "arg_names": ["eigens"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def visualize(eigens):\n l1 = eigens[:,:,0]\n l2 = eigens[:,:,1] \n m1 = np.min(l1)\n m2 = np.min(l2)\n r1 = np.max(l1) - m1 \n r2 = np.max(l2) - m2\n if r1 == 0:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L55_C4", "label": "l1 =", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "vector": [14, 1, 0.3503, 0.0064, 1, 0.7, 0.0, 888, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "l1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l1 = eigens[:,:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L56_C4", "label": "l2 =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "vector": [14, 1, 0.3567, 0.0064, 1, 0.7, 0.0714, 40, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "l2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l2 = eigens[:,:,1] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L57_C4", "label": "m1 = min()", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "vector": [14, 1, 0.3631, 0.0064, 1, 0.7, 0.1429, 814, 3, 1, 0, 0, 867, 10, 1], "semantic": {"name": "m1", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " m1 = np.min(l1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L58_C4", "label": "m2 = min()", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "vector": [14, 1, 0.3694, 0.0064, 1, 0.7, 0.2143, 562, 3, 1, 0, 0, 867, 10, 1], "semantic": {"name": "m2", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " m2 = np.min(l2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L59_C4", "label": "r1 =", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "vector": [14, 1, 0.3758, 0.0064, 1, 0.7, 0.2857, 648, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "r1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r1 = np.max(l1) - m1 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L60_C4", "label": "r2 =", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "vector": [14, 1, 0.3822, 0.0064, 1, 0.7, 0.3571, 959, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "r2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r2 = np.max(l2) - m2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:If_L61_C4", "label": "if", "type": "if", "loc": [61, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "vector": [4, 1, 0.3917, 0.0127, 1, 0.7, 0.4286, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if r1 == 0:\n r1 = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L62_C8", "label": "r1 =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:If_L61_C4", "vector": [14, 2, 0.3949, 0.0064, 2, 0.71, 0.0, 648, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "r1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r1 = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:If_L63_C4", "label": "if", "type": "if", "loc": [63, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "vector": [4, 1, 0.4045, 0.0127, 1, 0.7, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if r2 == 0:\n r2 = 1 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L64_C8", "label": "r2 =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:If_L63_C4", "vector": [14, 2, 0.4076, 0.0064, 2, 0.66, 0.0, 959, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "r2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r2 = 1 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L65_C4", "label": "l1cv = np2cv()", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "vector": [14, 1, 0.414, 0.0064, 1, 0.7, 0.5714, 769, 3, 1, 0, 0, 672, 10, 2], "semantic": {"name": "l1cv", "arg_names": [], "import_names": [], "rhs_call_name": "np2cv", "annotation": ""}, "snippet": " l1cv = ut.np2cv(np.array( (1 - ((l1-m1) / r1)) * 255, dtype='uint8'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L66_C4", "label": "l2cv = np2cv()", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "vector": [14, 1, 0.4204, 0.0064, 1, 0.7, 0.6429, 521, 3, 1, 0, 0, 672, 10, 2], "semantic": {"name": "l2cv", "arg_names": [], "import_names": [], "rhs_call_name": "np2cv", "annotation": ""}, "snippet": " l2cv = ut.np2cv(np.array( (1 - ((l2-m2) / r2)) * 255, dtype='uint8'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Expr_L67_C4", "label": "cvNamedWindow()", "type": "expression", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "vector": [8, 1, 0.4268, 0.0064, 1, 0.7, 0.7143, 431, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "cvNamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "cvNamedWindow", "annotation": ""}, "snippet": " hg.cvNamedWindow('eigen value 1', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Expr_L68_C4", "label": "cvNamedWindow()", "type": "expression", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "vector": [8, 1, 0.4331, 0.0064, 1, 0.7, 0.7857, 431, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "cvNamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "cvNamedWindow", "annotation": ""}, "snippet": " hg.cvNamedWindow('eigen value 2', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Expr_L69_C4", "label": "cvShowImage()", "type": "expression", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "vector": [8, 1, 0.4395, 0.0064, 1, 0.7, 0.8571, 105, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "cvShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "cvShowImage", "annotation": ""}, "snippet": " hg.cvShowImage('eigen value 1', l1cv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Expr_L70_C4", "label": "cvShowImage()", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "vector": [8, 1, 0.4459, 0.0064, 1, 0.7, 0.9286, 105, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "cvShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "cvShowImage", "annotation": ""}, "snippet": " hg.cvShowImage('eigen value 2', l2cv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:While_L71_C4", "label": "while", "type": "while", "loc": [71, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "vector": [5, 1, 0.4682, 0.0382, 1, 0.7, 1.0, 0, 1, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True:\n k = hg.cvWaitKey(33)\n if k == ' ':\n return\n if k == 'x':\n exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L72_C8", "label": "k = cvWaitKey()", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:While_L71_C4", "vector": [14, 2, 0.4586, 0.0064, 2, 0.02, 0.0, 954, 3, 1, 0, 0, 885, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "cvWaitKey", "annotation": ""}, "snippet": " k = hg.cvWaitKey(33)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:If_L73_C8", "label": "if", "type": "if", "loc": [73, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:While_L71_C4", "vector": [4, 2, 0.4682, 0.0127, 2, 0.02, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if k == ' ':\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Return_L74_C12", "label": "return", "type": "return", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:If_L73_C8", "vector": [13, 3, 0.4713, 0.0064, 3, 0.31, 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_99732:If_L75_C8", "label": "if", "type": "if", "loc": [75, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:While_L71_C4", "vector": [4, 2, 0.4809, 0.0127, 2, 0.02, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if k == 'x':\n exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Expr_L76_C12", "label": "exit()", "type": "expression", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:If_L75_C8", "vector": [8, 3, 0.4841, 0.0064, 3, 0.11, 0.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_99732:If_L79_C0", "label": "if", "type": "if", "loc": [79, 88], "level": 0, "parent": null, "vector": [4, 0, 0.5318, 0.0637, 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 #import pdb\n #hg.cvNamedWindow('win', 1)\n im = hg.cvLoadImage('/home/haidai/svn/robot1/src/projects/08_03_dog_commands/dragonfly_color_calibration/untitled folder/camera_image.png')\n #hg.cvShowImage('win', im)\n for i in range(40):\n s = (i+1) * 2\n print(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L82_C4", "label": "im = cvLoadImage()", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:If_L79_C0", "vector": [14, 1, 0.5223, 0.0064, 1, 0.88, 0.0, 940, 3, 1, 0, 0, 45, 10, 1], "semantic": {"name": "im", "arg_names": [], "import_names": [], "rhs_call_name": "cvLoadImage", "annotation": ""}, "snippet": " im = hg.cvLoadImage('/home/haidai/svn/robot1/src/projects/08_03_dog_commands/dragonfly_color_calibration/untitled folder/camera_image.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:For_L84_C4", "label": "for i", "type": "for", "loc": [84, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:If_L79_C0", "vector": [6, 1, 0.5478, 0.0318, 1, 0.88, 1.0, 826, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(40):\n s = (i+1) * 2\n print(s)\n eig_tex_np = eigen_texture(im, blocksize=s, filtersize=3)\n visualize(eig_tex_np)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L85_C8", "label": "s =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:For_L84_C4", "vector": [14, 2, 0.5414, 0.0064, 2, 0.01, 0.0, 553, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s = (i+1) * 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Expr_L86_C8", "label": "print()", "type": "expression", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:For_L84_C4", "vector": [8, 2, 0.5478, 0.0064, 2, 0.01, 0.3333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L87_C8", "label": "eig_tex_np = eigen_texture()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:For_L84_C4", "vector": [14, 2, 0.5541, 0.0064, 2, 0.01, 0.6667, 320, 3, 3, 0, 0, 5, 10, 1], "semantic": {"name": "eig_tex_np", "arg_names": [], "import_names": [], "rhs_call_name": "eigen_texture", "annotation": ""}, "snippet": " eig_tex_np = eigen_texture(im, blocksize=s, filtersize=3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99732:Expr_L88_C8", "label": "visualize()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99732:For_L84_C4", "vector": [8, 2, 0.5605, 0.0064, 2, 0.01, 1.0, 705, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "visualize", "arg_names": [], "import_names": [], "rhs_call_name": "visualize", "annotation": ""}, "snippet": " visualize(eig_tex_np)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Expr_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Return_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:If_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:If_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:If_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:If_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Expr_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Expr_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Expr_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:While_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:While_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:While_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:If_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:If_L73_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Return_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:While_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:If_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:If_L75_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Expr_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:For_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Expr_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99732:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99732:Expr_L88_C8"}]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Travis Deyle (Healthcare Robotics Lab, Georgia Tech.) # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) import roslib; roslib.load_manifest('laser_camera_segmentation') if __name__ == '__main__': import scanr_transforms as trs import transforms as tr import numpy as np,math import webcam_config as cc import opencv as cv import opencv.highgui as hg import hrl_lib.util as ut import tilting_hokuyo.processing_3d as p3d import laser_cam_callib import pygame #seeds = np.array([1.0, 0.9, -1.7, 3.1, 0.061, 0.032, -0.027 ]) #seeds = np.array([0.0, 0.0, -0.0, 0.0, 0.061, 0.032, -0.027 ]) #seeds = np.array([0.8, 0.9, -1.7, 3.1, 0.061, 0.032, -0.035 ]) #seeds = np.array([2.4000 , 3.8000 , -2.9000 , 5.5000 , 0.0600 , 0.0300 , -0.0430 ]) # seeds = np.array([2.2000 , 2.0000 , -2.8000 , 5.5000 , 0.0500 , 0.0300 , -0.0430 ]) # 2.0000 2.0000 -2.8000 5.5000 0.0550 0.0300 x -0.0400 #seeds = np.array([0.9000 , 0.8000 , -2.2000 , 3.1000 , 0.0620 , 0.0320, -0.0270 ]) seeds = np.array([ 1.8000 , 1.7000 , -2.6000 , 4.7500 , 0.0620 , 0.0320 , -0.0270 ]) deltas = np.array([0.1, 0.1, 0.1, 0.1, 0.001, 0.001, 0.001 ]) #-1.0000 x 1.7000 -2.2000 6.4000 -0.0200 0.0300 -0.0430 names = ['Ry_0', 'Rz_0', 'Rx_-90', 'Rz_-90', 'dx', 'dy', 'dz'] def camTlaser( res = np.zeros(6) ): rot = tr.Ry( math.radians( 0.0 + res[0] )) * tr.Rz( math.radians( 0.0 + res[1] )) * tr.Rx( math.radians( -90.0 + res[2] )) * tr.Rz( math.radians( -90.0 + res[3])) disp = np.matrix([ res[4], res[5], res[6] ]).T + np.matrix([ 0.0, 0.0, 0.0 ]).T return tr.composeHomogeneousTransform(rot, disp) cameraTlaser = trs.camTlaser cp = cc.webcam_parameters['DesktopWebcam'] fx = cp['focal_length_x_in_pixels'] fy = cp['focal_length_y_in_pixels'] cam_proj_mat = np.matrix([[fx, 0, 0, 0], [0, fy, 0, 0], [0, 0, 1, 0]]) cam_centers = ( cp['optical_center_x_in_pixels'], cp['optical_center_y_in_pixels'] ) #take image and scan import scanner import configuration #id = '2009Nov04_144041' id = '2009Nov04_135319' cfg = configuration.configuration('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling') img = hg.cvLoadImage(cfg.path + '/data/' + id + '_image.png') thok_dict = ut.load_pickle(cfg.path + '/data/' + id + '_laserscans.pkl') #cfg = configuration.configuration('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/calib') #cfg.webcam_id = 0 #sc = scanner.scanner(cfg) #sc.capture_and_save('calib', False) #img = hg.cvLoadImage('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/calib/data/calib_image.png') #thok_dict = ut.load_pickle('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/calib/data/calib_laserscans.pkl') poses, scans = thok_dict['laserscans'][0] points_cloud_laser = p3d.generate_pointcloud(poses, scans, math.radians(-180), math.radians(180), 0, .035, max_dist=5.0, min_dist=.1) c = laser_cam_callib.Callib(cameraTlaser, seeds, deltas, names, points_cloud_laser, img, cam_proj_mat, cam_centers,1, id) while not c.reDraw(): tmp = 1 pygame.quit()
ajibawa-2023/Python-Code-Large/train/row_99733
38
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_99733:Import_L31_C0", "label": "roslib import roslib", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.2768, 0.0089, 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; roslib.load_manifest('laser_camera_segmentation')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Expr_L31_C15", "label": "load_manifest()", "type": "expression", "loc": [31, 31], "level": 0, "parent": null, "vector": [8, 0, 0.2768, 0.0089, 0, 0.66, 0.5, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('laser_camera_segmentation')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "label": "if", "type": "if", "loc": [33, 111], "level": 0, "parent": null, "vector": [4, 0, 0.6429, 0.7054, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 24], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import scanr_transforms as trs\n import transforms as tr\n import numpy as np,math\n import webcam_config as cc\n import opencv as cv\n import opencv.highgui as hg\n import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L34_C4", "label": "scanr_transforms import trs", "type": "import", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [1, 1, 0.3036, 0.0089, 1, 0.83, 0.0, 488, 0, 1, 0, 0, 488, 0, 0], "semantic": {"name": "scanr_transforms", "arg_names": [], "import_names": ["trs"], "rhs_call_name": "", "annotation": ""}, "snippet": " import scanr_transforms as trs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L35_C4", "label": "transforms import tr", "type": "import", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [1, 1, 0.3125, 0.0089, 1, 0.83, 0.0333, 578, 0, 1, 0, 0, 578, 0, 0], "semantic": {"name": "transforms", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": " import transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L36_C4", "label": "numpy import np, math", "type": "import", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [1, 1, 0.3214, 0.0089, 1, 0.83, 0.0667, 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_99733:Import_L37_C4", "label": "webcam_config import cc", "type": "import", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [1, 1, 0.3304, 0.0089, 1, 0.83, 0.1, 880, 0, 1, 0, 0, 880, 0, 0], "semantic": {"name": "webcam_config", "arg_names": [], "import_names": ["cc"], "rhs_call_name": "", "annotation": ""}, "snippet": " import webcam_config as cc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L38_C4", "label": "opencv import cv", "type": "import", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [1, 1, 0.3393, 0.0089, 1, 0.83, 0.1333, 437, 0, 1, 0, 0, 437, 0, 0], "semantic": {"name": "opencv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": " import opencv as cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L39_C4", "label": "opencv.highgui import hg", "type": "import", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [1, 1, 0.3482, 0.0089, 1, 0.83, 0.1667, 453, 0, 1, 0, 0, 453, 0, 0], "semantic": {"name": "opencv.highgui", "arg_names": [], "import_names": ["hg"], "rhs_call_name": "", "annotation": ""}, "snippet": " import opencv.highgui as hg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L40_C4", "label": "hrl_lib.util import ut", "type": "import", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [1, 1, 0.3571, 0.0089, 1, 0.83, 0.2, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": " import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L41_C4", "label": "tilting_hokuyo.processing_3d import p3d", "type": "import", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [1, 1, 0.3661, 0.0089, 1, 0.83, 0.2333, 474, 0, 1, 0, 0, 474, 0, 0], "semantic": {"name": "tilting_hokuyo.processing_3d", "arg_names": [], "import_names": ["p3d"], "rhs_call_name": "", "annotation": ""}, "snippet": " import tilting_hokuyo.processing_3d as p3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L42_C4", "label": "laser_cam_callib import laser_cam_callib", "type": "import", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [1, 1, 0.375, 0.0089, 1, 0.83, 0.2667, 587, 0, 1, 0, 0, 587, 0, 0], "semantic": {"name": "laser_cam_callib", "arg_names": [], "import_names": ["laser_cam_callib"], "rhs_call_name": "", "annotation": ""}, "snippet": " import laser_cam_callib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L43_C4", "label": "pygame import pygame", "type": "import", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [1, 1, 0.3839, 0.0089, 1, 0.83, 0.3, 87, 0, 1, 0, 0, 87, 0, 0], "semantic": {"name": "pygame", "arg_names": [], "import_names": ["pygame"], "rhs_call_name": "", "annotation": ""}, "snippet": " import pygame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L55_C4", "label": "seeds = array()", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [14, 1, 0.4911, 0.0089, 1, 0.83, 0.3333, 706, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "seeds", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " seeds = np.array([ 1.8000 , 1.7000 , -2.6000 , 4.7500 , 0.0620 , 0.0320 , -0.0270 ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L64_C4", "label": "deltas = array()", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [14, 1, 0.5714, 0.0089, 1, 0.83, 0.3667, 647, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "deltas", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " deltas = np.array([0.1, 0.1, 0.1, 0.1, 0.001, 0.001, 0.001 ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L67_C4", "label": "names =", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [14, 1, 0.5982, 0.0089, 1, 0.83, 0.4, 382, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " names = ['Ry_0', 'Rz_0', 'Rx_-90', 'Rz_-90', 'dx', 'dy', 'dz']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:FunctionDef_L70_C4", "label": "camTlaser", "type": "function", "loc": [70, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [2, 1, 0.6384, 0.0357, 1, 0.83, 0.4333, 184, 0, 1, 1, 0, 0, 0, 12], "semantic": {"name": "camTlaser", "arg_names": ["res"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def camTlaser( res = np.zeros(6) ):\n rot = tr.Ry( math.radians( 0.0 + res[0] )) * tr.Rz( math.radians( 0.0 + res[1] )) * tr.Rx( math.radians( -90.0 + res[2] )) * tr.Rz( math.radians( -90.0 + res[3]))\n disp = np.matrix([ res[4], res[5], res[6] ]).T + np.matrix([ 0.0, 0.0, 0.0 ]).T\n return tr.composeHomogeneousTransform(rot, disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L71_C8", "label": "rot =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:FunctionDef_L70_C4", "vector": [14, 2, 0.6339, 0.0089, 2, 0.51, 0.0, 812, 4, 0, 0, 0, 0, 0, 8], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot = tr.Ry( math.radians( 0.0 + res[0] )) * tr.Rz( math.radians( 0.0 + res[1] )) * tr.Rx( math.radians( -90.0 + res[2] )) * tr.Rz( math.radians( -90.0 + res[3]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L72_C8", "label": "disp =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:FunctionDef_L70_C4", "vector": [14, 2, 0.6429, 0.0089, 2, 0.51, 0.5, 654, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " disp = np.matrix([ res[4], res[5], res[6] ]).T + np.matrix([ 0.0, 0.0, 0.0 ]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Return_L73_C8", "label": "return", "type": "return", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:FunctionDef_L70_C4", "vector": [13, 2, 0.6518, 0.0089, 2, 0.51, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tr.composeHomogeneousTransform(rot, disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L75_C4", "label": "cameraTlaser =", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [14, 1, 0.6696, 0.0089, 1, 0.83, 0.4667, 992, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cameraTlaser", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cameraTlaser = trs.camTlaser"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L77_C4", "label": "cp =", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [14, 1, 0.6875, 0.0089, 1, 0.83, 0.5, 70, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cp = cc.webcam_parameters['DesktopWebcam']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L78_C4", "label": "fx =", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [14, 1, 0.6964, 0.0089, 1, 0.83, 0.5333, 322, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fx = cp['focal_length_x_in_pixels']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L79_C4", "label": "fy =", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [14, 1, 0.7054, 0.0089, 1, 0.83, 0.5667, 8, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fy = cp['focal_length_y_in_pixels']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L80_C4", "label": "cam_proj_mat = matrix()", "type": "assigned_variable", "loc": [80, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [14, 1, 0.7232, 0.0268, 1, 0.83, 0.6, 613, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "cam_proj_mat", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " cam_proj_mat = np.matrix([[fx, 0, 0, 0],\n [0, fy, 0, 0],\n [0, 0, 1, 0]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L84_C4", "label": "cam_centers =", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [14, 1, 0.75, 0.0089, 1, 0.83, 0.6333, 890, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "cam_centers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cam_centers = ( cp['optical_center_x_in_pixels'], cp['optical_center_y_in_pixels'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L88_C4", "label": "scanner import scanner", "type": "import", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [1, 1, 0.7857, 0.0089, 1, 0.83, 0.6667, 802, 0, 1, 0, 0, 802, 0, 0], "semantic": {"name": "scanner", "arg_names": [], "import_names": ["scanner"], "rhs_call_name": "", "annotation": ""}, "snippet": " import scanner "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L89_C4", "label": "configuration import configuration", "type": "import", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [1, 1, 0.7946, 0.0089, 1, 0.83, 0.7, 627, 0, 1, 0, 0, 627, 0, 0], "semantic": {"name": "configuration", "arg_names": [], "import_names": ["configuration"], "rhs_call_name": "", "annotation": ""}, "snippet": " import configuration "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L91_C4", "label": "id =", "type": "assigned_variable", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [14, 1, 0.8125, 0.0089, 1, 0.83, 0.7333, 941, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " id = '2009Nov04_135319'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L93_C4", "label": "cfg = configuration()", "type": "assigned_variable", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [14, 1, 0.8304, 0.0089, 1, 0.83, 0.7667, 46, 3, 1, 0, 0, 627, 10, 1], "semantic": {"name": "cfg", "arg_names": [], "import_names": [], "rhs_call_name": "configuration", "annotation": ""}, "snippet": " cfg = configuration.configuration('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L94_C4", "label": "img = cvLoadImage()", "type": "assigned_variable", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [14, 1, 0.8393, 0.0089, 1, 0.83, 0.8, 200, 3, 1, 0, 0, 45, 10, 1], "semantic": {"name": "img", "arg_names": [], "import_names": [], "rhs_call_name": "cvLoadImage", "annotation": ""}, "snippet": " img = hg.cvLoadImage(cfg.path + '/data/' + id + '_image.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L95_C4", "label": "thok_dict = load_pickle()", "type": "assigned_variable", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [14, 1, 0.8482, 0.0089, 1, 0.83, 0.8333, 385, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "thok_dict", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " thok_dict = ut.load_pickle(cfg.path + '/data/' + id + '_laserscans.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L102_C4", "label": "poses, scans =", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [14, 1, 0.9107, 0.0089, 1, 0.83, 0.8667, 354, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "poses, scans", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " poses, scans = thok_dict['laserscans'][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L103_C4", "label": "points_cloud_laser = generate_pointcloud()", "type": "assigned_variable", "loc": [103, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [14, 1, 0.9241, 0.0179, 1, 0.83, 0.9, 166, 3, 8, 0, 0, 989, 10, 3], "semantic": {"name": "points_cloud_laser", "arg_names": [], "import_names": [], "rhs_call_name": "generate_pointcloud", "annotation": ""}, "snippet": " points_cloud_laser = p3d.generate_pointcloud(poses, scans, math.radians(-180), math.radians(180), \n 0, .035, max_dist=5.0, min_dist=.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L106_C4", "label": "c = Callib()", "type": "assigned_variable", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [14, 1, 0.9464, 0.0089, 1, 0.83, 0.9333, 411, 3, 10, 0, 0, 724, 10, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "Callib", "annotation": ""}, "snippet": " c = laser_cam_callib.Callib(cameraTlaser, seeds, deltas, names, points_cloud_laser, img, cam_proj_mat, cam_centers,1, id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:While_L108_C4", "label": "while", "type": "while", "loc": [108, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [5, 1, 0.9688, 0.0179, 1, 0.83, 0.9667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not c.reDraw():\n tmp = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L109_C8", "label": "tmp =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:While_L108_C4", "vector": [14, 2, 0.9732, 0.0089, 2, 0.83, 0.0, 517, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "tmp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tmp = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99733:Expr_L111_C4", "label": "quit()", "type": "expression", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "vector": [8, 1, 0.9911, 0.0089, 1, 0.83, 1.0, 219, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "quit", "arg_names": [], "import_names": [], "rhs_call_name": "quit", "annotation": ""}, "snippet": " pygame.quit()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:FunctionDef_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Return_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Import_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:While_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:While_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99733:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99733:Expr_L111_C4"}]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) from features import features import laser_camera_segmentation.gaussian_curvature as gaussian_curvature import scipy.stats as stats import numpy as np import opencv as cv import scipy.spatial.kdtree as kdtree import hrl_lib.util as ut from hrl_lib.util import getTime import os import laser_camera_segmentation.texture_features as texture_features import processor import copy class gaussian_histogram_features(features): ''' classdocs ''' #all_save_load: set to true only if nonzero_indices contain all pts in pt-cloud! def prepare(self, features_k_nearest_neighbors, nonzero_indices = None, all_save_load = False, regenerate_neightborhood_indices = False): #print np.shape(self.processor.pts3d_bound), 'shape pts3d_bound' imgTmp = cv.cvCloneImage(self.processor.img) self.imNP = ut.cv2np(imgTmp,format='BGR') self.processor.map2d = np.asarray(self.processor.map[0][0:2]) #copied from laser to image mapping if features_k_nearest_neighbors == None or features_k_nearest_neighbors == False: #use range self.kdtree2d = kdtree.KDTree(self.processor.pts3d_bound.T) #print len(nonzero_indices) #print np.shape(np.asarray((self.processor.pts3d_bound.T)[nonzero_indices])) if nonzero_indices != None: print getTime(), 'query ball tree for ', len(nonzero_indices), 'points' kdtree_query = kdtree.KDTree((self.processor.pts3d_bound.T)[nonzero_indices]) else: print getTime(), 'query ball tree' kdtree_query = kdtree.KDTree(self.processor.pts3d_bound.T) filename = self.processor.config.path+'/data/'+self.processor.scan_dataset.id+'_sphere_neighborhood_indices_'+str(self.processor.feature_radius)+'.pkl' if all_save_load == True and os.path.exists(filename) and regenerate_neightborhood_indices == False: #if its already there, load it: print getTime(), 'loading',filename self.kdtree_queried_indices = ut.load_pickle(filename) else: self.kdtree_queried_indices = kdtree_query.query_ball_tree(self.kdtree2d, self.processor.feature_radius, 2.0, 0.2) #approximate print getTime(), 'queried kdtree: ',len(self.kdtree_queried_indices),'points, radius:',self.processor.feature_radius if all_save_load == True: ut.save_pickle(self.kdtree_queried_indices, filename) #make dict out of list for faster operations? (doesn't seem to change speed significantly): #self.kdtree_queried_indices = dict(zip(xrange(len(self.kdtree_queried_indices)), self.kdtree_queried_indices)) else: #experiemental: use_20_nearest_neighbors == True #TODO: exclude invalid values in get_featurevector (uncomment code there) self.kdtree2d = kdtree.KDTree(self.processor.pts3d_bound.T) self.kdtree_queried_indices = [] print getTime(), 'kdtree single queries for kNN start, k=', features_k_nearest_neighbors count = 0 for point in ((self.processor.pts3d_bound.T)[nonzero_indices]): count = count + 1 result = self.kdtree2d.query(point, features_k_nearest_neighbors,0.2,2,self.processor.feature_radius) #existing = result[0][0] != np.Inf #print existing #print result[1] self.kdtree_queried_indices += [result[1]] #[existing] if count % 4096 == 0: print getTime(),count print getTime(), 'kdtree singe queries end' #convert to numpy array -> faster access self.kdtree_queried_indices = np.asarray(self.kdtree_queried_indices) #print self.kdtree_queried_indices #takes long to compute: #avg_len = 0 #minlen = 999999 #maxlen = 0 #for x in self.kdtree_queried_indices: # avg_len += len(x) # minlen = min(minlen, len(x)) # maxlen = max(maxlen, len(x)) #avg_len = avg_len / len(self.kdtree_queried_indices) #print getTime(), "range neighbors: avg_len", avg_len, 'minlen', minlen, 'maxlen', maxlen #create HSV numpy images: # compute the hsv version of the image image_size = cv.cvGetSize(self.processor.img) img_h = cv.cvCreateImage (image_size, 8, 1) img_s = cv.cvCreateImage (image_size, 8, 1) img_v = cv.cvCreateImage (image_size, 8, 1) img_hsv = cv.cvCreateImage (image_size, 8, 3) cv.cvCvtColor (self.processor.img, img_hsv, cv.CV_BGR2HSV) cv.cvSplit (img_hsv, img_h, img_s, img_v, None) self.imNP_h = ut.cv2np(img_h) self.imNP_s = ut.cv2np(img_s) self.imNP_v = ut.cv2np(img_v) textures = texture_features.eigen_texture(self.processor.img) self.imNP_tex1 = textures[:,:,0] self.imNP_tex2 = textures[:,:,1] self.debug_before_first_featurevector = True self.generate_voi_histogram(self.processor.point_of_interest,self.processor.voi_width) #has to have at least length 2 because of openCV matrices!!!! def get_indexvector(self, type): var_idx = [] #start indices rh1 = 0 #zhist, normal, eigenvalue1, ev2 ch1 = rh1 + 6 #hsi zhist, maxheight-diff, tex1, tex2 ci = ch1 + 25 end = ci + 4 # if type=='range': for i in range(rh1, ch1): var_idx.append(i) elif type=='color': for i in range(ch1, end): var_idx.append(i) #for plotting: elif type=='hsvi': for i in range(ci,end): var_idx.append(i) else: #all for i in range(rh1, end): var_idx.append(i) return np.array(var_idx) #get the feature vector for a specific point def get_featurevector(self, index, count, pts = None): if pts == None: pts = self.processor.pts3d_bound #print 'i',index,'c', count fv = [] indices = np.asarray(self.kdtree_queried_indices[count]) invalid_value = np.shape(pts)[1] #print indices #print 'iv',invalid_value indices = indices[indices != invalid_value] #print getTime(), indices #print getTime(), 'number of pts', len(indices) a = pts[:,indices] view = processor.rotate_to_plane(self.processor.scan_dataset.ground_plane_normal, np.matrix([-1,0,0.]).T) normal, eigenvalues = gaussian_curvature.gaussian_curvature(a,view) #eigenvalues = eigenvalues / np.square(r) #fv += [normal[0,0],0,normal[2,0]] #fv += normal.T.A[0].tolist() #fv += eigenvalues.tolist() #print np.asarray(pts[:,index].T[0])[0] # print 'pt',np.asarray(pts[:,index].T[0]) point = pts[:,index] ev1, ev2 = self.get_voi_histogram_spread(point) #z_max_height_diff = pts[2,index] - self.get_voi_maxcount_height() #fv += [self.get_voi_histogram_value(point),z_max_height_diff,normal[0,0],normal[1,0],normal[2,0], ev1, ev2] fv += [self.get_voi_histogram_value(point),normal[0,0],normal[1,0],normal[2,0], ev1, ev2] h = self.imNP_h[self.processor.map2d[1,index],self.processor.map2d[0,index]] s = self.imNP_s[self.processor.map2d[1,index],self.processor.map2d[0,index]] i = self.processor.intensities_bound[index] hsi = self.get_voi_hsi_histogram_values(point,h,s,i) fv += [hsi[0],hsi[1],hsi[2]] #print np.shape(self.imNP_tex1) #print np.shape(self.map2d) tex1 = self.imNP_tex1[self.processor.map2d[1,index],self.processor.map2d[0,index]] tex2 = self.imNP_tex2[self.processor.map2d[1,index],self.processor.map2d[0,index]] fv += [tex1, tex2] #print tex1, tex2 #color histograms: colors_h = [] colors_s = [] colors_v = [] for idx in indices: colors_h.append(float(self.imNP_h[self.processor.map2d[1,idx],self.processor.map2d[0,idx]])) colors_s.append(float(self.imNP_s[self.processor.map2d[1,idx],self.processor.map2d[0,idx]])) colors_v.append(float(self.imNP_v[self.processor.map2d[1,idx],self.processor.map2d[0,idx]])) color_hist = stats.histogram2(np.array(colors_h), [0,51,102,153,204]) color_hist = color_hist / float(np.sum(color_hist)) color_hist = list(color_hist) fv += color_hist color_hist = stats.histogram2(np.array(colors_s), [0,51,102,153,204]) color_hist = color_hist / float(np.sum(color_hist)) color_hist = list(color_hist) fv += color_hist color_hist = stats.histogram2(np.array(colors_v), [0,51,102,153,204]) color_hist = color_hist / float(np.sum(color_hist)) color_hist = list(color_hist) fv += color_hist #intensities intensities = self.processor.intensities_bound[indices] intensities = np.asarray(intensities) #map to 0-255-range: TODO: perhaps do some nonlinear transformation here? intensities = intensities / 10000 * 255 intensity_hist = stats.histogram2(intensities, [0,51,102,153,204]) intensity_hist = intensity_hist / float(np.sum(intensity_hist)) intensity_hist = list(intensity_hist) fv += intensity_hist #current colors: fv += [float(self.imNP_h[self.processor.map2d[1,index],self.processor.map2d[0,index]]) / 255.0] fv += [float(self.imNP_s[self.processor.map2d[1,index],self.processor.map2d[0,index]]) / 255.0] fv += [float(self.imNP_v[self.processor.map2d[1,index],self.processor.map2d[0,index]]) / 255.0] #current intensity value (scaled) intensity = self.processor.intensities_bound[index] #scale: intensity = intensity / 15000.0 intensity = [intensity] fv += intensity if self.debug_before_first_featurevector == True: self.debug_before_first_featurevector = False print getTime(), 'feature vector sample(gaussian histograms):', fv return fv #cube of interest around point def generate_voi_histogram(self, poi, width): print 'poi',poi,'width',width pts_indices = self.get_voi_pts_indices(poi, width) self.voi_pts_indices = pts_indices pts = np.asarray(self.processor.pts3d_bound) pts = pts[:,pts_indices] self.voi_pts = pts #mlab.points3d(pts[0,:],pts[1,:],pts[2,:], mode='point') #mlab.show() min = 0. max = 2. self.voi_bincount = 80 self.voi_interval_size = max - min bins = np.asarray(range(self.voi_bincount)) * self.voi_interval_size/float(self.voi_bincount) #print 'bins',bins hist = stats.histogram2(pts[2],bins) / float(len(pts[2])) #print 'zhist',hist #print zip(bins, hist) self.z_hist = hist self.z_hist_bins = bins slices = self.get_voi_slice_indices() self.z_hist_slices_indices = slices #precalculate spread values: self.z_hist_spread = [] for indices in self.z_hist_slices_indices: a = self.processor.pts3d_bound[:,indices] u, ev12 = gaussian_curvature.spread(a) self.z_hist_spread += [(ev12[0], ev12[1])] #create h,s histograms: pts_h = [] pts_s = [] #print self.processor.pts3d_bound n,m = np.shape(np.asarray(self.processor.pts3d_bound)) #print 'm',m,'len(self.processor.pts3d_bound[2,:].A1)',len(self.processor.pts3d_bound[2,:].A1) for index in range(m): pts_h.append(float(self.imNP_h[self.processor.map2d[1,index],self.processor.map2d[0,index]])) for index in range(m): pts_s.append(float(self.imNP_s[self.processor.map2d[1,index],self.processor.map2d[0,index]])) pts_i = np.asarray(self.processor.intensities_bound) #print 'ptsi',pts_i if np.max(pts_i) > 0: self.intensity_normalization_factor = 1.0 / float(np.max(pts_i)) * 255 else: self.intensity_normalization_factor = 1. #print 'self.intensity_normalization_factor', self.intensity_normalization_factor #print pts_i pts_i *= self.intensity_normalization_factor pts_h = np.asarray(pts_h) pts_s = np.asarray(pts_s) self.z_hist_h_hists = [] self.z_hist_s_hists = [] self.z_hist_i_hists = [] #normalize by maximum slice: max_count = 0 max_count_index = 0 for count_idx, indices in enumerate(slices): n = np.shape(indices) if n[0] > max_count: max_count = n[0] max_count_index = count_idx slize_height = (self.voi_interval_size / float(self.voi_bincount)) self.z_hist_height_max = slize_height * (max_count_index + 0.5) #print 'max_count', max_count,'index',max_count_index, 'height in max bin', self.z_hist_height_max for indices in slices: pts_h_slice = pts_h[indices] pts_s_slice = pts_s[indices] pts_i_slice = pts_i[indices] self.hsi_hist_bincount = 5 bins = np.asarray(range(0,self.hsi_hist_bincount))*float(255.0/float(self.hsi_hist_bincount)) #print bins #todo: smooth with kernel fct count = float(len(pts_h_slice)) if count == 0: count = 1 hist_h = stats.histogram2(pts_h_slice,bins) / count self.z_hist_h_hists.append(hist_h) hist_s = stats.histogram2(pts_s_slice,bins) / count self.z_hist_s_hists.append(hist_s) hist_i = stats.histogram2(pts_i_slice,bins) / count #print 'hist_i', hist_i, pts_i_slice, bins, pts_i self.z_hist_i_hists.append(hist_i) #print 'hh',self.z_hist_h_hists #print 'sh',self.z_hist_s_hists #print 'ih',self.z_hist_i_hists def get_voi_pts_indices(self, poi, width): pts = np.asarray(self.processor.pts3d_bound) #region of interest: conditions = np.multiply(np.multiply(np.multiply(np.multiply(np.multiply(pts[0] < poi[0]+width/2.0, pts[0] > poi[0]-width/2.0), pts[1] < poi[1]+width/2.0), pts[1] > poi[1]-width/2.0), pts[2] < poi[2]+width/2.0), pts[2] > poi[2]-width/2.0) indices = np.where(conditions)[0] return indices def get_voi_slice_indices(self): slices = [] last_z = -999999 for z in self.z_hist_bins: indices = copy.copy(self.voi_pts_indices) pts = self.voi_pts conditions = np.multiply(pts[2] < z, pts[2] > last_z) indices = indices[np.where(conditions)[0]] slices += [indices] last_z = z return slices def get_voi_histogram_value(self, point): z = point[2] z = int(z*self.voi_bincount / float(self.voi_interval_size)) if z >= 0 and z < self.voi_bincount: # print z, self.z_hist[z] return self.z_hist[z] else: #print z,0 return 0 def get_voi_histogram_spread(self, point): z = point[2] z = int(z*self.voi_bincount / float(self.voi_interval_size)) if z >= 0 and z < self.voi_bincount: # indices = self.z_hist_slices_indices[z] # a = self.processor.pts3d_bound[:,indices] # u, ev12 = gaussian_curvature.spread(a) # if abs(self.z_hist_spread[z][0] - ev12[0]) > 0.0000000001 or abs(self.z_hist_spread[z][1] - ev12[1]) > 0.0000000001: # print 'ERROR', self.z_hist_spread[z], '!=', (ev12[0], ev12[1]) # return ev12[0], ev12[1] return self.z_hist_spread[z] else: #print z,0 return 0, 0 def get_voi_hsi_histogram_values(self, point,h ,s, i): z = point[2] z = int(z*self.voi_bincount / float(self.voi_interval_size)) if z >= 0 and z < self.voi_bincount: h_index = int(h * self.hsi_hist_bincount / 255.0) s_index = int(s * self.hsi_hist_bincount / 255.0) i *= self.intensity_normalization_factor i_index = int(i * self.hsi_hist_bincount / 255.0) h_hist = self.z_hist_h_hists[z][h_index] s_hist = self.z_hist_s_hists[z][s_index] #print 'z',z,'i_index',i_index, i #print self.z_hist_i_hists, np.shape(self.z_hist_i_hists) i_hist = self.z_hist_i_hists[z][i_index] return h_hist, s_hist, i_hist else: #print z,0 return 0, 0, 0 def get_voi_maxcount_height(self): return self.z_hist_height_max
ajibawa-2023/Python-Code-Large/train/row_99735
226
434
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99735:ImportFrom_L30_C0", "label": "from features import features", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.0691, 0.0023, 0, 0.66, 0.0, 479, 0, 1, 0, 0, 479, 0, 0], "semantic": {"name": "features", "arg_names": [], "import_names": ["features"], "rhs_call_name": "", "annotation": ""}, "snippet": "from features import features"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Import_L32_C0", "label": "laser_camera_segmentation.gaussian_curvature import gaussian_curvature", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.0737, 0.0023, 0, 0.66, 0.0833, 82, 0, 1, 0, 0, 82, 0, 0], "semantic": {"name": "laser_camera_segmentation.gaussian_curvature", "arg_names": [], "import_names": ["gaussian_curvature"], "rhs_call_name": "", "annotation": ""}, "snippet": "import laser_camera_segmentation.gaussian_curvature as gaussian_curvature"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Import_L33_C0", "label": "scipy.stats import stats", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.076, 0.0023, 0, 0.66, 0.1667, 413, 0, 1, 0, 0, 413, 0, 0], "semantic": {"name": "scipy.stats", "arg_names": [], "import_names": ["stats"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.stats as stats"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Import_L34_C0", "label": "numpy import np", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0783, 0.0023, 0, 0.66, 0.25, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Import_L35_C0", "label": "opencv import cv", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.0806, 0.0023, 0, 0.66, 0.3333, 437, 0, 1, 0, 0, 437, 0, 0], "semantic": {"name": "opencv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import opencv as cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Import_L36_C0", "label": "scipy.spatial.kdtree import kdtree", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.0829, 0.0023, 0, 0.66, 0.4167, 15, 0, 1, 0, 0, 15, 0, 0], "semantic": {"name": "scipy.spatial.kdtree", "arg_names": [], "import_names": ["kdtree"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.spatial.kdtree as kdtree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Import_L37_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.0853, 0.0023, 0, 0.66, 0.5, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:ImportFrom_L38_C0", "label": "from hrl_lib.util import getTime", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.0876, 0.0023, 0, 0.66, 0.5833, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["getTime"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_lib.util import getTime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Import_L39_C0", "label": "os import os", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.0899, 0.0023, 0, 0.66, 0.6667, 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_99735:Import_L41_C0", "label": "laser_camera_segmentation.texture_features import texture_features", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.0945, 0.0023, 0, 0.66, 0.75, 451, 0, 1, 0, 0, 451, 0, 0], "semantic": {"name": "laser_camera_segmentation.texture_features", "arg_names": [], "import_names": ["texture_features"], "rhs_call_name": "", "annotation": ""}, "snippet": "import laser_camera_segmentation.texture_features as texture_features"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Import_L43_C0", "label": "processor import processor", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.0991, 0.0023, 0, 0.66, 0.8333, 177, 0, 1, 0, 0, 177, 0, 0], "semantic": {"name": "processor", "arg_names": [], "import_names": ["processor"], "rhs_call_name": "", "annotation": ""}, "snippet": "import processor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Import_L44_C0", "label": "copy import copy", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.1014, 0.0023, 0, 0.66, 0.9167, 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_99735:ClassDef_L46_C0", "label": "gaussian_histogram_features", "type": "class", "loc": [46, 432], "level": 0, "parent": null, "vector": [3, 0, 0.5507, 0.8917, 0, 0.66, 1.0, 9, 0, 10, 0, 0, 479, 0, 99], "semantic": {"name": "gaussian_histogram_features", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class gaussian_histogram_features(features):\n '''\n classdocs\n '''\n \n #all_save_load: set to true only if nonzero_indices contain all pts in pt-cloud!\n def prepare(self, features_k_nearest_neighbors, nonzero_indices = None, all_save_load = False, regenerate_neightborhood_indices = False):\n #print np.shape(self.processor.pts3d_bound), 'shape pts3d_bound'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L47_C4", "label": "expression", "type": "expression", "loc": [47, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "vector": [8, 1, 0.1106, 0.0069, 1, 0.64, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n classdocs\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "label": "prepare", "type": "function", "loc": [52, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "vector": [2, 1, 0.2224, 0.2074, 1, 0.64, 0.1, 556, 0, 5, 0, 0, 0, 0, 42], "semantic": {"name": "prepare", "arg_names": ["self", "features_k_nearest_neighbors", "nonzero_indices", "all_save_load", "regenerate_neightborhood_indices"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def prepare(self, features_k_nearest_neighbors, nonzero_indices = None, all_save_load = False, regenerate_neightborhood_indices = False):\n #print np.shape(self.processor.pts3d_bound), 'shape pts3d_bound'\n\n imgTmp = cv.cvCloneImage(self.processor.img)\n self.imNP = ut.cv2np(imgTmp,format='BGR')\n self.processor.map2d = np.asarray(self.processor.map[0][0:2]) #copied from laser to image mapping\n \n if features_k_nearest_neighbors == None or features_k_nearest_neighbors == False: #use range"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L55_C8", "label": "imgTmp = cvCloneImage()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "vector": [14, 2, 0.1267, 0.0023, 2, 0.44, 0.0, 110, 3, 1, 0, 0, 483, 10, 1], "semantic": {"name": "imgTmp", "arg_names": [], "import_names": [], "rhs_call_name": "cvCloneImage", "annotation": ""}, "snippet": " imgTmp = cv.cvCloneImage(self.processor.img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L56_C8", "label": "self.imNP = cv2np()", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "vector": [14, 2, 0.129, 0.0023, 2, 0.44, 0.0556, 579, 3, 2, 0, 0, 366, 10, 1], "semantic": {"name": "self.imNP", "arg_names": [], "import_names": [], "rhs_call_name": "cv2np", "annotation": ""}, "snippet": " self.imNP = ut.cv2np(imgTmp,format='BGR')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L57_C8", "label": "self.processor.map2d = asarray()", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "vector": [14, 2, 0.1313, 0.0023, 2, 0.44, 0.1111, 897, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.processor.map2d", "arg_names": [], "import_names": [], "rhs_call_name": "asarray", "annotation": ""}, "snippet": " self.processor.map2d = np.asarray(self.processor.map[0][0:2]) #copied from laser to image mapping"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "label": "if", "type": "if", "loc": [59, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "vector": [4, 2, 0.1889, 0.1083, 2, 0.44, 0.1667, 0, 0, 0, 0, 0, 0, 0, 27], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if features_k_nearest_neighbors == None or features_k_nearest_neighbors == False: #use range\n self.kdtree2d = kdtree.KDTree(self.processor.pts3d_bound.T)\n \n #print len(nonzero_indices)\n #print np.shape(np.asarray((self.processor.pts3d_bound.T)[nonzero_indices]))\n \n if nonzero_indices != None:\n print(getTime(), 'query ball tree for ', len(nonzero_indices), 'points')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L60_C12", "label": "self.kdtree2d = KDTree()", "type": "assigned_variable", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "vector": [14, 3, 0.1382, 0.0023, 3, 0.4, 0.0, 412, 3, 1, 0, 0, 940, 10, 1], "semantic": {"name": "self.kdtree2d", "arg_names": [], "import_names": [], "rhs_call_name": "KDTree", "annotation": ""}, "snippet": " self.kdtree2d = kdtree.KDTree(self.processor.pts3d_bound.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L65_C12", "label": "if", "type": "if", "loc": [65, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "vector": [4, 3, 0.1555, 0.0138, 3, 0.4, 0.1, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if nonzero_indices != None:\n print(getTime(), 'query ball tree for ', len(nonzero_indices), 'points')\n kdtree_query = kdtree.KDTree((self.processor.pts3d_bound.T)[nonzero_indices])\n else:\n print(getTime(), 'query ball tree')\n kdtree_query = kdtree.KDTree(self.processor.pts3d_bound.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L66_C16", "label": "print()", "type": "expression", "loc": [66, 66], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L65_C12", "vector": [8, 4, 0.1521, 0.0023, 4, 0.18, 0.0, 535, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), 'query ball tree for ', len(nonzero_indices), 'points')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L67_C16", "label": "kdtree_query = KDTree()", "type": "assigned_variable", "loc": [67, 67], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L65_C12", "vector": [14, 4, 0.1544, 0.0023, 4, 0.18, 0.3333, 742, 3, 1, 0, 0, 940, 10, 1], "semantic": {"name": "kdtree_query", "arg_names": [], "import_names": [], "rhs_call_name": "KDTree", "annotation": ""}, "snippet": " kdtree_query = kdtree.KDTree((self.processor.pts3d_bound.T)[nonzero_indices])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L69_C16", "label": "print()", "type": "expression", "loc": [69, 69], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L65_C12", "vector": [8, 4, 0.159, 0.0023, 4, 0.18, 0.6667, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), 'query ball tree')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L70_C16", "label": "kdtree_query = KDTree()", "type": "assigned_variable", "loc": [70, 70], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L65_C12", "vector": [14, 4, 0.1613, 0.0023, 4, 0.18, 1.0, 742, 3, 1, 0, 0, 940, 10, 1], "semantic": {"name": "kdtree_query", "arg_names": [], "import_names": [], "rhs_call_name": "KDTree", "annotation": ""}, "snippet": " kdtree_query = kdtree.KDTree(self.processor.pts3d_bound.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L72_C12", "label": "filename =", "type": "assigned_variable", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "vector": [14, 3, 0.1659, 0.0023, 3, 0.4, 0.2, 275, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filename = self.processor.config.path+'/data/'+self.processor.scan_dataset.id+'_sphere_neighborhood_indices_'+str(self.processor.feature_radius)+'.pkl'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L73_C12", "label": "if", "type": "if", "loc": [73, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "vector": [4, 3, 0.1774, 0.0207, 3, 0.4, 0.3, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if all_save_load == True and os.path.exists(filename) and regenerate_neightborhood_indices == False:\n #if its already there, load it:\n print(getTime(), 'loading',filename)\n self.kdtree_queried_indices = ut.load_pickle(filename) \n else:\n self.kdtree_queried_indices = kdtree_query.query_ball_tree(self.kdtree2d, self.processor.feature_radius, 2.0, 0.2) #approximate\n print(getTime(), 'queried kdtree: ',len(self.kdtree_queried_indices),'points, radius:',self.processor.feature_radius)\n if all_save_load == True:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L75_C16", "label": "print()", "type": "expression", "loc": [75, 75], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L73_C12", "vector": [8, 4, 0.1728, 0.0023, 4, 0.64, 0.0, 535, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), 'loading',filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L76_C16", "label": "self.kdtree_queried_indices = load_pickle()", "type": "assigned_variable", "loc": [76, 76], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L73_C12", "vector": [14, 4, 0.1751, 0.0023, 4, 0.64, 0.25, 876, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "self.kdtree_queried_indices", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " self.kdtree_queried_indices = ut.load_pickle(filename) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L78_C16", "label": "self.kdtree_queried_indices = query_ball_tree()", "type": "assigned_variable", "loc": [78, 78], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L73_C12", "vector": [14, 4, 0.1797, 0.0023, 4, 0.64, 0.5, 876, 3, 4, 0, 0, 830, 10, 1], "semantic": {"name": "self.kdtree_queried_indices", "arg_names": [], "import_names": [], "rhs_call_name": "query_ball_tree", "annotation": ""}, "snippet": " self.kdtree_queried_indices = kdtree_query.query_ball_tree(self.kdtree2d, self.processor.feature_radius, 2.0, 0.2) #approximate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L79_C16", "label": "print()", "type": "expression", "loc": [79, 79], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L73_C12", "vector": [8, 4, 0.182, 0.0023, 4, 0.64, 0.75, 535, 3, 5, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), 'queried kdtree: ',len(self.kdtree_queried_indices),'points, radius:',self.processor.feature_radius)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L80_C16", "label": "if", "type": "if", "loc": [80, 81], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L73_C12", "vector": [4, 4, 0.1855, 0.0046, 4, 0.64, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if all_save_load == True:\n ut.save_pickle(self.kdtree_queried_indices, filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L81_C20", "label": "save_pickle()", "type": "expression", "loc": [81, 81], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L80_C16", "vector": [8, 5, 0.1866, 0.0023, 5, 0.27, 0.0, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(self.kdtree_queried_indices, filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L89_C12", "label": "self.kdtree2d = KDTree()", "type": "assigned_variable", "loc": [89, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "vector": [14, 3, 0.2051, 0.0023, 3, 0.4, 0.4, 412, 3, 1, 0, 0, 940, 10, 1], "semantic": {"name": "self.kdtree2d", "arg_names": [], "import_names": [], "rhs_call_name": "KDTree", "annotation": ""}, "snippet": " self.kdtree2d = kdtree.KDTree(self.processor.pts3d_bound.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L90_C12", "label": "self.kdtree_queried_indices =", "type": "assigned_variable", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "vector": [14, 3, 0.2074, 0.0023, 3, 0.4, 0.5, 876, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.kdtree_queried_indices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.kdtree_queried_indices = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L91_C12", "label": "print()", "type": "expression", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "vector": [8, 3, 0.2097, 0.0023, 3, 0.4, 0.6, 535, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), 'kdtree single queries for kNN start, k=', features_k_nearest_neighbors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L92_C12", "label": "count =", "type": "assigned_variable", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "vector": [14, 3, 0.212, 0.0023, 3, 0.4, 0.7, 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_99735:For_L93_C12", "label": "for point", "type": "for", "loc": [93, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "vector": [6, 3, 0.2235, 0.0207, 3, 0.4, 0.8, 16, 6, 0, 0, 0, 0, 0, 3], "semantic": {"name": "point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for point in ((self.processor.pts3d_bound.T)[nonzero_indices]):\n count = count + 1\n result = self.kdtree2d.query(point, features_k_nearest_neighbors,0.2,2,self.processor.feature_radius)\n #existing = result[0][0] != np.Inf\n #print existing\n #print result[1]\n self.kdtree_queried_indices += [result[1]] #[existing]\n if count % 4096 == 0:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L94_C16", "label": "count =", "type": "assigned_variable", "loc": [94, 94], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L93_C12", "vector": [14, 4, 0.2166, 0.0023, 4, 0.9, 0.0, 778, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count = count + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L95_C16", "label": "result = query()", "type": "assigned_variable", "loc": [95, 95], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L93_C12", "vector": [14, 4, 0.2189, 0.0023, 4, 0.9, 0.5, 51, 3, 5, 0, 0, 546, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "query", "annotation": ""}, "snippet": " result = self.kdtree2d.query(point, features_k_nearest_neighbors,0.2,2,self.processor.feature_radius)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L100_C16", "label": "if", "type": "if", "loc": [100, 101], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L93_C12", "vector": [4, 4, 0.2316, 0.0046, 4, 0.9, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if count % 4096 == 0:\n print(getTime(),count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L101_C20", "label": "print()", "type": "expression", "loc": [101, 101], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L100_C16", "vector": [8, 5, 0.2327, 0.0023, 5, 0.36, 0.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(),count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L102_C12", "label": "print()", "type": "expression", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "vector": [8, 3, 0.235, 0.0023, 3, 0.4, 0.9, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), 'kdtree singe queries end')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L105_C12", "label": "self.kdtree_queried_indices = asarray()", "type": "assigned_variable", "loc": [105, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "vector": [14, 3, 0.2419, 0.0023, 3, 0.4, 1.0, 876, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.kdtree_queried_indices", "arg_names": [], "import_names": [], "rhs_call_name": "asarray", "annotation": ""}, "snippet": " self.kdtree_queried_indices = np.asarray(self.kdtree_queried_indices)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L122_C8", "label": "image_size = cvGetSize()", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "vector": [14, 2, 0.2811, 0.0023, 2, 0.44, 0.2222, 701, 3, 1, 0, 0, 261, 10, 1], "semantic": {"name": "image_size", "arg_names": [], "import_names": [], "rhs_call_name": "cvGetSize", "annotation": ""}, "snippet": " image_size = cv.cvGetSize(self.processor.img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L123_C8", "label": "img_h = cvCreateImage()", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "vector": [14, 2, 0.2834, 0.0023, 2, 0.44, 0.2778, 900, 3, 3, 0, 0, 953, 10, 1], "semantic": {"name": "img_h", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateImage", "annotation": ""}, "snippet": " img_h = cv.cvCreateImage (image_size, 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L124_C8", "label": "img_s = cvCreateImage()", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "vector": [14, 2, 0.2857, 0.0023, 2, 0.44, 0.3333, 594, 3, 3, 0, 0, 953, 10, 1], "semantic": {"name": "img_s", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateImage", "annotation": ""}, "snippet": " img_s = cv.cvCreateImage (image_size, 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L125_C8", "label": "img_v = cvCreateImage()", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "vector": [14, 2, 0.288, 0.0023, 2, 0.44, 0.3889, 373, 3, 3, 0, 0, 953, 10, 1], "semantic": {"name": "img_v", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateImage", "annotation": ""}, "snippet": " img_v = cv.cvCreateImage (image_size, 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L126_C8", "label": "img_hsv = cvCreateImage()", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "vector": [14, 2, 0.2903, 0.0023, 2, 0.44, 0.4444, 486, 3, 3, 0, 0, 953, 10, 1], "semantic": {"name": "img_hsv", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateImage", "annotation": ""}, "snippet": " img_hsv = cv.cvCreateImage (image_size, 8, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L128_C8", "label": "cvCvtColor()", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "vector": [8, 2, 0.2949, 0.0023, 2, 0.44, 0.5, 709, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "cvCvtColor", "arg_names": [], "import_names": [], "rhs_call_name": "cvCvtColor", "annotation": ""}, "snippet": " cv.cvCvtColor (self.processor.img, img_hsv, cv.CV_BGR2HSV)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L130_C8", "label": "cvSplit()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "vector": [8, 2, 0.2995, 0.0023, 2, 0.44, 0.5556, 389, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "cvSplit", "arg_names": [], "import_names": [], "rhs_call_name": "cvSplit", "annotation": ""}, "snippet": " cv.cvSplit (img_hsv, img_h, img_s, img_v, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L131_C8", "label": "self.imNP_h = cv2np()", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "vector": [14, 2, 0.3018, 0.0023, 2, 0.44, 0.6111, 331, 3, 1, 0, 0, 366, 10, 1], "semantic": {"name": "self.imNP_h", "arg_names": [], "import_names": [], "rhs_call_name": "cv2np", "annotation": ""}, "snippet": " self.imNP_h = ut.cv2np(img_h)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L132_C8", "label": "self.imNP_s = cv2np()", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "vector": [14, 2, 0.3041, 0.0023, 2, 0.44, 0.6667, 538, 3, 1, 0, 0, 366, 10, 1], "semantic": {"name": "self.imNP_s", "arg_names": [], "import_names": [], "rhs_call_name": "cv2np", "annotation": ""}, "snippet": " self.imNP_s = ut.cv2np(img_s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L133_C8", "label": "self.imNP_v = cv2np()", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "vector": [14, 2, 0.3065, 0.0023, 2, 0.44, 0.7222, 223, 3, 1, 0, 0, 366, 10, 1], "semantic": {"name": "self.imNP_v", "arg_names": [], "import_names": [], "rhs_call_name": "cv2np", "annotation": ""}, "snippet": " self.imNP_v = ut.cv2np(img_v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L135_C8", "label": "textures = eigen_texture()", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "vector": [14, 2, 0.3111, 0.0023, 2, 0.44, 0.7778, 215, 3, 1, 0, 0, 5, 10, 1], "semantic": {"name": "textures", "arg_names": [], "import_names": [], "rhs_call_name": "eigen_texture", "annotation": ""}, "snippet": " textures = texture_features.eigen_texture(self.processor.img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L136_C8", "label": "self.imNP_tex1 =", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "vector": [14, 2, 0.3134, 0.0023, 2, 0.44, 0.8333, 409, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.imNP_tex1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.imNP_tex1 = textures[:,:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L137_C8", "label": "self.imNP_tex2 =", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "vector": [14, 2, 0.3157, 0.0023, 2, 0.44, 0.8889, 209, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.imNP_tex2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.imNP_tex2 = textures[:,:,1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L139_C8", "label": "self.debug_before_first_featurevector =", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "vector": [14, 2, 0.3203, 0.0023, 2, 0.44, 0.9444, 355, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.debug_before_first_featurevector", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.debug_before_first_featurevector = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L141_C8", "label": "generate_voi_histogram()", "type": "expression", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "vector": [8, 2, 0.3249, 0.0023, 2, 0.44, 1.0, 609, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "generate_voi_histogram", "arg_names": [], "import_names": [], "rhs_call_name": "generate_voi_histogram", "annotation": ""}, "snippet": " self.generate_voi_histogram(self.processor.point_of_interest,self.processor.voi_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L146_C4", "label": "get_indexvector", "type": "function", "loc": [146, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "vector": [2, 1, 0.3618, 0.053, 1, 0.64, 0.2, 770, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "get_indexvector", "arg_names": ["self", "type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_indexvector(self, type):\n \n var_idx = []\n #start indices\n rh1 = 0 #zhist, normal, eigenvalue1, ev2\n ch1 = rh1 + 6 #hsi zhist, maxheight-diff, tex1, tex2\n ci = ch1 + 25\n end = ci + 4 #"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L148_C8", "label": "var_idx =", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L146_C4", "vector": [14, 2, 0.341, 0.0023, 2, 0.68, 0.0, 719, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "var_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " var_idx = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L150_C8", "label": "rh1 =", "type": "assigned_variable", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L146_C4", "vector": [14, 2, 0.3456, 0.0023, 2, 0.68, 0.1667, 987, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "rh1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rh1 = 0 #zhist, normal, eigenvalue1, ev2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L151_C8", "label": "ch1 =", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L146_C4", "vector": [14, 2, 0.3479, 0.0023, 2, 0.68, 0.3333, 472, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ch1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ch1 = rh1 + 6 #hsi zhist, maxheight-diff, tex1, tex2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L152_C8", "label": "ci =", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L146_C4", "vector": [14, 2, 0.3502, 0.0023, 2, 0.68, 0.5, 916, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ci", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ci = ch1 + 25"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L153_C8", "label": "end =", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L146_C4", "vector": [14, 2, 0.3525, 0.0023, 2, 0.68, 0.6667, 128, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " end = ci + 4 #"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L154_C8", "label": "if", "type": "if", "loc": [154, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L146_C4", "vector": [4, 2, 0.3687, 0.03, 2, 0.68, 0.8333, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type=='range':\n for i in range(rh1, ch1):\n var_idx.append(i) \n elif type=='color':\n for i in range(ch1, end):\n var_idx.append(i) \n #for plotting:\n elif type=='hsvi':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L155_C12", "label": "for i", "type": "for", "loc": [155, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L154_C8", "vector": [6, 3, 0.3583, 0.0046, 3, 0.25, 0.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(rh1, ch1):\n var_idx.append(i) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L156_C16", "label": "append()", "type": "expression", "loc": [156, 156], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L155_C12", "vector": [8, 4, 0.3594, 0.0023, 4, 0.62, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " var_idx.append(i) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L157_C8", "label": "if", "type": "if", "loc": [157, 166], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L154_C8", "vector": [4, 3, 0.3721, 0.023, 3, 0.25, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif type=='color':\n for i in range(ch1, end):\n var_idx.append(i) \n #for plotting:\n elif type=='hsvi':\n for i in range(ci,end):\n var_idx.append(i) \n else: #all"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L158_C12", "label": "for i", "type": "for", "loc": [158, 159], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L157_C8", "vector": [6, 4, 0.3652, 0.0046, 4, 0.99, 0.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(ch1, end):\n var_idx.append(i) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L159_C16", "label": "append()", "type": "expression", "loc": [159, 159], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L158_C12", "vector": [8, 5, 0.3664, 0.0023, 5, 0.73, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " var_idx.append(i) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L161_C8", "label": "if", "type": "if", "loc": [161, 166], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L157_C8", "vector": [4, 4, 0.3767, 0.0138, 4, 0.99, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif type=='hsvi':\n for i in range(ci,end):\n var_idx.append(i) \n else: #all\n for i in range(rh1, end):\n var_idx.append(i) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L162_C12", "label": "for i", "type": "for", "loc": [162, 163], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L161_C8", "vector": [6, 5, 0.3744, 0.0046, 5, 0.28, 0.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(ci,end):\n var_idx.append(i) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L163_C16", "label": "append()", "type": "expression", "loc": [163, 163], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L162_C12", "vector": [8, 6, 0.3756, 0.0023, 6, 0.36, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " var_idx.append(i) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L165_C12", "label": "for i", "type": "for", "loc": [165, 166], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L161_C8", "vector": [6, 5, 0.3813, 0.0046, 5, 0.28, 1.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(rh1, end):\n var_idx.append(i) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L166_C16", "label": "append()", "type": "expression", "loc": [166, 166], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L165_C12", "vector": [8, 6, 0.3825, 0.0023, 6, 0.42, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " var_idx.append(i) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L168_C8", "label": "return", "type": "return", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L146_C4", "vector": [13, 2, 0.3871, 0.0023, 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 np.array(var_idx) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "label": "get_featurevector", "type": "function", "loc": [173, 265], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "vector": [2, 1, 0.5046, 0.2143, 1, 0.64, 0.3, 16, 0, 4, 1, 0, 0, 0, 39], "semantic": {"name": "get_featurevector", "arg_names": ["self", "index", "count", "pts"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_featurevector(self, index, count, pts = None):\n if pts == None:\n pts = self.processor.pts3d_bound\n\n #print 'i',index,'c', count\n fv = []\n \n indices = np.asarray(self.kdtree_queried_indices[count])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L174_C8", "label": "if", "type": "if", "loc": [174, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [4, 2, 0.4021, 0.0046, 2, 0.6, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pts == None:\n pts = self.processor.pts3d_bound"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L175_C12", "label": "pts =", "type": "assigned_variable", "loc": [175, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L174_C8", "vector": [14, 3, 0.4032, 0.0023, 3, 0.62, 0.0, 195, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = self.processor.pts3d_bound"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L178_C8", "label": "fv =", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.4101, 0.0023, 2, 0.6, 0.0256, 914, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "fv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fv = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L180_C8", "label": "indices = asarray()", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.4147, 0.0023, 2, 0.6, 0.0513, 478, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "indices", "arg_names": [], "import_names": [], "rhs_call_name": "asarray", "annotation": ""}, "snippet": " indices = np.asarray(self.kdtree_queried_indices[count])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L181_C8", "label": "invalid_value =", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.4171, 0.0023, 2, 0.6, 0.0769, 952, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "invalid_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " invalid_value = np.shape(pts)[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L184_C8", "label": "indices =", "type": "assigned_variable", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.424, 0.0023, 2, 0.6, 0.1026, 478, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "indices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " indices = indices[indices != invalid_value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L188_C8", "label": "a =", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.4332, 0.0023, 2, 0.6, 0.1282, 475, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " a = pts[:,indices]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L189_C8", "label": "view = rotate_to_plane()", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.4355, 0.0023, 2, 0.6, 0.1538, 781, 3, 2, 0, 0, 639, 10, 2], "semantic": {"name": "view", "arg_names": [], "import_names": [], "rhs_call_name": "rotate_to_plane", "annotation": ""}, "snippet": " view = processor.rotate_to_plane(self.processor.scan_dataset.ground_plane_normal, np.matrix([-1,0,0.]).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L190_C8", "label": "normal, eigenvalues = gaussian_curvature()", "type": "assigned_variable", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.4378, 0.0023, 2, 0.6, 0.1795, 21, 3, 2, 0, 0, 973, 10, 1], "semantic": {"name": "normal, eigenvalues", "arg_names": [], "import_names": [], "rhs_call_name": "gaussian_curvature", "annotation": ""}, "snippet": " normal, eigenvalues = gaussian_curvature.gaussian_curvature(a,view)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L197_C8", "label": "point =", "type": "assigned_variable", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.4539, 0.0023, 2, 0.6, 0.2051, 16, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point = pts[:,index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L199_C8", "label": "ev1, ev2 = get_voi_histogram_spread()", "type": "assigned_variable", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.4585, 0.0023, 2, 0.6, 0.2308, 234, 3, 1, 0, 0, 369, 10, 1], "semantic": {"name": "ev1, ev2", "arg_names": [], "import_names": [], "rhs_call_name": "get_voi_histogram_spread", "annotation": ""}, "snippet": " ev1, ev2 = self.get_voi_histogram_spread(point)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L204_C8", "label": "h =", "type": "assigned_variable", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.47, 0.0023, 2, 0.6, 0.2564, 686, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h = self.imNP_h[self.processor.map2d[1,index],self.processor.map2d[0,index]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L205_C8", "label": "s =", "type": "assigned_variable", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.4724, 0.0023, 2, 0.6, 0.2821, 553, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s = self.imNP_s[self.processor.map2d[1,index],self.processor.map2d[0,index]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L206_C8", "label": "i =", "type": "assigned_variable", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.4747, 0.0023, 2, 0.6, 0.3077, 826, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = self.processor.intensities_bound[index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L207_C8", "label": "hsi = get_voi_hsi_histogram_values()", "type": "assigned_variable", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.477, 0.0023, 2, 0.6, 0.3333, 146, 3, 4, 0, 0, 393, 10, 1], "semantic": {"name": "hsi", "arg_names": [], "import_names": [], "rhs_call_name": "get_voi_hsi_histogram_values", "annotation": ""}, "snippet": " hsi = self.get_voi_hsi_histogram_values(point,h,s,i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L211_C8", "label": "tex1 =", "type": "assigned_variable", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.4862, 0.0023, 2, 0.6, 0.359, 476, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tex1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tex1 = self.imNP_tex1[self.processor.map2d[1,index],self.processor.map2d[0,index]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L212_C8", "label": "tex2 =", "type": "assigned_variable", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.4885, 0.0023, 2, 0.6, 0.3846, 839, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tex2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tex2 = self.imNP_tex2[self.processor.map2d[1,index],self.processor.map2d[0,index]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L218_C8", "label": "colors_h =", "type": "assigned_variable", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.5023, 0.0023, 2, 0.6, 0.4103, 333, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "colors_h", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " colors_h = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L219_C8", "label": "colors_s =", "type": "assigned_variable", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.5046, 0.0023, 2, 0.6, 0.4359, 786, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "colors_s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " colors_s = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L220_C8", "label": "colors_v =", "type": "assigned_variable", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.5069, 0.0023, 2, 0.6, 0.4615, 442, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "colors_v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " colors_v = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L221_C8", "label": "for idx", "type": "for", "loc": [221, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [6, 2, 0.5127, 0.0092, 2, 0.6, 0.4872, 187, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for idx in indices:\n colors_h.append(float(self.imNP_h[self.processor.map2d[1,idx],self.processor.map2d[0,idx]]))\n colors_s.append(float(self.imNP_s[self.processor.map2d[1,idx],self.processor.map2d[0,idx]]))\n colors_v.append(float(self.imNP_v[self.processor.map2d[1,idx],self.processor.map2d[0,idx]]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L222_C12", "label": "append()", "type": "expression", "loc": [222, 222], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L221_C8", "vector": [8, 3, 0.5115, 0.0023, 3, 0.26, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " colors_h.append(float(self.imNP_h[self.processor.map2d[1,idx],self.processor.map2d[0,idx]]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L223_C12", "label": "append()", "type": "expression", "loc": [223, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L221_C8", "vector": [8, 3, 0.5138, 0.0023, 3, 0.26, 0.5, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " colors_s.append(float(self.imNP_s[self.processor.map2d[1,idx],self.processor.map2d[0,idx]]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L224_C12", "label": "append()", "type": "expression", "loc": [224, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L221_C8", "vector": [8, 3, 0.5161, 0.0023, 3, 0.26, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " colors_v.append(float(self.imNP_v[self.processor.map2d[1,idx],self.processor.map2d[0,idx]]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L226_C8", "label": "color_hist = histogram2()", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.5207, 0.0023, 2, 0.6, 0.5128, 750, 3, 2, 0, 0, 671, 10, 2], "semantic": {"name": "color_hist", "arg_names": [], "import_names": [], "rhs_call_name": "histogram2", "annotation": ""}, "snippet": " color_hist = stats.histogram2(np.array(colors_h), [0,51,102,153,204])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L227_C8", "label": "color_hist =", "type": "assigned_variable", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.523, 0.0023, 2, 0.6, 0.5385, 750, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "color_hist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " color_hist = color_hist / float(np.sum(color_hist))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L228_C8", "label": "color_hist = list()", "type": "assigned_variable", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.5253, 0.0023, 2, 0.6, 0.5641, 750, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "color_hist", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " color_hist = list(color_hist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L230_C8", "label": "color_hist = histogram2()", "type": "assigned_variable", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.53, 0.0023, 2, 0.6, 0.5897, 750, 3, 2, 0, 0, 671, 10, 2], "semantic": {"name": "color_hist", "arg_names": [], "import_names": [], "rhs_call_name": "histogram2", "annotation": ""}, "snippet": " color_hist = stats.histogram2(np.array(colors_s), [0,51,102,153,204])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L231_C8", "label": "color_hist =", "type": "assigned_variable", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.5323, 0.0023, 2, 0.6, 0.6154, 750, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "color_hist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " color_hist = color_hist / float(np.sum(color_hist))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L232_C8", "label": "color_hist = list()", "type": "assigned_variable", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.5346, 0.0023, 2, 0.6, 0.641, 750, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "color_hist", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " color_hist = list(color_hist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L234_C8", "label": "color_hist = histogram2()", "type": "assigned_variable", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.5392, 0.0023, 2, 0.6, 0.6667, 750, 3, 2, 0, 0, 671, 10, 2], "semantic": {"name": "color_hist", "arg_names": [], "import_names": [], "rhs_call_name": "histogram2", "annotation": ""}, "snippet": " color_hist = stats.histogram2(np.array(colors_v), [0,51,102,153,204])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L235_C8", "label": "color_hist =", "type": "assigned_variable", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.5415, 0.0023, 2, 0.6, 0.6923, 750, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "color_hist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " color_hist = color_hist / float(np.sum(color_hist))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L236_C8", "label": "color_hist = list()", "type": "assigned_variable", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.5438, 0.0023, 2, 0.6, 0.7179, 750, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "color_hist", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " color_hist = list(color_hist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L240_C8", "label": "intensities =", "type": "assigned_variable", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.553, 0.0023, 2, 0.6, 0.7436, 725, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "intensities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " intensities = self.processor.intensities_bound[indices]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L241_C8", "label": "intensities = asarray()", "type": "assigned_variable", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.5553, 0.0023, 2, 0.6, 0.7692, 725, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "intensities", "arg_names": [], "import_names": [], "rhs_call_name": "asarray", "annotation": ""}, "snippet": " intensities = np.asarray(intensities)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L243_C8", "label": "intensities =", "type": "assigned_variable", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.5599, 0.0023, 2, 0.6, 0.7949, 725, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "intensities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " intensities = intensities / 10000 * 255"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L244_C8", "label": "intensity_hist = histogram2()", "type": "assigned_variable", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.5622, 0.0023, 2, 0.6, 0.8205, 310, 3, 2, 0, 0, 671, 10, 1], "semantic": {"name": "intensity_hist", "arg_names": [], "import_names": [], "rhs_call_name": "histogram2", "annotation": ""}, "snippet": " intensity_hist = stats.histogram2(intensities, [0,51,102,153,204])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L245_C8", "label": "intensity_hist =", "type": "assigned_variable", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.5645, 0.0023, 2, 0.6, 0.8462, 310, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "intensity_hist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " intensity_hist = intensity_hist / float(np.sum(intensity_hist))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L246_C8", "label": "intensity_hist = list()", "type": "assigned_variable", "loc": [246, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.5668, 0.0023, 2, 0.6, 0.8718, 310, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "intensity_hist", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " intensity_hist = list(intensity_hist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L255_C8", "label": "intensity =", "type": "assigned_variable", "loc": [255, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.5876, 0.0023, 2, 0.6, 0.8974, 845, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "intensity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " intensity = self.processor.intensities_bound[index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L257_C8", "label": "intensity =", "type": "assigned_variable", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.5922, 0.0023, 2, 0.6, 0.9231, 845, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "intensity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " intensity = intensity / 15000.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L258_C8", "label": "intensity =", "type": "assigned_variable", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [14, 2, 0.5945, 0.0023, 2, 0.6, 0.9487, 845, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "intensity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " intensity = [intensity]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L262_C8", "label": "if", "type": "if", "loc": [262, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [4, 2, 0.606, 0.0069, 2, 0.6, 0.9744, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.debug_before_first_featurevector == True:\n self.debug_before_first_featurevector = False\n print(getTime(), 'feature vector sample(gaussian histograms):', fv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L263_C12", "label": "self.debug_before_first_featurevector =", "type": "assigned_variable", "loc": [263, 263], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L262_C8", "vector": [14, 3, 0.606, 0.0023, 3, 0.54, 0.0, 355, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.debug_before_first_featurevector", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.debug_before_first_featurevector = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L264_C12", "label": "print()", "type": "expression", "loc": [264, 264], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L262_C8", "vector": [8, 3, 0.6083, 0.0023, 3, 0.54, 1.0, 535, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(getTime(), 'feature vector sample(gaussian histograms):', fv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L265_C8", "label": "return", "type": "return", "loc": [265, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "vector": [13, 2, 0.6106, 0.0023, 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 fv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "label": "generate_voi_histogram", "type": "function", "loc": [270, 356], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "vector": [2, 1, 0.7212, 0.2005, 1, 0.64, 0.4, 609, 0, 3, 0, 0, 0, 0, 40], "semantic": {"name": "generate_voi_histogram", "arg_names": ["self", "poi", "width"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def generate_voi_histogram(self, poi, width):\n print('poi',poi,'width',width)\n pts_indices = self.get_voi_pts_indices(poi, width)\n self.voi_pts_indices = pts_indices\n pts = np.asarray(self.processor.pts3d_bound)\n pts = pts[:,pts_indices]\n self.voi_pts = pts\n #mlab.points3d(pts[0,:],pts[1,:],pts[2,:], mode='point')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L271_C8", "label": "print()", "type": "expression", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [8, 2, 0.6244, 0.0023, 2, 0.06, 0.0, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('poi',poi,'width',width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L272_C8", "label": "pts_indices = get_voi_pts_indices()", "type": "assigned_variable", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.6267, 0.0023, 2, 0.06, 0.0286, 685, 3, 2, 0, 0, 893, 10, 1], "semantic": {"name": "pts_indices", "arg_names": [], "import_names": [], "rhs_call_name": "get_voi_pts_indices", "annotation": ""}, "snippet": " pts_indices = self.get_voi_pts_indices(poi, width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L273_C8", "label": "self.voi_pts_indices =", "type": "assigned_variable", "loc": [273, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.629, 0.0023, 2, 0.06, 0.0571, 386, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.voi_pts_indices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.voi_pts_indices = pts_indices"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L274_C8", "label": "pts = asarray()", "type": "assigned_variable", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.6313, 0.0023, 2, 0.06, 0.0857, 195, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "asarray", "annotation": ""}, "snippet": " pts = np.asarray(self.processor.pts3d_bound)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L275_C8", "label": "pts =", "type": "assigned_variable", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.6336, 0.0023, 2, 0.06, 0.1143, 195, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = pts[:,pts_indices]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L276_C8", "label": "self.voi_pts =", "type": "assigned_variable", "loc": [276, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.6359, 0.0023, 2, 0.06, 0.1429, 848, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.voi_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.voi_pts = pts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L279_C8", "label": "min =", "type": "assigned_variable", "loc": [279, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.6429, 0.0023, 2, 0.06, 0.1714, 867, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "min", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L280_C8", "label": "max =", "type": "assigned_variable", "loc": [280, 280], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.6452, 0.0023, 2, 0.06, 0.2, 442, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "max", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max = 2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L281_C8", "label": "self.voi_bincount =", "type": "assigned_variable", "loc": [281, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.6475, 0.0023, 2, 0.06, 0.2286, 576, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.voi_bincount", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.voi_bincount = 80"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L282_C8", "label": "self.voi_interval_size =", "type": "assigned_variable", "loc": [282, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.6498, 0.0023, 2, 0.06, 0.2571, 497, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.voi_interval_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.voi_interval_size = max - min"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L283_C8", "label": "bins =", "type": "assigned_variable", "loc": [283, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.6521, 0.0023, 2, 0.06, 0.2857, 792, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "bins", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bins = np.asarray(range(self.voi_bincount)) * self.voi_interval_size/float(self.voi_bincount)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L285_C8", "label": "hist =", "type": "assigned_variable", "loc": [285, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.6567, 0.0023, 2, 0.06, 0.3143, 353, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "hist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hist = stats.histogram2(pts[2],bins) / float(len(pts[2]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L288_C8", "label": "self.z_hist =", "type": "assigned_variable", "loc": [288, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.6636, 0.0023, 2, 0.06, 0.3429, 518, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.z_hist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.z_hist = hist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L289_C8", "label": "self.z_hist_bins =", "type": "assigned_variable", "loc": [289, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.6659, 0.0023, 2, 0.06, 0.3714, 481, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.z_hist_bins", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.z_hist_bins = bins"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L291_C8", "label": "slices = get_voi_slice_indices()", "type": "assigned_variable", "loc": [291, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.6705, 0.0023, 2, 0.06, 0.4, 711, 3, 0, 0, 0, 992, 10, 1], "semantic": {"name": "slices", "arg_names": [], "import_names": [], "rhs_call_name": "get_voi_slice_indices", "annotation": ""}, "snippet": " slices = self.get_voi_slice_indices()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L292_C8", "label": "self.z_hist_slices_indices =", "type": "assigned_variable", "loc": [292, 292], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.6728, 0.0023, 2, 0.06, 0.4286, 354, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.z_hist_slices_indices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.z_hist_slices_indices = slices"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L295_C8", "label": "self.z_hist_spread =", "type": "assigned_variable", "loc": [295, 295], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.6797, 0.0023, 2, 0.06, 0.4571, 260, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.z_hist_spread", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.z_hist_spread = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L296_C8", "label": "for indices", "type": "for", "loc": [296, 299], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [6, 2, 0.6855, 0.0092, 2, 0.06, 0.4857, 478, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "indices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for indices in self.z_hist_slices_indices:\n a = self.processor.pts3d_bound[:,indices]\n u, ev12 = gaussian_curvature.spread(a)\n self.z_hist_spread += [(ev12[0], ev12[1])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L297_C12", "label": "a =", "type": "assigned_variable", "loc": [297, 297], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L296_C8", "vector": [14, 3, 0.6843, 0.0023, 3, 0.65, 0.0, 475, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " a = self.processor.pts3d_bound[:,indices]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L298_C12", "label": "u, ev12 = spread()", "type": "assigned_variable", "loc": [298, 298], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L296_C8", "vector": [14, 3, 0.6866, 0.0023, 3, 0.65, 1.0, 745, 3, 1, 0, 0, 301, 10, 1], "semantic": {"name": "u, ev12", "arg_names": [], "import_names": [], "rhs_call_name": "spread", "annotation": ""}, "snippet": " u, ev12 = gaussian_curvature.spread(a)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L302_C8", "label": "pts_h =", "type": "assigned_variable", "loc": [302, 302], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.6959, 0.0023, 2, 0.06, 0.5143, 243, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pts_h", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_h = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L303_C8", "label": "pts_s =", "type": "assigned_variable", "loc": [303, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.6982, 0.0023, 2, 0.06, 0.5429, 452, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pts_s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_s = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L305_C8", "label": "n, m = shape()", "type": "assigned_variable", "loc": [305, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.7028, 0.0023, 2, 0.06, 0.5714, 51, 3, 1, 0, 0, 381, 10, 2], "semantic": {"name": "n, m", "arg_names": [], "import_names": [], "rhs_call_name": "shape", "annotation": ""}, "snippet": " n,m = np.shape(np.asarray(self.processor.pts3d_bound))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L307_C8", "label": "for index", "type": "for", "loc": [307, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [6, 2, 0.7085, 0.0046, 2, 0.06, 0.6, 780, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index in range(m):\n pts_h.append(float(self.imNP_h[self.processor.map2d[1,index],self.processor.map2d[0,index]]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L308_C12", "label": "append()", "type": "expression", "loc": [308, 308], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L307_C8", "vector": [8, 3, 0.7097, 0.0023, 3, 0.12, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " pts_h.append(float(self.imNP_h[self.processor.map2d[1,index],self.processor.map2d[0,index]]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L309_C8", "label": "for index", "type": "for", "loc": [309, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [6, 2, 0.7131, 0.0046, 2, 0.06, 0.6286, 780, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index in range(m):\n pts_s.append(float(self.imNP_s[self.processor.map2d[1,index],self.processor.map2d[0,index]]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L310_C12", "label": "append()", "type": "expression", "loc": [310, 310], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L309_C8", "vector": [8, 3, 0.7143, 0.0023, 3, 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": " pts_s.append(float(self.imNP_s[self.processor.map2d[1,index],self.processor.map2d[0,index]]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L311_C8", "label": "pts_i = asarray()", "type": "assigned_variable", "loc": [311, 311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.7166, 0.0023, 2, 0.06, 0.6571, 72, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "pts_i", "arg_names": [], "import_names": [], "rhs_call_name": "asarray", "annotation": ""}, "snippet": " pts_i = np.asarray(self.processor.intensities_bound)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L313_C8", "label": "if", "type": "if", "loc": [313, 316], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [4, 2, 0.7247, 0.0092, 2, 0.06, 0.6857, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.max(pts_i) > 0:\n self.intensity_normalization_factor = 1.0 / float(np.max(pts_i)) * 255\n else:\n self.intensity_normalization_factor = 1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L314_C12", "label": "self.intensity_normalization_factor =", "type": "assigned_variable", "loc": [314, 314], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L313_C8", "vector": [14, 3, 0.7235, 0.0023, 3, 0.17, 0.0, 859, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "self.intensity_normalization_factor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.intensity_normalization_factor = 1.0 / float(np.max(pts_i)) * 255"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L316_C12", "label": "self.intensity_normalization_factor =", "type": "assigned_variable", "loc": [316, 316], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L313_C8", "vector": [14, 3, 0.7281, 0.0023, 3, 0.17, 1.0, 859, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.intensity_normalization_factor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.intensity_normalization_factor = 1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L320_C8", "label": "pts_h = asarray()", "type": "assigned_variable", "loc": [320, 320], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.7373, 0.0023, 2, 0.06, 0.7143, 243, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "pts_h", "arg_names": [], "import_names": [], "rhs_call_name": "asarray", "annotation": ""}, "snippet": " pts_h = np.asarray(pts_h)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L321_C8", "label": "pts_s = asarray()", "type": "assigned_variable", "loc": [321, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.7396, 0.0023, 2, 0.06, 0.7429, 452, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "pts_s", "arg_names": [], "import_names": [], "rhs_call_name": "asarray", "annotation": ""}, "snippet": " pts_s = np.asarray(pts_s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L322_C8", "label": "self.z_hist_h_hists =", "type": "assigned_variable", "loc": [322, 322], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.7419, 0.0023, 2, 0.06, 0.7714, 383, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.z_hist_h_hists", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.z_hist_h_hists = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L323_C8", "label": "self.z_hist_s_hists =", "type": "assigned_variable", "loc": [323, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.7442, 0.0023, 2, 0.06, 0.8, 362, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.z_hist_s_hists", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.z_hist_s_hists = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L324_C8", "label": "self.z_hist_i_hists =", "type": "assigned_variable", "loc": [324, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.7465, 0.0023, 2, 0.06, 0.8286, 73, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.z_hist_i_hists", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.z_hist_i_hists = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L327_C8", "label": "max_count =", "type": "assigned_variable", "loc": [327, 327], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.7535, 0.0023, 2, 0.06, 0.8571, 632, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "max_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L328_C8", "label": "max_count_index =", "type": "assigned_variable", "loc": [328, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.7558, 0.0023, 2, 0.06, 0.8857, 606, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "max_count_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_count_index = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L329_C8", "label": "for count_idx, indices", "type": "for", "loc": [329, 333], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [6, 2, 0.7627, 0.0115, 2, 0.06, 0.9143, 719, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "count_idx, indices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for count_idx, indices in enumerate(slices):\n n = np.shape(indices)\n if n[0] > max_count:\n max_count = n[0]\n max_count_index = count_idx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L330_C12", "label": "n = shape()", "type": "assigned_variable", "loc": [330, 330], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L329_C8", "vector": [14, 3, 0.7604, 0.0023, 3, 0.56, 0.0, 773, 3, 1, 0, 0, 381, 10, 1], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "shape", "annotation": ""}, "snippet": " n = np.shape(indices)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L331_C12", "label": "if", "type": "if", "loc": [331, 333], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L329_C8", "vector": [4, 3, 0.765, 0.0069, 3, 0.56, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n[0] > max_count:\n max_count = n[0]\n max_count_index = count_idx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L332_C16", "label": "max_count =", "type": "assigned_variable", "loc": [332, 332], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L331_C12", "vector": [14, 4, 0.765, 0.0023, 4, 0.75, 0.0, 632, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_count = n[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L333_C16", "label": "max_count_index =", "type": "assigned_variable", "loc": [333, 333], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L331_C12", "vector": [14, 4, 0.7673, 0.0023, 4, 0.75, 1.0, 606, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_count_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_count_index = count_idx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L334_C8", "label": "slize_height =", "type": "assigned_variable", "loc": [334, 334], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.7696, 0.0023, 2, 0.06, 0.9429, 120, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "slize_height", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " slize_height = (self.voi_interval_size / float(self.voi_bincount))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L335_C8", "label": "self.z_hist_height_max =", "type": "assigned_variable", "loc": [335, 335], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [14, 2, 0.7719, 0.0023, 2, 0.06, 0.9714, 568, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.z_hist_height_max", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.z_hist_height_max = slize_height * (max_count_index + 0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "label": "for indices", "type": "for", "loc": [339, 356], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "vector": [6, 2, 0.8007, 0.0415, 2, 0.06, 1.0, 478, 2, 0, 0, 0, 0, 0, 12], "semantic": {"name": "indices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for indices in slices:\n pts_h_slice = pts_h[indices]\n pts_s_slice = pts_s[indices]\n pts_i_slice = pts_i[indices]\n self.hsi_hist_bincount = 5\n bins = np.asarray(range(0,self.hsi_hist_bincount))*float(255.0/float(self.hsi_hist_bincount))\n #print bins\n #todo: smooth with kernel fct"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L340_C12", "label": "pts_h_slice =", "type": "assigned_variable", "loc": [340, 340], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "vector": [14, 3, 0.7834, 0.0023, 3, 0.52, 0.0, 567, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_h_slice", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_h_slice = pts_h[indices]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L341_C12", "label": "pts_s_slice =", "type": "assigned_variable", "loc": [341, 341], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "vector": [14, 3, 0.7857, 0.0023, 3, 0.52, 0.0833, 64, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_s_slice", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_s_slice = pts_s[indices]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L342_C12", "label": "pts_i_slice =", "type": "assigned_variable", "loc": [342, 342], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "vector": [14, 3, 0.788, 0.0023, 3, 0.52, 0.1667, 976, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_i_slice", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_i_slice = pts_i[indices]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L343_C12", "label": "self.hsi_hist_bincount =", "type": "assigned_variable", "loc": [343, 343], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "vector": [14, 3, 0.7903, 0.0023, 3, 0.52, 0.25, 540, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.hsi_hist_bincount", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.hsi_hist_bincount = 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L344_C12", "label": "bins =", "type": "assigned_variable", "loc": [344, 344], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "vector": [14, 3, 0.7926, 0.0023, 3, 0.52, 0.3333, 792, 4, 0, 0, 0, 0, 0, 4], "semantic": {"name": "bins", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bins = np.asarray(range(0,self.hsi_hist_bincount))*float(255.0/float(self.hsi_hist_bincount))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L347_C12", "label": "count = float()", "type": "assigned_variable", "loc": [347, 347], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "vector": [14, 3, 0.7995, 0.0023, 3, 0.52, 0.4167, 778, 3, 1, 0, 0, 639, 10, 2], "semantic": {"name": "count", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": " count = float(len(pts_h_slice))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L348_C12", "label": "if", "type": "if", "loc": [348, 349], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "vector": [4, 3, 0.803, 0.0046, 3, 0.52, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if count == 0: \n count = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L349_C16", "label": "count =", "type": "assigned_variable", "loc": [349, 349], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L348_C12", "vector": [14, 4, 0.8041, 0.0023, 4, 0.85, 0.0, 778, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L350_C12", "label": "hist_h =", "type": "assigned_variable", "loc": [350, 350], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "vector": [14, 3, 0.8065, 0.0023, 3, 0.52, 0.5833, 680, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "hist_h", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hist_h = stats.histogram2(pts_h_slice,bins) / count"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L351_C12", "label": "append()", "type": "expression", "loc": [351, 351], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "vector": [8, 3, 0.8088, 0.0023, 3, 0.52, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.z_hist_h_hists.append(hist_h)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L352_C12", "label": "hist_s =", "type": "assigned_variable", "loc": [352, 352], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "vector": [14, 3, 0.8111, 0.0023, 3, 0.52, 0.75, 889, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "hist_s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hist_s = stats.histogram2(pts_s_slice,bins) / count"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L353_C12", "label": "append()", "type": "expression", "loc": [353, 353], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "vector": [8, 3, 0.8134, 0.0023, 3, 0.52, 0.8333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.z_hist_s_hists.append(hist_s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L354_C12", "label": "hist_i =", "type": "assigned_variable", "loc": [354, 354], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "vector": [14, 3, 0.8157, 0.0023, 3, 0.52, 0.9167, 464, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "hist_i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hist_i = stats.histogram2(pts_i_slice,bins) / count"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L356_C12", "label": "append()", "type": "expression", "loc": [356, 356], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "vector": [8, 3, 0.8203, 0.0023, 3, 0.52, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.z_hist_i_hists.append(hist_i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L362_C4", "label": "get_voi_pts_indices", "type": "function", "loc": [362, 370], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "vector": [2, 1, 0.8433, 0.0207, 1, 0.64, 0.5, 893, 0, 3, 1, 0, 0, 0, 7], "semantic": {"name": "get_voi_pts_indices", "arg_names": ["self", "poi", "width"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_voi_pts_indices(self, poi, width):\n pts = np.asarray(self.processor.pts3d_bound)\n #region of interest:\n conditions = np.multiply(np.multiply(np.multiply(np.multiply(np.multiply(pts[0] < poi[0]+width/2.0, pts[0] > poi[0]-width/2.0), \n pts[1] < poi[1]+width/2.0), pts[1] > poi[1]-width/2.0),\n pts[2] < poi[2]+width/2.0), pts[2] > poi[2]-width/2.0)\n \n indices = np.where(conditions)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L363_C8", "label": "pts = asarray()", "type": "assigned_variable", "loc": [363, 363], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L362_C4", "vector": [14, 2, 0.8364, 0.0023, 2, 0.13, 0.0, 195, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "asarray", "annotation": ""}, "snippet": " pts = np.asarray(self.processor.pts3d_bound)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L365_C8", "label": "conditions = multiply()", "type": "assigned_variable", "loc": [365, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L362_C4", "vector": [14, 2, 0.8433, 0.0069, 2, 0.13, 0.3333, 876, 3, 2, 0, 0, 960, 10, 5], "semantic": {"name": "conditions", "arg_names": [], "import_names": [], "rhs_call_name": "multiply", "annotation": ""}, "snippet": " conditions = np.multiply(np.multiply(np.multiply(np.multiply(np.multiply(pts[0] < poi[0]+width/2.0, pts[0] > poi[0]-width/2.0), \n pts[1] < poi[1]+width/2.0), pts[1] > poi[1]-width/2.0),\n pts[2] < poi[2]+width/2.0), pts[2] > poi[2]-width/2.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L369_C8", "label": "indices =", "type": "assigned_variable", "loc": [369, 369], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L362_C4", "vector": [14, 2, 0.8502, 0.0023, 2, 0.13, 0.6667, 478, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "indices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " indices = np.where(conditions)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L370_C8", "label": "return", "type": "return", "loc": [370, 370], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L362_C4", "vector": [13, 2, 0.8525, 0.0023, 2, 0.13, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return indices"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L372_C4", "label": "get_voi_slice_indices", "type": "function", "loc": [372, 384], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "vector": [2, 1, 0.871, 0.03, 1, 0.64, 0.6, 992, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "get_voi_slice_indices", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_voi_slice_indices(self):\n \n slices = []\n last_z = -999999\n \n for z in self.z_hist_bins:\n indices = copy.copy(self.voi_pts_indices)\n pts = self.voi_pts "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L374_C8", "label": "slices =", "type": "assigned_variable", "loc": [374, 374], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L372_C4", "vector": [14, 2, 0.8618, 0.0023, 2, 0.66, 0.0, 711, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "slices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " slices = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L375_C8", "label": "last_z =", "type": "assigned_variable", "loc": [375, 375], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L372_C4", "vector": [14, 2, 0.8641, 0.0023, 2, 0.66, 0.3333, 590, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "last_z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " last_z = -999999"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L377_C8", "label": "for z", "type": "for", "loc": [377, 383], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L372_C4", "vector": [6, 2, 0.8756, 0.0161, 2, 0.66, 0.6667, 859, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for z in self.z_hist_bins:\n indices = copy.copy(self.voi_pts_indices)\n pts = self.voi_pts \n conditions = np.multiply(pts[2] < z, pts[2] > last_z)\n indices = indices[np.where(conditions)[0]] \n slices += [indices]\n last_z = z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L378_C12", "label": "indices = copy()", "type": "assigned_variable", "loc": [378, 378], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L377_C8", "vector": [14, 3, 0.871, 0.0023, 3, 0.08, 0.0, 478, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "indices", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " indices = copy.copy(self.voi_pts_indices)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L379_C12", "label": "pts =", "type": "assigned_variable", "loc": [379, 379], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L377_C8", "vector": [14, 3, 0.8733, 0.0023, 3, 0.08, 0.25, 195, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = self.voi_pts "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L380_C12", "label": "conditions = multiply()", "type": "assigned_variable", "loc": [380, 380], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L377_C8", "vector": [14, 3, 0.8756, 0.0023, 3, 0.08, 0.5, 876, 3, 2, 0, 0, 960, 10, 1], "semantic": {"name": "conditions", "arg_names": [], "import_names": [], "rhs_call_name": "multiply", "annotation": ""}, "snippet": " conditions = np.multiply(pts[2] < z, pts[2] > last_z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L381_C12", "label": "indices =", "type": "assigned_variable", "loc": [381, 381], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L377_C8", "vector": [14, 3, 0.8779, 0.0023, 3, 0.08, 0.75, 478, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "indices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " indices = indices[np.where(conditions)[0]] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L383_C12", "label": "last_z =", "type": "assigned_variable", "loc": [383, 383], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L377_C8", "vector": [14, 3, 0.8825, 0.0023, 3, 0.08, 1.0, 590, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "last_z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " last_z = z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L384_C8", "label": "return", "type": "return", "loc": [384, 384], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L372_C4", "vector": [13, 2, 0.8848, 0.0023, 2, 0.66, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return slices"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L386_C4", "label": "get_voi_histogram_value", "type": "function", "loc": [386, 394], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "vector": [2, 1, 0.8986, 0.0207, 1, 0.64, 0.7, 987, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_voi_histogram_value", "arg_names": ["self", "point"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_voi_histogram_value(self, point):\n z = point[2]\n z = int(z*self.voi_bincount / float(self.voi_interval_size))\n if z >= 0 and z < self.voi_bincount:\n # print z, self.z_hist[z]\n return self.z_hist[z]\n else:\n #print z,0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L387_C8", "label": "z =", "type": "assigned_variable", "loc": [387, 387], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L386_C4", "vector": [14, 2, 0.8917, 0.0023, 2, 0.06, 0.0, 859, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = point[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L388_C8", "label": "z = int()", "type": "assigned_variable", "loc": [388, 388], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L386_C4", "vector": [14, 2, 0.894, 0.0023, 2, 0.06, 0.5, 859, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " z = int(z*self.voi_bincount / float(self.voi_interval_size))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L389_C8", "label": "if", "type": "if", "loc": [389, 394], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L386_C4", "vector": [4, 2, 0.9021, 0.0138, 2, 0.06, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if z >= 0 and z < self.voi_bincount:\n # print z, self.z_hist[z]\n return self.z_hist[z]\n else:\n #print z,0\n return 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L391_C12", "label": "return", "type": "return", "loc": [391, 391], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L389_C8", "vector": [13, 3, 0.9009, 0.0023, 3, 0.19, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.z_hist[z]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L394_C12", "label": "return", "type": "return", "loc": [394, 394], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L389_C8", "vector": [13, 3, 0.9078, 0.0023, 3, 0.19, 1.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_99735:FunctionDef_L396_C4", "label": "get_voi_histogram_spread", "type": "function", "loc": [396, 409], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "vector": [2, 1, 0.9274, 0.0323, 1, 0.64, 0.8, 369, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_voi_histogram_spread", "arg_names": ["self", "point"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_voi_histogram_spread(self, point):\n z = point[2]\n z = int(z*self.voi_bincount / float(self.voi_interval_size))\n if z >= 0 and z < self.voi_bincount:\n# indices = self.z_hist_slices_indices[z]\n# a = self.processor.pts3d_bound[:,indices]\n# u, ev12 = gaussian_curvature.spread(a)\n# if abs(self.z_hist_spread[z][0] - ev12[0]) > 0.0000000001 or abs(self.z_hist_spread[z][1] - ev12[1]) > 0.0000000001:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L397_C8", "label": "z =", "type": "assigned_variable", "loc": [397, 397], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L396_C4", "vector": [14, 2, 0.9147, 0.0023, 2, 0.5, 0.0, 859, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = point[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L398_C8", "label": "z = int()", "type": "assigned_variable", "loc": [398, 398], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L396_C4", "vector": [14, 2, 0.9171, 0.0023, 2, 0.5, 0.5, 859, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " z = int(z*self.voi_bincount / float(self.voi_interval_size))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L399_C8", "label": "if", "type": "if", "loc": [399, 409], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L396_C4", "vector": [4, 2, 0.9309, 0.0253, 2, 0.5, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if z >= 0 and z < self.voi_bincount:\n# indices = self.z_hist_slices_indices[z]\n# a = self.processor.pts3d_bound[:,indices]\n# u, ev12 = gaussian_curvature.spread(a)\n# if abs(self.z_hist_spread[z][0] - ev12[0]) > 0.0000000001 or abs(self.z_hist_spread[z][1] - ev12[1]) > 0.0000000001:\n# print 'ERROR', self.z_hist_spread[z], '!=', (ev12[0], ev12[1])\n# return ev12[0], ev12[1]\n return self.z_hist_spread[z]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L406_C12", "label": "return", "type": "return", "loc": [406, 406], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L399_C8", "vector": [13, 3, 0.9355, 0.0023, 3, 0.64, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.z_hist_spread[z]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L409_C12", "label": "return", "type": "return", "loc": [409, 409], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L399_C8", "vector": [13, 3, 0.9424, 0.0023, 3, 0.64, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 0, 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L412_C4", "label": "get_voi_hsi_histogram_values", "type": "function", "loc": [412, 429], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "vector": [2, 1, 0.9689, 0.0415, 1, 0.64, 0.9, 393, 0, 5, 1, 0, 0, 0, 5], "semantic": {"name": "get_voi_hsi_histogram_values", "arg_names": ["self", "point", "h", "s", "i"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_voi_hsi_histogram_values(self, point,h ,s, i):\n z = point[2]\n z = int(z*self.voi_bincount / float(self.voi_interval_size))\n if z >= 0 and z < self.voi_bincount:\n h_index = int(h * self.hsi_hist_bincount / 255.0)\n s_index = int(s * self.hsi_hist_bincount / 255.0)\n i *= self.intensity_normalization_factor\n i_index = int(i * self.hsi_hist_bincount / 255.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L413_C8", "label": "z =", "type": "assigned_variable", "loc": [413, 413], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L412_C4", "vector": [14, 2, 0.9516, 0.0023, 2, 0.51, 0.0, 859, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = point[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L414_C8", "label": "z = int()", "type": "assigned_variable", "loc": [414, 414], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L412_C4", "vector": [14, 2, 0.9539, 0.0023, 2, 0.51, 0.5, 859, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " z = int(z*self.voi_bincount / float(self.voi_interval_size))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L415_C8", "label": "if", "type": "if", "loc": [415, 429], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L412_C4", "vector": [4, 2, 0.9724, 0.0346, 2, 0.51, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if z >= 0 and z < self.voi_bincount:\n h_index = int(h * self.hsi_hist_bincount / 255.0)\n s_index = int(s * self.hsi_hist_bincount / 255.0)\n i *= self.intensity_normalization_factor\n i_index = int(i * self.hsi_hist_bincount / 255.0)\n \n h_hist = self.z_hist_h_hists[z][h_index]\n s_hist = self.z_hist_s_hists[z][s_index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L416_C12", "label": "h_index = int()", "type": "assigned_variable", "loc": [416, 416], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L415_C8", "vector": [14, 3, 0.9585, 0.0023, 3, 0.13, 0.0, 401, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "h_index", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " h_index = int(h * self.hsi_hist_bincount / 255.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L417_C12", "label": "s_index = int()", "type": "assigned_variable", "loc": [417, 417], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L415_C8", "vector": [14, 3, 0.9608, 0.0023, 3, 0.13, 0.1429, 875, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "s_index", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " s_index = int(s * self.hsi_hist_bincount / 255.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L419_C12", "label": "i_index = int()", "type": "assigned_variable", "loc": [419, 419], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L415_C8", "vector": [14, 3, 0.9654, 0.0023, 3, 0.13, 0.2857, 452, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "i_index", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " i_index = int(i * self.hsi_hist_bincount / 255.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L421_C12", "label": "h_hist =", "type": "assigned_variable", "loc": [421, 421], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L415_C8", "vector": [14, 3, 0.97, 0.0023, 3, 0.13, 0.4286, 148, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "h_hist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h_hist = self.z_hist_h_hists[z][h_index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L422_C12", "label": "s_hist =", "type": "assigned_variable", "loc": [422, 422], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L415_C8", "vector": [14, 3, 0.9724, 0.0023, 3, 0.13, 0.5714, 800, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "s_hist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s_hist = self.z_hist_s_hists[z][s_index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L425_C12", "label": "i_hist =", "type": "assigned_variable", "loc": [425, 425], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L415_C8", "vector": [14, 3, 0.9793, 0.0023, 3, 0.13, 0.7143, 663, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i_hist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i_hist = self.z_hist_i_hists[z][i_index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L426_C12", "label": "return", "type": "return", "loc": [426, 426], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L415_C8", "vector": [13, 3, 0.9816, 0.0023, 3, 0.13, 0.8571, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return h_hist, s_hist, i_hist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L429_C12", "label": "return", "type": "return", "loc": [429, 429], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L415_C8", "vector": [13, 3, 0.9885, 0.0023, 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 0, 0, 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L431_C4", "label": "get_voi_maxcount_height", "type": "function", "loc": [431, 432], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "vector": [2, 1, 0.9942, 0.0046, 1, 0.64, 1.0, 837, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_voi_maxcount_height", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_voi_maxcount_height(self):\n return self.z_hist_height_max"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L432_C8", "label": "return", "type": "return", "loc": [432, 432], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L431_C4", "vector": [13, 2, 0.9954, 0.0023, 2, 0.14, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.z_hist_height_max"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L65_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L66_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L65_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L67_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L65_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L69_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L65_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L70_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L75_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L76_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L78_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L79_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L80_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L80_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L81_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L93_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L94_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L93_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L95_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L93_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L100_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L100_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L101_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L154_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L155_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L156_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L154_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L157_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L158_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L159_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L157_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L162_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L162_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L163_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L165_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L166_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L174_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L175_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L221_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L222_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L221_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L223_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L221_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L224_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L262_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L263_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L262_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L264_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L280_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L285_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L288_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L289_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L291_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L292_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L295_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L296_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L296_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L297_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L296_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L298_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L302_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L303_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L305_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L308_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L309_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L310_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L311_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L313_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L314_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L313_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L316_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L320_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L322_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L323_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L324_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L327_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L328_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L329_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L329_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L330_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L329_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L331_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L331_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L332_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L331_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L333_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L334_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L335_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L340_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L341_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L342_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L343_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L344_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L347_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L348_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L348_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L349_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L350_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L351_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L352_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L353_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L354_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L339_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Expr_L356_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L362_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L362_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L363_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L362_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L365_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L362_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L369_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L362_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L370_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L372_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L372_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L374_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L372_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L375_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L372_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L377_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L377_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L378_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L377_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L379_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L377_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L380_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L377_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L381_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:For_L377_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L383_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L372_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L384_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L386_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L386_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L387_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L386_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L388_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L386_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L389_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L389_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L391_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L389_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L394_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L396_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L397_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L398_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L399_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L399_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L406_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L399_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L409_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L412_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L412_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L413_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L412_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L414_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L412_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L415_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L415_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L416_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L415_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L417_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L415_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L419_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L415_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L421_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L415_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L422_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L415_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Assign_L425_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L415_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L426_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:If_L415_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L429_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L431_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99735:FunctionDef_L431_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99735:Return_L432_C8"}]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Martin Schuster (Healthcare Robotics Lab, Georgia Tech.) import roslib; roslib.load_manifest('laser_camera_segmentation') import hrl_tilting_hokuyo.tilt_hokuyo_servo as ths #import hokuyo.hokuyo_processing as hp import hrl_hokuyo.hokuyo_scan as hs import sys from labeling import label_object, scan_dataset, scans_database from opencv import highgui import hrl_lib.util as ut class scanner: def __init__(self, configuration): self.config = configuration self.webcam = False self.thok = False self.img = False #use the actual hardware def init_webcam(self): if self.webcam: return if self.config.device == 'codyRobot': import camera self.webcam = camera.Camera(self.config.cam_name) else: import webcamera self.webcam = webcamera.Webcamera(self.config.cam_name, self.config.webcam_id) # img = False # cam_index = -1 # while not(img) and cam_index < 20: # cam_index = cam_index + 1 # try: # del self.webcam # del webcamera # import webcamera # self.webcam = webcamera.Webcamera('DesktopWebcam', cam_index) # img = self.webcam.get_frame() # except: # print "Unexpected error:", sys.exc_info()[0] # print "try again...with next webcam" + str(cam_index) # pass # if not(img): # print 'ERROR: Webcam init FAILED' # return #use the actual hardware def init_thok(self): if self.thok: return print "Init THOK" self.hok = hs.Hokuyo('utm',self.config.thok_hoknum,flip=False) self.thok = ths.tilt_hokuyo(self.config.thok_devname,self.config.thok_servonum,self.hok,l1=self.config.thok_l1,l2=self.config.thok_l2) print "Init THOK done" def capture_image(self): self.init_webcam() del self.img self.img = False count = 0 print 'capture image...' while not(self.img) and count < 20: count = count + 1 try: #call get_frame several times to really get a new picture(!) for i in xrange(10): self.img = self.webcam.get_frame() except: print "Unexpected error:", sys.exc_info()[0] print "try again..." pass print 'count:'+str(count) return self.img def capture_laserscan(self, number_of_scans = 1, angle = None): self.init_thok() self.laserscans = [] if angle != None: tilt_angles = (self.config.thok_tilt_angles[0] + angle, self.config.thok_tilt_angles[1] + angle) else: tilt_angles = self.config.thok_tilt_angles for i in range(number_of_scans): pos_list,scan_list = self.thok.scan(tilt_angles,speed=self.config.thok_scan_speed,save_scan=False) self.laserscans.append((pos_list,scan_list)) #print scan_list[0] return self.laserscans def save_data(self,name, metadata=True, angle = None): dict = {'laserscans' : self.laserscans, 'l1': self.config.thok_l1, 'l2': self.config.thok_l2, 'image_angle' : angle} prefix = self.config.path+'/data/'+name print "Saving: "+prefix+'_laserscans.pkl' ut.save_pickle(dict,prefix+'_laserscans.pkl') print "Saving: "+prefix+'_image.png' highgui.cvSaveImage(prefix+'_image.png',self.img) if metadata: # save metadata to database: database = scans_database.scans_database() database.load(self.config.path,'database.pkl') dataset = scan_dataset.scan_dataset() dataset.id = name dataset.scan_filename = 'data/'+name+'_laserscans.pkl' dataset.image_filename = 'data/'+name+'_image.png' database.add_dataset(dataset) database.save() return name def take_artag_image(self): img = self.capture_image() return img def save_artag_image(self,name): filename = self.config.path+'/data/'+name+'_artag_image.png' print "Saving: "+filename highgui.cvSaveImage(filename,self.img) return '/data/'+name+'_artag_image.png' #capture image and laserscans, save image, scan def capture_and_save(self,name, metadata=True, angle = None): self.init_webcam() self.init_thok() if None != angle: self.thok.servo.move_angle(angle) angle = self.thok.servo.read_angle() self.capture_image() self.capture_laserscan(1, angle) return self.save_data(name, metadata, angle)
ajibawa-2023/Python-Code-Large/train/row_99736
87
183
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Import_L30_C0", "label": "roslib import roslib", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.1639, 0.0055, 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; roslib.load_manifest('laser_camera_segmentation')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L30_C15", "label": "load_manifest()", "type": "expression", "loc": [30, 30], "level": 0, "parent": null, "vector": [8, 0, 0.1639, 0.0055, 0, 0.66, 0.125, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('laser_camera_segmentation')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Import_L31_C0", "label": "hrl_tilting_hokuyo.tilt_hokuyo_servo import ths", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.1694, 0.0055, 0, 0.66, 0.25, 541, 0, 1, 0, 0, 541, 0, 0], "semantic": {"name": "hrl_tilting_hokuyo.tilt_hokuyo_servo", "arg_names": [], "import_names": ["ths"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_tilting_hokuyo.tilt_hokuyo_servo as ths"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Import_L33_C0", "label": "hrl_hokuyo.hokuyo_scan import hs", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.1803, 0.0055, 0, 0.66, 0.375, 184, 0, 1, 0, 0, 184, 0, 0], "semantic": {"name": "hrl_hokuyo.hokuyo_scan", "arg_names": [], "import_names": ["hs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_hokuyo.hokuyo_scan as hs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Import_L36_C0", "label": "sys import sys", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.1967, 0.0055, 0, 0.66, 0.5, 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_99736:ImportFrom_L38_C0", "label": "from labeling import label_object, scan_dataset, scans_database", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.2077, 0.0055, 0, 0.66, 0.625, 948, 0, 3, 0, 0, 948, 0, 0], "semantic": {"name": "labeling", "arg_names": [], "import_names": ["label_object", "scan_dataset", "scans_database"], "rhs_call_name": "", "annotation": ""}, "snippet": "from labeling import label_object, scan_dataset, scans_database"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:ImportFrom_L40_C0", "label": "from opencv import highgui", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.2186, 0.0055, 0, 0.66, 0.75, 437, 0, 1, 0, 0, 437, 0, 0], "semantic": {"name": "opencv", "arg_names": [], "import_names": ["highgui"], "rhs_call_name": "", "annotation": ""}, "snippet": "from opencv import highgui"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Import_L41_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.224, 0.0055, 0, 0.66, 0.875, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:ClassDef_L43_C0", "label": "scanner", "type": "class", "loc": [43, 183], "level": 0, "parent": null, "vector": [3, 0, 0.6175, 0.7705, 0, 0.66, 1.0, 802, 0, 9, 0, 0, 0, 0, 38], "semantic": {"name": "scanner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class scanner:\n def __init__(self, configuration):\n \n self.config = configuration\n \n \n self.webcam = False\n self.thok = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L44_C4", "label": "__init__", "type": "function", "loc": [44, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:ClassDef_L43_C0", "vector": [2, 1, 0.2623, 0.0492, 1, 0.83, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "configuration"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, configuration):\n \n self.config = configuration\n \n \n self.webcam = False\n self.thok = False\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L46_C8", "label": "self.config =", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L44_C4", "vector": [14, 2, 0.2514, 0.0055, 2, 0.45, 0.0, 663, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.config", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.config = configuration"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L49_C8", "label": "self.webcam =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L44_C4", "vector": [14, 2, 0.2678, 0.0055, 2, 0.45, 0.3333, 461, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.webcam", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.webcam = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L50_C8", "label": "self.thok =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L44_C4", "vector": [14, 2, 0.2732, 0.0055, 2, 0.45, 0.6667, 228, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.thok", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thok = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L52_C8", "label": "self.img =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L44_C4", "vector": [14, 2, 0.2842, 0.0055, 2, 0.45, 1.0, 992, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.img", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.img = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L56_C4", "label": "init_webcam", "type": "function", "loc": [56, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:ClassDef_L43_C0", "vector": [2, 1, 0.3306, 0.0546, 1, 0.83, 0.125, 924, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "init_webcam", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def init_webcam(self):\n if self.webcam:\n return\n \n if self.config.device == 'codyRobot':\n import camera\n self.webcam = camera.Camera(self.config.cam_name)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L57_C8", "label": "if", "type": "if", "loc": [57, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L56_C4", "vector": [4, 2, 0.3142, 0.0109, 2, 0.03, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.webcam:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Return_L58_C12", "label": "return", "type": "return", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L57_C8", "vector": [13, 3, 0.3169, 0.0055, 3, 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_99736:If_L60_C8", "label": "if", "type": "if", "loc": [60, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L56_C4", "vector": [4, 2, 0.3415, 0.0328, 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 self.config.device == 'codyRobot':\n import camera\n self.webcam = camera.Camera(self.config.cam_name)\n else:\n import webcamera\n self.webcam = webcamera.Webcamera(self.config.cam_name, self.config.webcam_id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Import_L61_C12", "label": "camera import camera", "type": "import", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L60_C8", "vector": [1, 3, 0.3333, 0.0055, 3, 0.47, 0.0, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "camera", "arg_names": [], "import_names": ["camera"], "rhs_call_name": "", "annotation": ""}, "snippet": " import camera"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L62_C12", "label": "self.webcam = Camera()", "type": "assigned_variable", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L60_C8", "vector": [14, 3, 0.3388, 0.0055, 3, 0.47, 0.3333, 461, 3, 1, 0, 0, 468, 10, 1], "semantic": {"name": "self.webcam", "arg_names": [], "import_names": [], "rhs_call_name": "Camera", "annotation": ""}, "snippet": " self.webcam = camera.Camera(self.config.cam_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Import_L64_C12", "label": "webcamera import webcamera", "type": "import", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L60_C8", "vector": [1, 3, 0.3497, 0.0055, 3, 0.47, 0.6667, 299, 0, 1, 0, 0, 299, 0, 0], "semantic": {"name": "webcamera", "arg_names": [], "import_names": ["webcamera"], "rhs_call_name": "", "annotation": ""}, "snippet": " import webcamera"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L65_C12", "label": "self.webcam = Webcamera()", "type": "assigned_variable", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L60_C8", "vector": [14, 3, 0.3552, 0.0055, 3, 0.47, 1.0, 461, 3, 2, 0, 0, 420, 10, 1], "semantic": {"name": "self.webcam", "arg_names": [], "import_names": [], "rhs_call_name": "Webcamera", "annotation": ""}, "snippet": " self.webcam = webcamera.Webcamera(self.config.cam_name, self.config.webcam_id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L91_C4", "label": "init_thok", "type": "function", "loc": [91, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:ClassDef_L43_C0", "vector": [2, 1, 0.5137, 0.0383, 1, 0.83, 0.25, 227, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "init_thok", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def init_thok(self):\n if self.thok:\n return\n print(\"Init THOK\")\n self.hok = hs.Hokuyo('utm',self.config.thok_hoknum,flip=False)\n self.thok = ths.tilt_hokuyo(self.config.thok_devname,self.config.thok_servonum,self.hok,l1=self.config.thok_l1,l2=self.config.thok_l2) \n print(\"Init THOK done\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L92_C8", "label": "if", "type": "if", "loc": [92, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L91_C4", "vector": [4, 2, 0.5055, 0.0109, 2, 0.61, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.thok:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Return_L93_C12", "label": "return", "type": "return", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L92_C8", "vector": [13, 3, 0.5082, 0.0055, 3, 0.37, 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_99736:Expr_L94_C8", "label": "print()", "type": "expression", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L91_C4", "vector": [8, 2, 0.5137, 0.0055, 2, 0.61, 0.25, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Init THOK\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L95_C8", "label": "self.hok = Hokuyo()", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L91_C4", "vector": [14, 2, 0.5191, 0.0055, 2, 0.61, 0.5, 364, 3, 3, 0, 0, 66, 10, 1], "semantic": {"name": "self.hok", "arg_names": [], "import_names": [], "rhs_call_name": "Hokuyo", "annotation": ""}, "snippet": " self.hok = hs.Hokuyo('utm',self.config.thok_hoknum,flip=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L96_C8", "label": "self.thok = tilt_hokuyo()", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L91_C4", "vector": [14, 2, 0.5246, 0.0055, 2, 0.61, 0.75, 228, 3, 5, 0, 0, 577, 10, 1], "semantic": {"name": "self.thok", "arg_names": [], "import_names": [], "rhs_call_name": "tilt_hokuyo", "annotation": ""}, "snippet": " self.thok = ths.tilt_hokuyo(self.config.thok_devname,self.config.thok_servonum,self.hok,l1=self.config.thok_l1,l2=self.config.thok_l2) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L97_C8", "label": "print()", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L91_C4", "vector": [8, 2, 0.5301, 0.0055, 2, 0.61, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Init THOK done\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L99_C4", "label": "capture_image", "type": "function", "loc": [99, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:ClassDef_L43_C0", "vector": [2, 1, 0.5902, 0.1038, 1, 0.83, 0.375, 218, 0, 1, 1, 0, 0, 0, 9], "semantic": {"name": "capture_image", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def capture_image(self):\n self.init_webcam()\n del self.img\n self.img = False\n count = 0\n print('capture image...')\n \n while not(self.img) and count < 20:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L100_C8", "label": "init_webcam()", "type": "expression", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L99_C4", "vector": [8, 2, 0.5464, 0.0055, 2, 0.44, 0.0, 924, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init_webcam", "arg_names": [], "import_names": [], "rhs_call_name": "init_webcam", "annotation": ""}, "snippet": " self.init_webcam()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L102_C8", "label": "self.img =", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L99_C4", "vector": [14, 2, 0.5574, 0.0055, 2, 0.44, 0.1667, 992, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.img", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.img = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L103_C8", "label": "count =", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L99_C4", "vector": [14, 2, 0.5628, 0.0055, 2, 0.44, 0.3333, 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_99736:Expr_L104_C8", "label": "print()", "type": "expression", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L99_C4", "vector": [8, 2, 0.5683, 0.0055, 2, 0.44, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('capture image...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:While_L106_C8", "label": "while", "type": "while", "loc": [106, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L99_C4", "vector": [5, 2, 0.6038, 0.0546, 2, 0.44, 0.6667, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not(self.img) and count < 20:\n count = count + 1\n try:\n #call get_frame several times to really get a new picture(!)\n for i in xrange(10):\n self.img = self.webcam.get_frame()\n except:\n print(\"Unexpected error:\", sys.exc_info()[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L107_C12", "label": "count =", "type": "assigned_variable", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:While_L106_C8", "vector": [14, 3, 0.5847, 0.0055, 3, 0.88, 0.0, 778, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count = count + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Try_L108_C12", "label": "try", "type": "try", "loc": [108, 115], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:While_L106_C8", "vector": [7, 3, 0.6093, 0.0437, 3, 0.88, 1.0, 0, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n #call get_frame several times to really get a new picture(!)\n for i in xrange(10):\n self.img = self.webcam.get_frame()\n except:\n print(\"Unexpected error:\", sys.exc_info()[0])\n print(\"try again...\")\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:For_L110_C16", "label": "for i", "type": "for", "loc": [110, 111], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:Try_L108_C12", "vector": [6, 4, 0.6038, 0.0109, 4, 0.54, 0.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(10):\n self.img = self.webcam.get_frame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L111_C20", "label": "self.img = get_frame()", "type": "assigned_variable", "loc": [111, 111], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:For_L110_C16", "vector": [14, 5, 0.6066, 0.0055, 5, 0.24, 0.0, 992, 3, 0, 0, 0, 489, 10, 1], "semantic": {"name": "self.img", "arg_names": [], "import_names": [], "rhs_call_name": "get_frame", "annotation": ""}, "snippet": " self.img = self.webcam.get_frame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L113_C16", "label": "print()", "type": "expression", "loc": [113, 113], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:Try_L108_C12", "vector": [8, 4, 0.6175, 0.0055, 4, 0.54, 0.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Unexpected error:\", sys.exc_info()[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L114_C16", "label": "print()", "type": "expression", "loc": [114, 114], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:Try_L108_C12", "vector": [8, 4, 0.623, 0.0055, 4, 0.54, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"try again...\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L116_C8", "label": "print()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L99_C4", "vector": [8, 2, 0.6339, 0.0055, 2, 0.44, 0.8333, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('count:'+str(count))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Return_L117_C8", "label": "return", "type": "return", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L99_C4", "vector": [13, 2, 0.6393, 0.0055, 2, 0.44, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.img"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L119_C4", "label": "capture_laserscan", "type": "function", "loc": [119, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:ClassDef_L43_C0", "vector": [2, 1, 0.6913, 0.0874, 1, 0.83, 0.5, 3, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "capture_laserscan", "arg_names": ["self", "number_of_scans", "angle"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def capture_laserscan(self, number_of_scans = 1, angle = None):\n self.init_thok()\n self.laserscans = []\n \n if angle != None:\n tilt_angles = (self.config.thok_tilt_angles[0] + angle, self.config.thok_tilt_angles[1] + angle)\n else:\n tilt_angles = self.config.thok_tilt_angles"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L120_C8", "label": "init_thok()", "type": "expression", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L119_C4", "vector": [8, 2, 0.6557, 0.0055, 2, 0.59, 0.0, 227, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init_thok", "arg_names": [], "import_names": [], "rhs_call_name": "init_thok", "annotation": ""}, "snippet": " self.init_thok()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L121_C8", "label": "self.laserscans =", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L119_C4", "vector": [14, 2, 0.6612, 0.0055, 2, 0.59, 0.25, 890, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.laserscans", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.laserscans = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L123_C8", "label": "if", "type": "if", "loc": [123, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L119_C4", "vector": [4, 2, 0.6803, 0.0219, 2, 0.59, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if angle != None:\n tilt_angles = (self.config.thok_tilt_angles[0] + angle, self.config.thok_tilt_angles[1] + angle)\n else:\n tilt_angles = self.config.thok_tilt_angles"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L124_C12", "label": "tilt_angles =", "type": "assigned_variable", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L123_C8", "vector": [14, 3, 0.6776, 0.0055, 3, 0.75, 0.0, 609, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "tilt_angles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tilt_angles = (self.config.thok_tilt_angles[0] + angle, self.config.thok_tilt_angles[1] + angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L126_C12", "label": "tilt_angles =", "type": "assigned_variable", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L123_C8", "vector": [14, 3, 0.6885, 0.0055, 3, 0.75, 1.0, 609, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tilt_angles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tilt_angles = self.config.thok_tilt_angles"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:For_L128_C8", "label": "for i", "type": "for", "loc": [128, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L119_C4", "vector": [6, 2, 0.7049, 0.0164, 2, 0.59, 0.75, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(number_of_scans):\n pos_list,scan_list = self.thok.scan(tilt_angles,speed=self.config.thok_scan_speed,save_scan=False)\n self.laserscans.append((pos_list,scan_list))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L129_C12", "label": "pos_list, scan_list = scan()", "type": "assigned_variable", "loc": [129, 129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:For_L128_C8", "vector": [14, 3, 0.7049, 0.0055, 3, 0.72, 0.0, 818, 3, 3, 0, 0, 202, 10, 1], "semantic": {"name": "pos_list, scan_list", "arg_names": [], "import_names": [], "rhs_call_name": "scan", "annotation": ""}, "snippet": " pos_list,scan_list = self.thok.scan(tilt_angles,speed=self.config.thok_scan_speed,save_scan=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L130_C12", "label": "append()", "type": "expression", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:For_L128_C8", "vector": [8, 3, 0.7104, 0.0055, 3, 0.72, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.laserscans.append((pos_list,scan_list))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Return_L134_C8", "label": "return", "type": "return", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L119_C4", "vector": [13, 2, 0.7322, 0.0055, 2, 0.59, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.laserscans"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L137_C4", "label": "save_data", "type": "function", "loc": [137, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:ClassDef_L43_C0", "vector": [2, 1, 0.8087, 0.1257, 1, 0.83, 0.625, 385, 0, 4, 1, 0, 0, 0, 9], "semantic": {"name": "save_data", "arg_names": ["self", "name", "metadata", "angle"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def save_data(self,name, metadata=True, angle = None):\n dict = {'laserscans' : self.laserscans,\n 'l1': self.config.thok_l1, 'l2': self.config.thok_l2,\n 'image_angle' : angle} \n \n prefix = self.config.path+'/data/'+name\n print(\"Saving: \"+prefix+'_laserscans.pkl')\n ut.save_pickle(dict,prefix+'_laserscans.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L138_C8", "label": "dict =", "type": "assigned_variable", "loc": [138, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L137_C4", "vector": [14, 2, 0.7596, 0.0164, 2, 0.06, 0.0, 827, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dict = {'laserscans' : self.laserscans,\n 'l1': self.config.thok_l1, 'l2': self.config.thok_l2,\n 'image_angle' : angle} "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L142_C8", "label": "prefix =", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L137_C4", "vector": [14, 2, 0.776, 0.0055, 2, 0.06, 0.1429, 284, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prefix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prefix = self.config.path+'/data/'+name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L143_C8", "label": "print()", "type": "expression", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L137_C4", "vector": [8, 2, 0.7814, 0.0055, 2, 0.06, 0.2857, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Saving: \"+prefix+'_laserscans.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L144_C8", "label": "save_pickle()", "type": "expression", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L137_C4", "vector": [8, 2, 0.7869, 0.0055, 2, 0.06, 0.4286, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(dict,prefix+'_laserscans.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L145_C8", "label": "print()", "type": "expression", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L137_C4", "vector": [8, 2, 0.7923, 0.0055, 2, 0.06, 0.5714, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Saving: \"+prefix+'_image.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L146_C8", "label": "cvSaveImage()", "type": "expression", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L137_C4", "vector": [8, 2, 0.7978, 0.0055, 2, 0.06, 0.7143, 100, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "cvSaveImage", "arg_names": [], "import_names": [], "rhs_call_name": "cvSaveImage", "annotation": ""}, "snippet": " highgui.cvSaveImage(prefix+'_image.png',self.img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L148_C8", "label": "if", "type": "if", "loc": [148, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L137_C4", "vector": [4, 2, 0.8333, 0.0546, 2, 0.06, 0.8571, 0, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if metadata:\n # save metadata to database:\n database = scans_database.scans_database()\n database.load(self.config.path,'database.pkl')\n dataset = scan_dataset.scan_dataset()\n dataset.id = name\n dataset.scan_filename = 'data/'+name+'_laserscans.pkl'\n dataset.image_filename = 'data/'+name+'_image.png'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L150_C12", "label": "database = scans_database()", "type": "assigned_variable", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L148_C8", "vector": [14, 3, 0.8197, 0.0055, 3, 0.46, 0.0, 329, 3, 0, 0, 0, 332, 10, 1], "semantic": {"name": "database", "arg_names": [], "import_names": [], "rhs_call_name": "scans_database", "annotation": ""}, "snippet": " database = scans_database.scans_database()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L151_C12", "label": "load()", "type": "expression", "loc": [151, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L148_C8", "vector": [8, 3, 0.8251, 0.0055, 3, 0.46, 0.1429, 37, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": " database.load(self.config.path,'database.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L152_C12", "label": "dataset = scan_dataset()", "type": "assigned_variable", "loc": [152, 152], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L148_C8", "vector": [14, 3, 0.8306, 0.0055, 3, 0.46, 0.2857, 603, 3, 0, 0, 0, 727, 10, 1], "semantic": {"name": "dataset", "arg_names": [], "import_names": [], "rhs_call_name": "scan_dataset", "annotation": ""}, "snippet": " dataset = scan_dataset.scan_dataset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L153_C12", "label": "dataset.id =", "type": "assigned_variable", "loc": [153, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L148_C8", "vector": [14, 3, 0.8361, 0.0055, 3, 0.46, 0.4286, 900, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dataset.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dataset.id = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L154_C12", "label": "dataset.scan_filename =", "type": "assigned_variable", "loc": [154, 154], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L148_C8", "vector": [14, 3, 0.8415, 0.0055, 3, 0.46, 0.5714, 312, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dataset.scan_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dataset.scan_filename = 'data/'+name+'_laserscans.pkl'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L155_C12", "label": "dataset.image_filename =", "type": "assigned_variable", "loc": [155, 155], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L148_C8", "vector": [14, 3, 0.847, 0.0055, 3, 0.46, 0.7143, 356, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dataset.image_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dataset.image_filename = 'data/'+name+'_image.png'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L156_C12", "label": "add_dataset()", "type": "expression", "loc": [156, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L148_C8", "vector": [8, 3, 0.8525, 0.0055, 3, 0.46, 0.8571, 326, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "add_dataset", "annotation": ""}, "snippet": " database.add_dataset(dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L157_C12", "label": "save()", "type": "expression", "loc": [157, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L148_C8", "vector": [8, 3, 0.8579, 0.0055, 3, 0.46, 1.0, 928, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "save", "arg_names": [], "import_names": [], "rhs_call_name": "save", "annotation": ""}, "snippet": " database.save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Return_L159_C8", "label": "return", "type": "return", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L137_C4", "vector": [13, 2, 0.8689, 0.0055, 2, 0.06, 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_99736:FunctionDef_L161_C4", "label": "take_artag_image", "type": "function", "loc": [161, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:ClassDef_L43_C0", "vector": [2, 1, 0.8852, 0.0164, 1, 0.83, 0.75, 561, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "take_artag_image", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def take_artag_image(self): \n img = self.capture_image()\n return img"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L162_C8", "label": "img = capture_image()", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L161_C4", "vector": [14, 2, 0.8852, 0.0055, 2, 0.89, 0.0, 200, 3, 0, 0, 0, 218, 10, 1], "semantic": {"name": "img", "arg_names": [], "import_names": [], "rhs_call_name": "capture_image", "annotation": ""}, "snippet": " img = self.capture_image()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Return_L163_C8", "label": "return", "type": "return", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L161_C4", "vector": [13, 2, 0.8907, 0.0055, 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 img"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L165_C4", "label": "save_artag_image", "type": "function", "loc": [165, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:ClassDef_L43_C0", "vector": [2, 1, 0.918, 0.0383, 1, 0.83, 0.875, 169, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "save_artag_image", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def save_artag_image(self,name): \n \n filename = self.config.path+'/data/'+name+'_artag_image.png'\n print(\"Saving: \"+filename)\n highgui.cvSaveImage(filename,self.img)\n \n return '/data/'+name+'_artag_image.png'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L167_C8", "label": "filename =", "type": "assigned_variable", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L165_C4", "vector": [14, 2, 0.9126, 0.0055, 2, 0.16, 0.0, 275, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filename = self.config.path+'/data/'+name+'_artag_image.png'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L168_C8", "label": "print()", "type": "expression", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L165_C4", "vector": [8, 2, 0.918, 0.0055, 2, 0.16, 0.3333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Saving: \"+filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L169_C8", "label": "cvSaveImage()", "type": "expression", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L165_C4", "vector": [8, 2, 0.9235, 0.0055, 2, 0.16, 0.6667, 100, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "cvSaveImage", "arg_names": [], "import_names": [], "rhs_call_name": "cvSaveImage", "annotation": ""}, "snippet": " highgui.cvSaveImage(filename,self.img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Return_L171_C8", "label": "return", "type": "return", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L165_C4", "vector": [13, 2, 0.9344, 0.0055, 2, 0.16, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '/data/'+name+'_artag_image.png'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L174_C4", "label": "capture_and_save", "type": "function", "loc": [174, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:ClassDef_L43_C0", "vector": [2, 1, 0.9754, 0.0546, 1, 0.83, 1.0, 272, 0, 4, 1, 0, 0, 0, 7], "semantic": {"name": "capture_and_save", "arg_names": ["self", "name", "metadata", "angle"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def capture_and_save(self,name, metadata=True, angle = None):\n self.init_webcam()\n self.init_thok()\n if None != angle:\n self.thok.servo.move_angle(angle)\n angle = self.thok.servo.read_angle() \n \n self.capture_image()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L175_C8", "label": "init_webcam()", "type": "expression", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L174_C4", "vector": [8, 2, 0.9563, 0.0055, 2, 0.91, 0.0, 924, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init_webcam", "arg_names": [], "import_names": [], "rhs_call_name": "init_webcam", "annotation": ""}, "snippet": " self.init_webcam()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L176_C8", "label": "init_thok()", "type": "expression", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L174_C4", "vector": [8, 2, 0.9617, 0.0055, 2, 0.91, 0.2, 227, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init_thok", "arg_names": [], "import_names": [], "rhs_call_name": "init_thok", "annotation": ""}, "snippet": " self.init_thok()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L177_C8", "label": "if", "type": "if", "loc": [177, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L174_C4", "vector": [4, 2, 0.9727, 0.0164, 2, 0.91, 0.4, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if None != angle:\n self.thok.servo.move_angle(angle)\n angle = self.thok.servo.read_angle() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L178_C12", "label": "move_angle()", "type": "expression", "loc": [178, 178], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L177_C8", "vector": [8, 3, 0.9727, 0.0055, 3, 0.17, 0.0, 293, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.thok.servo.move_angle(angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L179_C12", "label": "angle = read_angle()", "type": "assigned_variable", "loc": [179, 179], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L177_C8", "vector": [14, 3, 0.9781, 0.0055, 3, 0.17, 1.0, 418, 3, 0, 0, 0, 27, 10, 1], "semantic": {"name": "angle", "arg_names": [], "import_names": [], "rhs_call_name": "read_angle", "annotation": ""}, "snippet": " angle = self.thok.servo.read_angle() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L181_C8", "label": "capture_image()", "type": "expression", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L174_C4", "vector": [8, 2, 0.9891, 0.0055, 2, 0.91, 0.6, 218, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "capture_image", "arg_names": [], "import_names": [], "rhs_call_name": "capture_image", "annotation": ""}, "snippet": " self.capture_image()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L182_C8", "label": "capture_laserscan()", "type": "expression", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L174_C4", "vector": [8, 2, 0.9945, 0.0055, 2, 0.91, 0.8, 3, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "capture_laserscan", "arg_names": [], "import_names": [], "rhs_call_name": "capture_laserscan", "annotation": ""}, "snippet": " self.capture_laserscan(1, angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99736:Return_L183_C8", "label": "return", "type": "return", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L174_C4", "vector": [13, 2, 1.0, 0.0055, 2, 0.91, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.save_data(name, metadata, angle)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99736:ClassDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:ClassDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L57_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Return_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Import_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Import_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:ClassDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Return_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:ClassDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:While_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:While_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:While_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Try_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:Try_L108_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:For_L110_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:For_L110_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L111_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:Try_L108_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L113_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:Try_L108_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L114_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Return_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:ClassDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L123_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L123_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:For_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:For_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L129_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:For_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Return_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:ClassDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L150_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L151_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L152_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L153_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L154_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Return_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:ClassDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Return_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:ClassDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Return_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:ClassDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L177_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L178_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:If_L177_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Assign_L179_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Expr_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99736:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99736:Return_L183_C8"}]
# # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Advait Jain (Healthcare Robotics Lab, Georgia Tech.) import roslib; roslib.load_manifest('UI_segment_object') import rospy from UI_segment_object.srv import GetPt from UI_segment_object.srv import None_Bool reset_ui = None get_3d_point = None def initialize_service(): global reset_ui, get_3d_point reset_srv_name = 'UI_reset' srv_name = 'get_3D_pt' rospy.loginfo('waiting for service: %s'%reset_srv_name) rospy.wait_for_service(reset_srv_name) rospy.loginfo('waiting for service: %s'%srv_name) rospy.wait_for_service(srv_name) rospy.loginfo('Done') reset_ui = rospy.ServiceProxy(reset_srv_name, None_Bool) get_3d_point = rospy.ServiceProxy(srv_name, GetPt) def get_point(): global reset_ui, get_3d_point reset_ui() resp = get_3d_point() return resp.pt.x, resp.pt.y, resp.pt.z if __name__ == '__main__': rospy.init_node('point_and_click_client') initialize_service() x,y,z = get_point() print '3D point:', x, y, z
ajibawa-2023/Python-Code-Large/train/row_99737
26
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_99737:Import_L30_C0", "label": "roslib import roslib", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.4348, 0.0145, 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; roslib.load_manifest('UI_segment_object')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:Expr_L30_C15", "label": "load_manifest()", "type": "expression", "loc": [30, 30], "level": 0, "parent": null, "vector": [8, 0, 0.4348, 0.0145, 0, 0.66, 0.1111, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('UI_segment_object')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:Import_L32_C0", "label": "rospy import rospy", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.4638, 0.0145, 0, 0.66, 0.2222, 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_99737:ImportFrom_L33_C0", "label": "from UI_segment_object.srv import GetPt", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.4783, 0.0145, 0, 0.66, 0.3333, 363, 0, 1, 0, 0, 363, 0, 0], "semantic": {"name": "UI_segment_object.srv", "arg_names": [], "import_names": ["GetPt"], "rhs_call_name": "", "annotation": ""}, "snippet": "from UI_segment_object.srv import GetPt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:ImportFrom_L34_C0", "label": "from UI_segment_object.srv import None_Bool", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.4928, 0.0145, 0, 0.66, 0.4444, 363, 0, 1, 0, 0, 363, 0, 0], "semantic": {"name": "UI_segment_object.srv", "arg_names": [], "import_names": ["None_Bool"], "rhs_call_name": "", "annotation": ""}, "snippet": "from UI_segment_object.srv import None_Bool"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:Assign_L36_C0", "label": "reset_ui =", "type": "assigned_variable", "loc": [36, 36], "level": 0, "parent": null, "vector": [14, 0, 0.5217, 0.0145, 0, 0.66, 0.5556, 609, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "reset_ui", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "reset_ui = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:Assign_L37_C0", "label": "get_3d_point =", "type": "assigned_variable", "loc": [37, 37], "level": 0, "parent": null, "vector": [14, 0, 0.5362, 0.0145, 0, 0.66, 0.6667, 70, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "get_3d_point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "get_3d_point = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L39_C0", "label": "initialize_service", "type": "function", "loc": [39, 51], "level": 0, "parent": null, "vector": [2, 0, 0.6522, 0.1884, 0, 0.66, 0.7778, 239, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "initialize_service", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def initialize_service():\n global reset_ui, get_3d_point\n reset_srv_name = 'UI_reset'\n srv_name = 'get_3D_pt'\n\n rospy.loginfo('waiting for service: %s'%reset_srv_name)\n rospy.wait_for_service(reset_srv_name)\n rospy.loginfo('waiting for service: %s'%srv_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:Assign_L41_C4", "label": "reset_srv_name =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L39_C0", "vector": [14, 1, 0.5942, 0.0145, 1, 0.85, 0.0, 972, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "reset_srv_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " reset_srv_name = 'UI_reset'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:Assign_L42_C4", "label": "srv_name =", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L39_C0", "vector": [14, 1, 0.6087, 0.0145, 1, 0.85, 0.125, 114, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "srv_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " srv_name = 'get_3D_pt'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:Expr_L44_C4", "label": "loginfo()", "type": "expression", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L39_C0", "vector": [8, 1, 0.6377, 0.0145, 1, 0.85, 0.25, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('waiting for service: %s'%reset_srv_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:Expr_L45_C4", "label": "wait_for_service()", "type": "expression", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L39_C0", "vector": [8, 1, 0.6522, 0.0145, 1, 0.85, 0.375, 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(reset_srv_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:Expr_L46_C4", "label": "loginfo()", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L39_C0", "vector": [8, 1, 0.6667, 0.0145, 1, 0.85, 0.5, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('waiting for service: %s'%srv_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:Expr_L47_C4", "label": "wait_for_service()", "type": "expression", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L39_C0", "vector": [8, 1, 0.6812, 0.0145, 1, 0.85, 0.625, 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(srv_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:Expr_L48_C4", "label": "loginfo()", "type": "expression", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L39_C0", "vector": [8, 1, 0.6957, 0.0145, 1, 0.85, 0.75, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Done')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:Assign_L50_C4", "label": "reset_ui = ServiceProxy()", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L39_C0", "vector": [14, 1, 0.7246, 0.0145, 1, 0.85, 0.875, 609, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "reset_ui", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " reset_ui = rospy.ServiceProxy(reset_srv_name, None_Bool)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:Assign_L51_C4", "label": "get_3d_point = ServiceProxy()", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L39_C0", "vector": [14, 1, 0.7391, 0.0145, 1, 0.85, 1.0, 70, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "get_3d_point", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " get_3d_point = rospy.ServiceProxy(srv_name, GetPt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L54_C0", "label": "get_point", "type": "function", "loc": [54, 58], "level": 0, "parent": null, "vector": [2, 0, 0.8116, 0.0725, 0, 0.66, 0.8889, 346, 0, 0, 1, 0, 0, 0, 2], "semantic": {"name": "get_point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_point():\n global reset_ui, get_3d_point\n reset_ui()\n resp = get_3d_point()\n return resp.pt.x, resp.pt.y, resp.pt.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:Expr_L56_C4", "label": "reset_ui()", "type": "expression", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L54_C0", "vector": [8, 1, 0.8116, 0.0145, 1, 0.89, 0.0, 609, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "reset_ui", "arg_names": [], "import_names": [], "rhs_call_name": "reset_ui", "annotation": ""}, "snippet": " reset_ui()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:Assign_L57_C4", "label": "resp = get_3d_point()", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L54_C0", "vector": [14, 1, 0.8261, 0.0145, 1, 0.89, 0.5, 48, 3, 0, 0, 0, 70, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "get_3d_point", "annotation": ""}, "snippet": " resp = get_3d_point()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:Return_L58_C4", "label": "return", "type": "return", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L54_C0", "vector": [13, 1, 0.8406, 0.0145, 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 resp.pt.x, resp.pt.y, resp.pt.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:If_L61_C0", "label": "if", "type": "if", "loc": [61, 66], "level": 0, "parent": null, "vector": [4, 0, 0.9203, 0.087, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n rospy.init_node('point_and_click_client')\n\n initialize_service()\n x,y,z = get_point()\n print('3D point:', x, y, z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:Expr_L62_C4", "label": "init_node()", "type": "expression", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99737:If_L61_C0", "vector": [8, 1, 0.8986, 0.0145, 1, 0.53, 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('point_and_click_client')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:Expr_L64_C4", "label": "initialize_service()", "type": "expression", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99737:If_L61_C0", "vector": [8, 1, 0.9275, 0.0145, 1, 0.53, 0.3333, 239, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "initialize_service", "arg_names": [], "import_names": [], "rhs_call_name": "initialize_service", "annotation": ""}, "snippet": " initialize_service()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:Assign_L65_C4", "label": "x, y, z = get_point()", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99737:If_L61_C0", "vector": [14, 1, 0.942, 0.0145, 1, 0.53, 0.6667, 971, 3, 0, 0, 0, 346, 10, 1], "semantic": {"name": "x, y, z", "arg_names": [], "import_names": [], "rhs_call_name": "get_point", "annotation": ""}, "snippet": " x,y,z = get_point()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99737:Expr_L66_C4", "label": "print()", "type": "expression", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99737:If_L61_C0", "vector": [8, 1, 0.9565, 0.0145, 1, 0.53, 1.0, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('3D point:', x, y, z)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99737:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99737:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99737:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99737:Expr_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99737:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99737:Expr_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99737:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99737:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99737:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99737:Expr_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99737:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99737:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99737:Return_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99737:If_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99737:Expr_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99737:If_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99737:Expr_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99737:If_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99737:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99737:If_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99737:Expr_L66_C4"}]
# # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Author: Advait Jain import matplotlib.pyplot as pp import numpy as np import roslib; roslib.load_manifest('epc_door_opening') import hrl_lib.util as ut import doors_forces_kinematics.arm_trajectories_ram as atr d = ut.load_pickle('pkls/ikea_cabinet_log.pkl') #d = ut.load_pickle('pkls/ikea_cabinet_2.pkl') #d = ut.load_pickle('pkls/lab_cabinet_log.pkl') typ = 'rotary' pr2_log = True d['f_list'] = d['f_list_estimate'] h_config, h_ftan_estimate = atr.force_trajectory_in_hindsight(d, typ, pr2_log) pp.plot(np.degrees(h_config), h_ftan_estimate, 'ro-', mew=0, ms=0, label='estimate') if 'f_list_torques' in d: d['f_list'] = d['f_list_torques'] h_config, h_ftan_torques = atr.force_trajectory_in_hindsight(d, typ, pr2_log) pp.plot(np.degrees(h_config), h_ftan_torques, 'go-', mew=0, ms=0, label='torques') d['f_list'] = d['f_list_ati'] h_config, h_ftan_ati = atr.force_trajectory_in_hindsight(d, typ, pr2_log) pp.plot(np.degrees(h_config), h_ftan_ati, 'bo-', mew=0, ms=0, label='ATI') pp.legend() pp.show()
ajibawa-2023/Python-Code-Large/train/row_99738
21
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_99738:Import_L30_C0", "label": "matplotlib.pyplot import pp", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.4545, 0.0152, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "import_names": ["pp"], "rhs_call_name": "", "annotation": ""}, "snippet": "import matplotlib.pyplot as pp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99738:Import_L31_C0", "label": "numpy import np", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.4697, 0.0152, 0, 0.66, 0.0588, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99738:Import_L33_C0", "label": "roslib import roslib", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.0152, 0, 0.66, 0.1176, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('epc_door_opening')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99738:Expr_L33_C15", "label": "load_manifest()", "type": "expression", "loc": [33, 33], "level": 0, "parent": null, "vector": [8, 0, 0.5, 0.0152, 0, 0.66, 0.1765, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('epc_door_opening')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99738:Import_L35_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.5303, 0.0152, 0, 0.66, 0.2353, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99738:Import_L36_C0", "label": "doors_forces_kinematics.arm_trajectories_ram import atr", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.5455, 0.0152, 0, 0.66, 0.2941, 95, 0, 1, 0, 0, 95, 0, 0], "semantic": {"name": "doors_forces_kinematics.arm_trajectories_ram", "arg_names": [], "import_names": ["atr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import doors_forces_kinematics.arm_trajectories_ram as atr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99738:Assign_L38_C0", "label": "d = load_pickle()", "type": "assigned_variable", "loc": [38, 38], "level": 0, "parent": null, "vector": [14, 0, 0.5758, 0.0152, 0, 0.66, 0.3529, 355, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": "d = ut.load_pickle('pkls/ikea_cabinet_log.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99738:Assign_L42_C0", "label": "typ =", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 0.6364, 0.0152, 0, 0.66, 0.4118, 722, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "typ", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "typ = 'rotary'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99738:Assign_L43_C0", "label": "pr2_log =", "type": "assigned_variable", "loc": [43, 43], "level": 0, "parent": null, "vector": [14, 0, 0.6515, 0.0152, 0, 0.66, 0.4706, 601, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "pr2_log", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "pr2_log = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99738:Assign_L45_C0", "label": "assign", "type": "assigned_variable", "loc": [45, 45], "level": 0, "parent": null, "vector": [14, 0, 0.6818, 0.0152, 0, 0.66, 0.5294, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "d['f_list'] = d['f_list_estimate']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99738:Assign_L46_C0", "label": "h_config, h_ftan_estimate = force_trajectory_in_hindsight()", "type": "assigned_variable", "loc": [46, 46], "level": 0, "parent": null, "vector": [14, 0, 0.697, 0.0152, 0, 0.66, 0.5882, 799, 3, 3, 0, 0, 814, 10, 1], "semantic": {"name": "h_config, h_ftan_estimate", "arg_names": [], "import_names": [], "rhs_call_name": "force_trajectory_in_hindsight", "annotation": ""}, "snippet": "h_config, h_ftan_estimate = atr.force_trajectory_in_hindsight(d, typ, pr2_log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99738:Expr_L47_C0", "label": "plot()", "type": "expression", "loc": [47, 48], "level": 0, "parent": null, "vector": [8, 0, 0.7197, 0.0303, 0, 0.66, 0.6471, 929, 3, 6, 0, 0, 0, 0, 2], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": "pp.plot(np.degrees(h_config), h_ftan_estimate, 'ro-', mew=0, ms=0,\n label='estimate')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99738:If_L50_C0", "label": "if", "type": "if", "loc": [50, 55], "level": 0, "parent": null, "vector": [4, 0, 0.7955, 0.0909, 0, 0.66, 0.7059, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if 'f_list_torques' in d:\n d['f_list'] = d['f_list_torques']\n h_config, h_ftan_torques = atr.force_trajectory_in_hindsight(d, typ,\n pr2_log)\n pp.plot(np.degrees(h_config), h_ftan_torques, 'go-', mew=0, ms=0,\n label='torques')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99738:Assign_L51_C4", "label": "assign", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99738:If_L50_C0", "vector": [14, 1, 0.7727, 0.0152, 1, 0.44, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['f_list'] = d['f_list_torques']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99738:Assign_L52_C4", "label": "h_config, h_ftan_torques = force_trajectory_in_hindsight()", "type": "assigned_variable", "loc": [52, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99738:If_L50_C0", "vector": [14, 1, 0.7955, 0.0303, 1, 0.44, 0.5, 671, 3, 3, 0, 0, 814, 10, 1], "semantic": {"name": "h_config, h_ftan_torques", "arg_names": [], "import_names": [], "rhs_call_name": "force_trajectory_in_hindsight", "annotation": ""}, "snippet": " h_config, h_ftan_torques = atr.force_trajectory_in_hindsight(d, typ,\n pr2_log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99738:Expr_L54_C4", "label": "plot()", "type": "expression", "loc": [54, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99738:If_L50_C0", "vector": [8, 1, 0.8258, 0.0303, 1, 0.44, 1.0, 929, 3, 6, 0, 0, 0, 0, 2], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pp.plot(np.degrees(h_config), h_ftan_torques, 'go-', mew=0, ms=0,\n label='torques')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99738:Assign_L57_C0", "label": "assign", "type": "assigned_variable", "loc": [57, 57], "level": 0, "parent": null, "vector": [14, 0, 0.8636, 0.0152, 0, 0.66, 0.7647, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "d['f_list'] = d['f_list_ati']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99738:Assign_L58_C0", "label": "h_config, h_ftan_ati = force_trajectory_in_hindsight()", "type": "assigned_variable", "loc": [58, 58], "level": 0, "parent": null, "vector": [14, 0, 0.8788, 0.0152, 0, 0.66, 0.8235, 635, 3, 3, 0, 0, 814, 10, 1], "semantic": {"name": "h_config, h_ftan_ati", "arg_names": [], "import_names": [], "rhs_call_name": "force_trajectory_in_hindsight", "annotation": ""}, "snippet": "h_config, h_ftan_ati = atr.force_trajectory_in_hindsight(d, typ, pr2_log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99738:Expr_L59_C0", "label": "plot()", "type": "expression", "loc": [59, 60], "level": 0, "parent": null, "vector": [8, 0, 0.9015, 0.0303, 0, 0.66, 0.8824, 929, 3, 6, 0, 0, 0, 0, 2], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": "pp.plot(np.degrees(h_config), h_ftan_ati, 'bo-', mew=0, ms=0,\n label='ATI')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99738:Expr_L62_C0", "label": "legend()", "type": "expression", "loc": [62, 62], "level": 0, "parent": null, "vector": [8, 0, 0.9394, 0.0152, 0, 0.66, 0.9412, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": "pp.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99738:Expr_L63_C0", "label": "show()", "type": "expression", "loc": [63, 63], "level": 0, "parent": null, "vector": [8, 0, 0.9545, 0.0152, 0, 0.66, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": "pp.show()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99738:If_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99738:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99738:If_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99738:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99738:If_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99738:Expr_L54_C4"}]
#!/usr/bin/env python # # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Author: Advait Jain import roslib; roslib.load_manifest('epc_door_opening') import rospy from epc_door_opening.msg import MechanismKinematicsRot from geometry_msgs.msg import Point32 import doors_forces_kinematics.arm_trajectories as at from threading import RLock import numpy as np import time ## # fit circle to the trajectory, publish the computed kinematics. # @param cartesian_pts_list - list of 3-tuples. trajectory of the mechanism # @param pbshr - publisher for the MechanismKinematics message # @param lock - to make list operations thread safe. (there is a callback too.) def circle_estimator(cartesian_pts_list, pbshr, lock): lock.acquire() n_pts = len(cartesian_pts_list) pts_2d = (np.matrix(cartesian_pts_list).T)[0:2,:] lock.release() if n_pts<2: time.sleep(0.1) #pbshr.publish(mk) # don't publish anything. return st = pts_2d[:,0] now = pts_2d[:,-1] mk = MechanismKinematicsRot() mk.cx = 0.5 mk.cy = -3.5 mk.cz = cartesian_pts_list[0][2] mk.rad = 10. dist_moved = np.linalg.norm(st-now) # if dist_moved<=0.05: # reject_pts_num = n_pts # else: # reject_pts_num = 1 reject_pts_num = 1 if dist_moved<=0.15: time.sleep(0.1) pbshr.publish(mk) return pts_2d = pts_2d[:,reject_pts_num:] #rad = 0.3 rad = 1.1 start_pos = st rad,cx,cy = at.fit_circle(rad, start_pos[0,0], start_pos[1,0]-rad, pts_2d, method='fmin_bfgs', verbose=False, rad_fix = False) #verbose=False, rad_fix = True) #print 'rad, cx, cy:', rad, cx, cy #print 'n_pts:', n_pts mk.cx = cx mk.cy = cy mk.rad = rad pbshr.publish(mk) #rospy.logout('oye hoye hoye') # append the point to the trajectory def trajectory_cb(pt32, tup): cp_list, lock = tup lock.acquire() cp_list.append([pt32.x, pt32.y, pt32.z]) lock.release() if __name__ == '__main__': cartesian_points_list = [] lock = RLock() rospy.init_node('kinematics_estimator_least_sq') mech_kin_pub = rospy.Publisher('mechanism_kinematics_rot', MechanismKinematicsRot) rospy.Subscriber('mechanism_trajectory', Point32, trajectory_cb, (cartesian_points_list, lock)) rospy.logout('Begin') while not rospy.is_shutdown(): circle_estimator(cartesian_points_list, mech_kin_pub, lock) rospy.sleep(0.01) rospy.logout('End')
ajibawa-2023/Python-Code-Large/train/row_99739
54
122
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Import_L31_C0", "label": "roslib import roslib", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.2541, 0.0082, 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; roslib.load_manifest('epc_door_opening')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L31_C15", "label": "load_manifest()", "type": "expression", "loc": [31, 31], "level": 0, "parent": null, "vector": [8, 0, 0.2541, 0.0082, 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": "import roslib; roslib.load_manifest('epc_door_opening')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Import_L32_C0", "label": "rospy import rospy", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.2623, 0.0082, 0, 0.66, 0.1818, 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_99739:ImportFrom_L34_C0", "label": "from epc_door_opening.msg import MechanismKinematicsRot", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.2787, 0.0082, 0, 0.66, 0.2727, 927, 0, 1, 0, 0, 927, 0, 0], "semantic": {"name": "epc_door_opening.msg", "arg_names": [], "import_names": ["MechanismKinematicsRot"], "rhs_call_name": "", "annotation": ""}, "snippet": "from epc_door_opening.msg import MechanismKinematicsRot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:ImportFrom_L35_C0", "label": "from geometry_msgs.msg import Point32", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.2869, 0.0082, 0, 0.66, 0.3636, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Import_L37_C0", "label": "doors_forces_kinematics.arm_trajectories import at", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.3033, 0.0082, 0, 0.66, 0.4545, 166, 0, 1, 0, 0, 166, 0, 0], "semantic": {"name": "doors_forces_kinematics.arm_trajectories", "arg_names": [], "import_names": ["at"], "rhs_call_name": "", "annotation": ""}, "snippet": "import doors_forces_kinematics.arm_trajectories as at"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:ImportFrom_L39_C0", "label": "from threading import RLock", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.3197, 0.0082, 0, 0.66, 0.5455, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["RLock"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import RLock"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Import_L40_C0", "label": "numpy import np", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.3279, 0.0082, 0, 0.66, 0.6364, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Import_L41_C0", "label": "time import time", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.3361, 0.0082, 0, 0.66, 0.7273, 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_99739:FunctionDef_L48_C0", "label": "circle_estimator", "type": "function", "loc": [48, 95], "level": 0, "parent": null, "vector": [2, 0, 0.5861, 0.3934, 0, 0.66, 0.8182, 512, 0, 3, 0, 0, 0, 0, 11], "semantic": {"name": "circle_estimator", "arg_names": ["cartesian_pts_list", "pbshr", "lock"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def circle_estimator(cartesian_pts_list, pbshr, lock):\n lock.acquire()\n n_pts = len(cartesian_pts_list)\n pts_2d = (np.matrix(cartesian_pts_list).T)[0:2,:]\n lock.release()\n\n if n_pts<2:\n time.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L49_C4", "label": "acquire()", "type": "expression", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [8, 1, 0.4016, 0.0082, 1, 0.16, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L50_C4", "label": "n_pts = len()", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [14, 1, 0.4098, 0.0082, 1, 0.16, 0.0455, 156, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_pts", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_pts = len(cartesian_pts_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L51_C4", "label": "pts_2d =", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [14, 1, 0.418, 0.0082, 1, 0.16, 0.0909, 945, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts_2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_2d = (np.matrix(cartesian_pts_list).T)[0:2,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L52_C4", "label": "release()", "type": "expression", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [8, 1, 0.4262, 0.0082, 1, 0.16, 0.1364, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L54_C4", "label": "if", "type": "if", "loc": [54, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [4, 1, 0.4549, 0.0328, 1, 0.16, 0.1818, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_pts<2:\n time.sleep(0.1)\n #pbshr.publish(mk) # don't publish anything.\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L55_C8", "label": "sleep()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L54_C4", "vector": [8, 2, 0.4508, 0.0082, 2, 0.65, 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.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Return_L57_C8", "label": "return", "type": "return", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L54_C4", "vector": [13, 2, 0.4672, 0.0082, 2, 0.65, 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_99739:Assign_L59_C4", "label": "st =", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [14, 1, 0.4836, 0.0082, 1, 0.16, 0.2273, 93, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "st", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " st = pts_2d[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L60_C4", "label": "now =", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [14, 1, 0.4918, 0.0082, 1, 0.16, 0.2727, 894, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "now", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " now = pts_2d[:,-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L62_C4", "label": "mk = MechanismKinematicsRot()", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [14, 1, 0.5082, 0.0082, 1, 0.16, 0.3182, 141, 3, 0, 0, 0, 603, 10, 1], "semantic": {"name": "mk", "arg_names": [], "import_names": [], "rhs_call_name": "MechanismKinematicsRot", "annotation": ""}, "snippet": " mk = MechanismKinematicsRot()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L63_C4", "label": "mk.cx =", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [14, 1, 0.5164, 0.0082, 1, 0.16, 0.3636, 127, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "mk.cx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mk.cx = 0.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L64_C4", "label": "mk.cy =", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [14, 1, 0.5246, 0.0082, 1, 0.16, 0.4091, 802, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mk.cy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mk.cy = -3.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L65_C4", "label": "mk.cz =", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [14, 1, 0.5328, 0.0082, 1, 0.16, 0.4545, 779, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mk.cz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mk.cz = cartesian_pts_list[0][2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L66_C4", "label": "mk.rad =", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [14, 1, 0.541, 0.0082, 1, 0.16, 0.5, 141, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "mk.rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mk.rad = 10."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L68_C4", "label": "dist_moved = norm()", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [14, 1, 0.5574, 0.0082, 1, 0.16, 0.5455, 696, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "dist_moved", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " dist_moved = np.linalg.norm(st-now)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L74_C4", "label": "reject_pts_num =", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [14, 1, 0.6066, 0.0082, 1, 0.16, 0.5909, 801, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "reject_pts_num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " reject_pts_num = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L76_C4", "label": "if", "type": "if", "loc": [76, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [4, 1, 0.6352, 0.0328, 1, 0.16, 0.6364, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dist_moved<=0.15:\n time.sleep(0.1)\n pbshr.publish(mk)\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L77_C8", "label": "sleep()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L76_C4", "vector": [8, 2, 0.6311, 0.0082, 2, 0.21, 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.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L78_C8", "label": "publish()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L76_C4", "vector": [8, 2, 0.6393, 0.0082, 2, 0.21, 0.5, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " pbshr.publish(mk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Return_L79_C8", "label": "return", "type": "return", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L76_C4", "vector": [13, 2, 0.6475, 0.0082, 2, 0.21, 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_99739:Assign_L81_C4", "label": "pts_2d =", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [14, 1, 0.6639, 0.0082, 1, 0.16, 0.6818, 945, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_2d = pts_2d[:,reject_pts_num:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L84_C4", "label": "rad =", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [14, 1, 0.6885, 0.0082, 1, 0.16, 0.7273, 439, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = 1.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L85_C4", "label": "start_pos =", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [14, 1, 0.6967, 0.0082, 1, 0.16, 0.7727, 12, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_pos = st"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L86_C4", "label": "rad, cx, cy = fit_circle()", "type": "assigned_variable", "loc": [86, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [14, 1, 0.7131, 0.0246, 1, 0.16, 0.8182, 693, 3, 7, 0, 0, 441, 10, 1], "semantic": {"name": "rad, cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "fit_circle", "annotation": ""}, "snippet": " rad,cx,cy = at.fit_circle(rad, start_pos[0,0], start_pos[1,0]-rad,\n pts_2d, method='fmin_bfgs',\n verbose=False, rad_fix = False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L92_C4", "label": "mk.cx =", "type": "assigned_variable", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [14, 1, 0.7541, 0.0082, 1, 0.16, 0.8636, 127, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mk.cx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mk.cx = cx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L93_C4", "label": "mk.cy =", "type": "assigned_variable", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [14, 1, 0.7623, 0.0082, 1, 0.16, 0.9091, 802, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mk.cy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mk.cy = cy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L94_C4", "label": "mk.rad =", "type": "assigned_variable", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [14, 1, 0.7705, 0.0082, 1, 0.16, 0.9545, 141, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mk.rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mk.rad = rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L95_C4", "label": "publish()", "type": "expression", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "vector": [8, 1, 0.7787, 0.0082, 1, 0.16, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " pbshr.publish(mk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L99_C0", "label": "trajectory_cb", "type": "function", "loc": [99, 103], "level": 0, "parent": null, "vector": [2, 0, 0.8279, 0.041, 0, 0.66, 0.9091, 232, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "trajectory_cb", "arg_names": ["pt32", "tup"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def trajectory_cb(pt32, tup):\n cp_list, lock = tup\n lock.acquire()\n cp_list.append([pt32.x, pt32.y, pt32.z])\n lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L100_C4", "label": "cp_list, lock =", "type": "assigned_variable", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L99_C0", "vector": [14, 1, 0.8197, 0.0082, 1, 0.48, 0.0, 223, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cp_list, lock", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cp_list, lock = tup"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L101_C4", "label": "acquire()", "type": "expression", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L99_C0", "vector": [8, 1, 0.8279, 0.0082, 1, 0.48, 0.3333, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L102_C4", "label": "append()", "type": "expression", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L99_C0", "vector": [8, 1, 0.8361, 0.0082, 1, 0.48, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " cp_list.append([pt32.x, pt32.y, pt32.z])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L103_C4", "label": "release()", "type": "expression", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L99_C0", "vector": [8, 1, 0.8443, 0.0082, 1, 0.48, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L106_C0", "label": "if", "type": "if", "loc": [106, 120], "level": 0, "parent": null, "vector": [4, 0, 0.9262, 0.123, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n\n cartesian_points_list = []\n lock = RLock()\n rospy.init_node('kinematics_estimator_least_sq')\n mech_kin_pub = rospy.Publisher('mechanism_kinematics_rot',\n MechanismKinematicsRot)\n rospy.Subscriber('mechanism_trajectory', Point32, trajectory_cb,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L108_C4", "label": "cartesian_points_list =", "type": "assigned_variable", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L106_C0", "vector": [14, 1, 0.8852, 0.0082, 1, 0.07, 0.0, 190, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "cartesian_points_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cartesian_points_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L109_C4", "label": "lock = RLock()", "type": "assigned_variable", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L106_C0", "vector": [14, 1, 0.8934, 0.0082, 1, 0.07, 0.1429, 104, 3, 0, 0, 0, 207, 10, 1], "semantic": {"name": "lock", "arg_names": [], "import_names": [], "rhs_call_name": "RLock", "annotation": ""}, "snippet": " lock = RLock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L110_C4", "label": "init_node()", "type": "expression", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L106_C0", "vector": [8, 1, 0.9016, 0.0082, 1, 0.07, 0.2857, 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('kinematics_estimator_least_sq')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L111_C4", "label": "mech_kin_pub = Publisher()", "type": "assigned_variable", "loc": [111, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L106_C0", "vector": [14, 1, 0.9139, 0.0164, 1, 0.07, 0.4286, 189, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "mech_kin_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " mech_kin_pub = rospy.Publisher('mechanism_kinematics_rot',\n MechanismKinematicsRot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L113_C4", "label": "Subscriber()", "type": "expression", "loc": [113, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L106_C0", "vector": [8, 1, 0.9303, 0.0164, 1, 0.07, 0.5714, 455, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('mechanism_trajectory', Point32, trajectory_cb,\n (cartesian_points_list, lock))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L116_C4", "label": "logout()", "type": "expression", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L106_C0", "vector": [8, 1, 0.9508, 0.0082, 1, 0.07, 0.7143, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('Begin')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:While_L117_C4", "label": "while", "type": "while", "loc": [117, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L106_C0", "vector": [5, 1, 0.9672, 0.0246, 1, 0.07, 0.8571, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n circle_estimator(cartesian_points_list, mech_kin_pub, lock)\n rospy.sleep(0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L118_C8", "label": "circle_estimator()", "type": "expression", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:While_L117_C4", "vector": [8, 2, 0.9672, 0.0082, 2, 0.47, 0.0, 512, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "circle_estimator", "arg_names": [], "import_names": [], "rhs_call_name": "circle_estimator", "annotation": ""}, "snippet": " circle_estimator(cartesian_points_list, mech_kin_pub, lock)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L119_C8", "label": "sleep()", "type": "expression", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:While_L117_C4", "vector": [8, 2, 0.9754, 0.0082, 2, 0.47, 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.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L120_C4", "label": "logout()", "type": "expression", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L106_C0", "vector": [8, 1, 0.9836, 0.0082, 1, 0.07, 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('End')"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Return_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Return_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:While_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:While_L117_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:While_L117_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99739:If_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99739:Expr_L120_C4"}]
# # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Author: Advait Jain import numpy as np, math import copy from threading import RLock import roslib; roslib.load_manifest('epc_door_opening') import rospy from epc_door_opening.msg import MechanismKinematicsRot from epc_door_opening.msg import MechanismKinematicsJac from epc_door_opening.msg import ForceTrajectory from geometry_msgs.msg import Point32 from std_msgs.msg import Empty import epc_core.epc as epc import hrl_lib.util as ut class Door_EPC(epc.EPC): def __init__(self, robot): epc.EPC.__init__(self, robot) self.mech_kinematics_lock = RLock() self.fit_circle_lock = RLock() rospy.Subscriber('mechanism_kinematics_rot', MechanismKinematicsRot, self.mechanism_kinematics_rot_cb) rospy.Subscriber('epc/stop', Empty, self.stop_cb) # used in the ROS stop_cb and equi_pt_generator_control_radial_force self.force_traj_pub = rospy.Publisher('epc/force_test', ForceTrajectory) self.mech_traj_pub = rospy.Publisher('mechanism_trajectory', Point32) def init_log(self): self.f_list = [] self.f_list_ati = [] self.f_list_estimate = [] self.f_list_torques = [] self.cep_list = [] self.ee_list = [] self.ft = ForceTrajectory() if self.mechanism_type != '': self.ft.type = self.mechanism_type else: self.ft.type = 'rotary' def log_state(self, arm): # only logging the right arm. f = self.robot.get_wrist_force_ati(arm, base_frame=True) self.f_list_ati.append(f.A1.tolist()) f = self.robot.get_wrist_force_estimate(arm, base_frame=True) self.f_list_estimate.append(f.A1.tolist()) f = self.robot.get_force_from_torques(arm) self.f_list_torques.append(f.A1.tolist()) f = self.robot.get_wrist_force(arm, base_frame=True) self.f_list.append(f.A1.tolist()) cep, _ = self.robot.get_cep_jtt(arm, hook_tip=True) self.cep_list.append(cep.A1.tolist()) # ee, _ = self.robot.get_ee_jtt(arm) ee, _ = self.robot.end_effector_pos(arm) self.ee_list.append(ee.A1.tolist()) if self.started_pulling_on_handle == False: if f[0,0] > 10.: self.started_pulling_on_handle_count += 1 else: self.started_pulling_on_handle_count = 0 self.init_log() # reset logs until started pulling on the handle. self.init_tangent_vector = None if self.started_pulling_on_handle_count > 1: self.started_pulling_on_handle = True return '' ## ROS callback. Stop and maintain position. def stop_cb(self, cmd): self.stopping_string = 'stop_cb called.' def common_stopping_conditions(self): stop = '' # right arm only. wrist_force = self.robot.get_wrist_force(0, base_frame=True) mag = np.linalg.norm(wrist_force) if mag > self.eq_force_threshold: stop = 'force exceed' if mag < 1.2 and self.hooked_location_moved: if (self.prev_force_mag - mag) > 30.: stop = 'slip: force step decrease and below thresold.' else: self.slip_count += 1 else: self.slip_count = 0 if self.slip_count == 10: stop = 'slip: force below threshold for too long.' return stop def mechanism_kinematics_rot_cb(self, mk): self.fit_circle_lock.acquire() self.cx_start = mk.cx self.cy_start = mk.cy self.cz_start = mk.cz self.rad = mk.rad self.fit_circle_lock.release() ## constantly update the estimate of the kinematics and move the # equilibrium point along the tangent of the estimated arc, and # try to keep the radial force constant. # @param h_force_possible - True (hook side) or False (hook up). # @param v_force_possible - False (hook side) or True (hook up). # Is maintaining a radial force possible or not (based on hook # geometry and orientation) # @param cep_vel - tangential velocity of the cep in m/s def cep_gen_control_radial_force(self, arm, cep, cep_vel): self.log_state(arm) if self.started_pulling_on_handle == False: cep_vel = 0.02 #step_size = 0.01 * cep_vel step_size = 0.1 * cep_vel # 0.1 is the time interval between calls to the equi_generator function (see pull) stop = self.common_stopping_conditions() wrist_force = self.robot.get_wrist_force(arm, base_frame=True) mag = np.linalg.norm(wrist_force) curr_pos, _ = self.robot.get_ee_jtt(arm) if len(self.ee_list)>1: start_pos = np.matrix(self.ee_list[0]).T else: start_pos = curr_pos #mechanism kinematics. if self.started_pulling_on_handle: self.mech_traj_pub.publish(Point32(curr_pos[0,0], curr_pos[1,0], curr_pos[2,0])) self.fit_circle_lock.acquire() rad = self.rad cx_start, cy_start = self.cx_start, self.cy_start cz_start = self.cz_start self.fit_circle_lock.release() cx, cy = cx_start, cy_start cz = cz_start print 'cx, cy, r:', cx, cy, rad radial_vec = curr_pos - np.matrix([cx,cy,cz]).T radial_vec = radial_vec/np.linalg.norm(radial_vec) if cy_start < start_pos[1,0]: tan_x,tan_y = -radial_vec[1,0],radial_vec[0,0] else: tan_x,tan_y = radial_vec[1,0],-radial_vec[0,0] if tan_x > 0. and (start_pos[0,0]-curr_pos[0,0]) < 0.09: tan_x = -tan_x tan_y = -tan_y if cy_start > start_pos[1,0]: radial_vec = -radial_vec # axis to the left, want force in # anti-radial direction. rv = radial_vec force_vec = np.matrix([rv[0,0], rv[1,0], 0.]).T tangential_vec = np.matrix([tan_x, tan_y, 0.]).T tangential_vec_ts = tangential_vec radial_vec_ts = radial_vec force_vec_ts = force_vec if arm == 'right_arm' or arm == 0: if force_vec_ts[1,0] < 0.: # only allowing force to the left force_vec_ts = -force_vec_ts else: if force_vec_ts[1,0] > 0.: # only allowing force to the right force_vec_ts = -force_vec_ts f_vec = -1*np.array([wrist_force[0,0], wrist_force[1,0], wrist_force[2,0]]) f_rad_mag = np.dot(f_vec, force_vec.A1) err = f_rad_mag-4. if err>0.: kp = -0.1 else: kp = -0.2 radial_motion_mag = kp * err # radial_motion_mag in cm (depends on eq_motion step size) radial_motion_vec = force_vec * radial_motion_mag print 'tangential_vec:', tangential_vec.A1 eq_motion_vec = copy.copy(tangential_vec) eq_motion_vec += radial_motion_vec self.prev_force_mag = mag if self.init_tangent_vector == None or self.started_pulling_on_handle == False: self.init_tangent_vector = copy.copy(tangential_vec_ts) c = np.dot(tangential_vec_ts.A1, self.init_tangent_vector.A1) ang = np.arccos(c) if np.isnan(ang): ang = 0. tangential_vec = tangential_vec / np.linalg.norm(tangential_vec) # paranoia abot vectors not being unit vectors. dist_moved = np.dot((curr_pos - start_pos).A1, tangential_vec_ts.A1) ftan = abs(np.dot(wrist_force.A1, tangential_vec.A1)) self.ft.tangential_force.append(ftan) self.ft.radial_force.append(f_rad_mag) if self.ft.type == 'rotary': self.ft.configuration.append(ang) else: # drawer print 'dist_moved:', dist_moved self.ft.configuration.append(dist_moved) if self.started_pulling_on_handle: self.force_traj_pub.publish(self.ft) # if self.started_pulling_on_handle == False: # ftan_pull_test = -np.dot(wrist_force.A1, tangential_vec.A1) # print 'ftan_pull_test:', ftan_pull_test # if ftan_pull_test > 5.: # self.started_pulling_on_handle_count += 1 # else: # self.started_pulling_on_handle_count = 0 # self.init_log() # reset logs until started pulling on the handle. # self.init_tangent_vector = None # # if self.started_pulling_on_handle_count > 1: # self.started_pulling_on_handle = True if abs(dist_moved) > 0.09 and self.hooked_location_moved == False: # change the force threshold once the hook has started pulling. self.hooked_location_moved = True self.eq_force_threshold = ut.bound(mag+30.,20.,80.) self.ftan_threshold = 1.2 * self.ftan_threshold + 20. if self.hooked_location_moved: if abs(tangential_vec_ts[2,0]) < 0.2 and ftan > self.ftan_threshold: stop = 'ftan threshold exceed: %f'%ftan else: self.ftan_threshold = max(self.ftan_threshold, ftan) if self.hooked_location_moved and ang > math.radians(85.): print 'Angle:', math.degrees(ang) self.open_ang_exceed_count += 1 if self.open_ang_exceed_count > 2: stop = 'opened mechanism through large angle: %.1f'%(math.degrees(ang)) else: self.open_ang_exceed_count = 0 cep_t = cep + eq_motion_vec * step_size cep[0,0] = cep_t[0,0] cep[1,0] = cep_t[1,0] cep[2,0] = cep_t[2,0] print 'CEP:', cep.A1 stop = stop + self.stopping_string return stop, (cep, None) def pull(self, arm, force_threshold, cep_vel, mechanism_type=''): self.mechanism_type = mechanism_type self.stopping_string = '' self.eq_pt_not_moving_counter = 0 self.init_log() self.init_tangent_vector = None self.open_ang_exceed_count = 0. self.eq_force_threshold = force_threshold self.ftan_threshold = 2. self.hooked_location_moved = False # flag to indicate when the hooking location started moving. self.prev_force_mag = np.linalg.norm(self.robot.get_wrist_force(arm)) self.slip_count = 0 self.started_pulling_on_handle = False self.started_pulling_on_handle_count = 0 ee_pos, _ = self.robot.get_ee_jtt(arm) self.cx_start = ee_pos[0,0] self.rad = 10.0 self.cy_start = ee_pos[1,0]-self.rad self.cz_start = ee_pos[2,0] cep, _ = self.robot.get_cep_jtt(arm) arg_list = [arm, cep, cep_vel] result, _ = self.epc_motion(self.cep_gen_control_radial_force, 0.1, arm, arg_list, self.log_state, #0.01, arm, arg_list, control_function = self.robot.set_cep_jtt) print 'EPC motion result:', result print 'Original force threshold:', force_threshold print 'Adapted force threshold:', self.eq_force_threshold print 'Adapted ftan threshold:', self.ftan_threshold d = { 'f_list': self.f_list, 'ee_list': self.ee_list, 'cep_list': self.cep_list, 'ftan_list': self.ft.tangential_force, 'config_list': self.ft.configuration, 'frad_list': self.ft.radial_force, 'f_list_ati': self.f_list_ati, 'f_list_estimate': self.f_list_estimate, 'f_list_torques': self.f_list_torques } ut.save_pickle(d,'pr2_pull_'+ut.formatted_time()+'.pkl') def search_and_hook(self, arm, hook_loc, hooking_force_threshold = 5., hit_threshold=15., hit_motions = 1, hook_direction = 'left'): # this needs to be debugged. Hardcoded for now. #if arm == 'right_arm' or arm == 0: # hook_dir = np.matrix([0., 1., 0.]).T # hook direc in home position # offset = -0.03 #elif arm == 'left_arm' or arm == 1: # hook_dir = np.matrix([0., -1., 0.]).T # hook direc in home position # offset = -0.03 #else: # raise RuntimeError('Unknown arm: %s', arm) #start_loc = hook_loc + rot_mat.T * hook_dir * offset if hook_direction == 'left': #offset = np.matrix([0., -0.03, 0.]).T offset = np.matrix([0., -0.0, 0.]).T move_dir = np.matrix([0., 1., 0.]).T elif hook_direction == 'up': #offset = np.matrix([0., 0., -0.03]).T offset = np.matrix([0., 0., -0.0]).T move_dir = np.matrix([0., 0., 1.]).T start_loc = hook_loc + offset # vector normal to surface and pointing into the surface. normal_tl = np.matrix([1.0, 0., 0.]).T pt1 = start_loc - normal_tl * 0.1 self.robot.go_cep_jtt(arm, pt1) # raw_input('Hit ENTER to go') vec = normal_tl * 0.2 rospy.sleep(1.) for i in range(hit_motions): s = self.move_till_hit(arm, vec=vec, force_threshold=hit_threshold, speed=0.07) cep_start, _ = self.robot.get_cep_jtt(arm) cep = copy.copy(cep_start) arg_list = [arm, move_dir, hooking_force_threshold, cep, cep_start] print 'Hi there.' s = self.epc_motion(self.cep_gen_surface_follow, 0.1, arm, arg_list, control_function = self.robot.set_cep_jtt) print 'result:', s return s if __name__ == '__main__': import pr2_arms.pr2_arms as pa rospy.init_node('epc_pr2', anonymous = True) rospy.logout('epc_pr2: ready') pr2_arms = pa.PR2Arms(primary_ft_sensor='ati') #pr2_arms = pa.PR2Arms(primary_ft_sensor='estimate') door_epc = Door_EPC(pr2_arms) r_arm, l_arm = 0, 1 arm = r_arm tip = np.matrix([0.32, 0., 0.]).T pr2_arms.arms.set_tooltip(arm, tip) print 'Put the hook within the PR2 gripper' raw_input('Hit ENTER to close') pr2_arms.close_gripper(arm, effort=30) raw_input('Turn off the motors and position the arm so that the hook is in an appropriate orientation') # for cabinets. #p1 = np.matrix([0.8, -0.40, -0.04]).T # pos 3 #p1 = np.matrix([0.8, -0.10, -0.04]).T # pos 2 p1 = np.matrix([0.85, -0.4, 0.1]).T # pos 1 pr2_arms.go_cep_jtt(arm, p1) print 'Move the base so that hook is close to the handle' raw_input('Hit ENTER to start Door Opening') pr2_arms.close_gripper(arm, effort=80) door_epc.search_and_hook(arm, p1, hook_direction='left') door_epc.pull(arm, force_threshold=40., cep_vel=0.05) # # hrl toolchest drawer. # p1 = np.matrix([0.8, -0.2, -0.17]).T # door_epc.search_and_hook(arm, p1, hook_direction='up') # door_epc.pull(arm, force_threshold=40., cep_vel=0.05)
ajibawa-2023/Python-Code-Large/train/row_99740
238
420
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Import_L30_C0", "label": "numpy import np, math", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0024, 0, 0.66, 0.0, 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_99740:Import_L31_C0", "label": "copy import copy", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.0738, 0.0024, 0, 0.66, 0.0714, 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_99740:ImportFrom_L32_C0", "label": "from threading import RLock", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.0762, 0.0024, 0, 0.66, 0.1429, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["RLock"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import RLock"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Import_L34_C0", "label": "roslib import roslib", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.081, 0.0024, 0, 0.66, 0.2143, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('epc_door_opening')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L34_C15", "label": "load_manifest()", "type": "expression", "loc": [34, 34], "level": 0, "parent": null, "vector": [8, 0, 0.081, 0.0024, 0, 0.66, 0.2857, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('epc_door_opening')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Import_L35_C0", "label": "rospy import rospy", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0024, 0, 0.66, 0.3571, 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_99740:ImportFrom_L37_C0", "label": "from epc_door_opening.msg import MechanismKinematicsRot", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.0881, 0.0024, 0, 0.66, 0.4286, 927, 0, 1, 0, 0, 927, 0, 0], "semantic": {"name": "epc_door_opening.msg", "arg_names": [], "import_names": ["MechanismKinematicsRot"], "rhs_call_name": "", "annotation": ""}, "snippet": "from epc_door_opening.msg import MechanismKinematicsRot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:ImportFrom_L38_C0", "label": "from epc_door_opening.msg import MechanismKinematicsJac", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.0905, 0.0024, 0, 0.66, 0.5, 927, 0, 1, 0, 0, 927, 0, 0], "semantic": {"name": "epc_door_opening.msg", "arg_names": [], "import_names": ["MechanismKinematicsJac"], "rhs_call_name": "", "annotation": ""}, "snippet": "from epc_door_opening.msg import MechanismKinematicsJac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:ImportFrom_L39_C0", "label": "from epc_door_opening.msg import ForceTrajectory", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.0929, 0.0024, 0, 0.66, 0.5714, 927, 0, 1, 0, 0, 927, 0, 0], "semantic": {"name": "epc_door_opening.msg", "arg_names": [], "import_names": ["ForceTrajectory"], "rhs_call_name": "", "annotation": ""}, "snippet": "from epc_door_opening.msg import ForceTrajectory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:ImportFrom_L40_C0", "label": "from geometry_msgs.msg import Point32", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.0952, 0.0024, 0, 0.66, 0.6429, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:ImportFrom_L41_C0", "label": "from std_msgs.msg import Empty", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.0976, 0.0024, 0, 0.66, 0.7143, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Empty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Import_L43_C0", "label": "epc_core.epc import epc", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.1024, 0.0024, 0, 0.66, 0.7857, 59, 0, 1, 0, 0, 59, 0, 0], "semantic": {"name": "epc_core.epc", "arg_names": [], "import_names": ["epc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import epc_core.epc as epc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Import_L44_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.1048, 0.0024, 0, 0.66, 0.8571, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:ClassDef_L46_C0", "label": "Door_EPC", "type": "class", "loc": [46, 379], "level": 0, "parent": null, "vector": [3, 0, 0.506, 0.7952, 0, 0.66, 0.9286, 468, 0, 9, 0, 0, 62, 0, 99], "semantic": {"name": "Door_EPC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Door_EPC(epc.EPC):\n def __init__(self, robot):\n epc.EPC.__init__(self, robot)\n\n self.mech_kinematics_lock = RLock()\n self.fit_circle_lock = RLock()\n\n rospy.Subscriber('mechanism_kinematics_rot',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L47_C4", "label": "__init__", "type": "function", "loc": [47, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:ClassDef_L46_C0", "vector": [2, 1, 0.1262, 0.031, 1, 0.42, 0.0, 555, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "__init__", "arg_names": ["self", "robot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, robot):\n epc.EPC.__init__(self, robot)\n\n self.mech_kinematics_lock = RLock()\n self.fit_circle_lock = RLock()\n\n rospy.Subscriber('mechanism_kinematics_rot',\n MechanismKinematicsRot,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L48_C8", "label": "__init__()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L47_C4", "vector": [8, 2, 0.1143, 0.0024, 2, 0.13, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " epc.EPC.__init__(self, robot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L50_C8", "label": "self.mech_kinematics_lock = RLock()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L47_C4", "vector": [14, 2, 0.119, 0.0024, 2, 0.13, 0.1667, 542, 3, 0, 0, 0, 207, 10, 1], "semantic": {"name": "self.mech_kinematics_lock", "arg_names": [], "import_names": [], "rhs_call_name": "RLock", "annotation": ""}, "snippet": " self.mech_kinematics_lock = RLock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L51_C8", "label": "self.fit_circle_lock = RLock()", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L47_C4", "vector": [14, 2, 0.1214, 0.0024, 2, 0.13, 0.3333, 336, 3, 0, 0, 0, 207, 10, 1], "semantic": {"name": "self.fit_circle_lock", "arg_names": [], "import_names": [], "rhs_call_name": "RLock", "annotation": ""}, "snippet": " self.fit_circle_lock = RLock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L53_C8", "label": "Subscriber()", "type": "expression", "loc": [53, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L47_C4", "vector": [8, 2, 0.1286, 0.0071, 2, 0.13, 0.5, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('mechanism_kinematics_rot',\n MechanismKinematicsRot,\n self.mechanism_kinematics_rot_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L56_C8", "label": "Subscriber()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L47_C4", "vector": [8, 2, 0.1333, 0.0024, 2, 0.13, 0.6667, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('epc/stop', Empty, self.stop_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L58_C8", "label": "self.force_traj_pub = Publisher()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L47_C4", "vector": [14, 2, 0.1381, 0.0024, 2, 0.13, 0.8333, 477, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.force_traj_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.force_traj_pub = rospy.Publisher('epc/force_test', ForceTrajectory)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L59_C8", "label": "self.mech_traj_pub = Publisher()", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L47_C4", "vector": [14, 2, 0.1405, 0.0024, 2, 0.13, 1.0, 690, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.mech_traj_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.mech_traj_pub = rospy.Publisher('mechanism_trajectory', Point32)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L61_C4", "label": "init_log", "type": "function", "loc": [61, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:ClassDef_L46_C0", "vector": [2, 1, 0.1583, 0.0286, 1, 0.42, 0.125, 377, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_log", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def init_log(self):\n self.f_list = []\n self.f_list_ati = []\n self.f_list_estimate = []\n self.f_list_torques = []\n self.cep_list = []\n self.ee_list = []\n self.ft = ForceTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L62_C8", "label": "self.f_list =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L61_C4", "vector": [14, 2, 0.1476, 0.0024, 2, 0.8, 0.0, 589, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.f_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L63_C8", "label": "self.f_list_ati =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L61_C4", "vector": [14, 2, 0.15, 0.0024, 2, 0.8, 0.1429, 588, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.f_list_ati", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.f_list_ati = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L64_C8", "label": "self.f_list_estimate =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L61_C4", "vector": [14, 2, 0.1524, 0.0024, 2, 0.8, 0.2857, 232, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.f_list_estimate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.f_list_estimate = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L65_C8", "label": "self.f_list_torques =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L61_C4", "vector": [14, 2, 0.1548, 0.0024, 2, 0.8, 0.4286, 446, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.f_list_torques", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.f_list_torques = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L66_C8", "label": "self.cep_list =", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L61_C4", "vector": [14, 2, 0.1571, 0.0024, 2, 0.8, 0.5714, 867, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.cep_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cep_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L67_C8", "label": "self.ee_list =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L61_C4", "vector": [14, 2, 0.1595, 0.0024, 2, 0.8, 0.7143, 959, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ee_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ee_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L68_C8", "label": "self.ft = ForceTrajectory()", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L61_C4", "vector": [14, 2, 0.1619, 0.0024, 2, 0.8, 0.8571, 470, 3, 0, 0, 0, 306, 10, 1], "semantic": {"name": "self.ft", "arg_names": [], "import_names": [], "rhs_call_name": "ForceTrajectory", "annotation": ""}, "snippet": " self.ft = ForceTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L69_C8", "label": "if", "type": "if", "loc": [69, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L61_C4", "vector": [4, 2, 0.1679, 0.0095, 2, 0.8, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.mechanism_type != '':\n self.ft.type = self.mechanism_type\n else:\n self.ft.type = 'rotary'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L70_C12", "label": "self.ft.type =", "type": "assigned_variable", "loc": [70, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L69_C8", "vector": [14, 3, 0.1667, 0.0024, 3, 0.48, 0.0, 531, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.ft.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ft.type = self.mechanism_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L72_C12", "label": "self.ft.type =", "type": "assigned_variable", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L69_C8", "vector": [14, 3, 0.1714, 0.0024, 3, 0.48, 1.0, 531, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.ft.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ft.type = 'rotary'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "label": "log_state", "type": "function", "loc": [74, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:ClassDef_L46_C0", "vector": [2, 1, 0.2131, 0.0762, 1, 0.42, 0.25, 805, 0, 2, 1, 0, 0, 0, 19], "semantic": {"name": "log_state", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def log_state(self, arm):\n # only logging the right arm.\n f = self.robot.get_wrist_force_ati(arm, base_frame=True)\n self.f_list_ati.append(f.A1.tolist())\n\n f = self.robot.get_wrist_force_estimate(arm, base_frame=True)\n self.f_list_estimate.append(f.A1.tolist())\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L76_C8", "label": "f = get_wrist_force_ati()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "vector": [14, 2, 0.181, 0.0024, 2, 0.63, 0.0, 899, 3, 2, 0, 0, 170, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force_ati", "annotation": ""}, "snippet": " f = self.robot.get_wrist_force_ati(arm, base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L77_C8", "label": "append()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "vector": [8, 2, 0.1833, 0.0024, 2, 0.63, 0.0769, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.f_list_ati.append(f.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L79_C8", "label": "f = get_wrist_force_estimate()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "vector": [14, 2, 0.1881, 0.0024, 2, 0.63, 0.1538, 899, 3, 2, 0, 0, 346, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force_estimate", "annotation": ""}, "snippet": " f = self.robot.get_wrist_force_estimate(arm, base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L80_C8", "label": "append()", "type": "expression", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "vector": [8, 2, 0.1905, 0.0024, 2, 0.63, 0.2308, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.f_list_estimate.append(f.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L82_C8", "label": "f = get_force_from_torques()", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "vector": [14, 2, 0.1952, 0.0024, 2, 0.63, 0.3077, 899, 3, 1, 0, 0, 497, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "get_force_from_torques", "annotation": ""}, "snippet": " f = self.robot.get_force_from_torques(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L83_C8", "label": "append()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "vector": [8, 2, 0.1976, 0.0024, 2, 0.63, 0.3846, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.f_list_torques.append(f.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L85_C8", "label": "f = get_wrist_force()", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "vector": [14, 2, 0.2024, 0.0024, 2, 0.63, 0.4615, 899, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " f = self.robot.get_wrist_force(arm, base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L86_C8", "label": "append()", "type": "expression", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "vector": [8, 2, 0.2048, 0.0024, 2, 0.63, 0.5385, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.f_list.append(f.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L88_C8", "label": "cep, _ = get_cep_jtt()", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "vector": [14, 2, 0.2095, 0.0024, 2, 0.63, 0.6154, 705, 3, 2, 0, 0, 532, 10, 1], "semantic": {"name": "cep, _", "arg_names": [], "import_names": [], "rhs_call_name": "get_cep_jtt", "annotation": ""}, "snippet": " cep, _ = self.robot.get_cep_jtt(arm, hook_tip=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L89_C8", "label": "append()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "vector": [8, 2, 0.2119, 0.0024, 2, 0.63, 0.6923, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.cep_list.append(cep.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L91_C8", "label": "ee, _ = end_effector_pos()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "vector": [14, 2, 0.2167, 0.0024, 2, 0.63, 0.7692, 241, 3, 1, 0, 0, 889, 10, 1], "semantic": {"name": "ee, _", "arg_names": [], "import_names": [], "rhs_call_name": "end_effector_pos", "annotation": ""}, "snippet": " ee, _ = self.robot.end_effector_pos(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L92_C8", "label": "append()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "vector": [8, 2, 0.219, 0.0024, 2, 0.63, 0.8462, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.ee_list.append(ee.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L94_C8", "label": "if", "type": "if", "loc": [94, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "vector": [4, 2, 0.2345, 0.0238, 2, 0.63, 0.9231, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.started_pulling_on_handle == False:\n if f[0,0] > 10.:\n self.started_pulling_on_handle_count += 1\n else:\n self.started_pulling_on_handle_count = 0\n self.init_log() # reset logs until started pulling on the handle.\n self.init_tangent_vector = None\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L95_C12", "label": "if", "type": "if", "loc": [95, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L94_C8", "vector": [4, 3, 0.2321, 0.0143, 3, 0.11, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if f[0,0] > 10.:\n self.started_pulling_on_handle_count += 1\n else:\n self.started_pulling_on_handle_count = 0\n self.init_log() # reset logs until started pulling on the handle.\n self.init_tangent_vector = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L98_C16", "label": "self.started_pulling_on_handle_count =", "type": "assigned_variable", "loc": [98, 98], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L95_C12", "vector": [14, 4, 0.2333, 0.0024, 4, 0.76, 0.0, 870, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.started_pulling_on_handle_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.started_pulling_on_handle_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L99_C16", "label": "init_log()", "type": "expression", "loc": [99, 99], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L95_C12", "vector": [8, 4, 0.2357, 0.0024, 4, 0.76, 0.5, 377, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init_log", "arg_names": [], "import_names": [], "rhs_call_name": "init_log", "annotation": ""}, "snippet": " self.init_log() # reset logs until started pulling on the handle."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L100_C16", "label": "self.init_tangent_vector =", "type": "assigned_variable", "loc": [100, 100], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L95_C12", "vector": [14, 4, 0.2381, 0.0024, 4, 0.76, 1.0, 965, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.init_tangent_vector", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.init_tangent_vector = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L102_C12", "label": "if", "type": "if", "loc": [102, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L94_C8", "vector": [4, 3, 0.244, 0.0048, 3, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.started_pulling_on_handle_count > 1:\n self.started_pulling_on_handle = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L103_C16", "label": "self.started_pulling_on_handle =", "type": "assigned_variable", "loc": [103, 103], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L102_C12", "vector": [14, 4, 0.2452, 0.0024, 4, 0.49, 0.0, 945, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.started_pulling_on_handle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.started_pulling_on_handle = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Return_L105_C8", "label": "return", "type": "return", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "vector": [13, 2, 0.25, 0.0024, 2, 0.63, 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_99740:FunctionDef_L108_C4", "label": "stop_cb", "type": "function", "loc": [108, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:ClassDef_L46_C0", "vector": [2, 1, 0.2583, 0.0048, 1, 0.42, 0.375, 430, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "stop_cb", "arg_names": ["self", "cmd"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop_cb(self, cmd):\n self.stopping_string = 'stop_cb called.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L109_C8", "label": "self.stopping_string =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L108_C4", "vector": [14, 2, 0.2595, 0.0024, 2, 0.87, 0.0, 265, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.stopping_string", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.stopping_string = 'stop_cb called.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L111_C4", "label": "common_stopping_conditions", "type": "function", "loc": [111, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:ClassDef_L46_C0", "vector": [2, 1, 0.2857, 0.0452, 1, 0.42, 0.5, 763, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "common_stopping_conditions", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def common_stopping_conditions(self):\n stop = ''\n # right arm only.\n wrist_force = self.robot.get_wrist_force(0, base_frame=True)\n mag = np.linalg.norm(wrist_force)\n if mag > self.eq_force_threshold:\n stop = 'force exceed'\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L112_C8", "label": "stop =", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L111_C4", "vector": [14, 2, 0.2667, 0.0024, 2, 0.93, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L114_C8", "label": "wrist_force = get_wrist_force()", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L111_C4", "vector": [14, 2, 0.2714, 0.0024, 2, 0.93, 0.1667, 483, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "wrist_force", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " wrist_force = self.robot.get_wrist_force(0, base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L115_C8", "label": "mag = norm()", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L111_C4", "vector": [14, 2, 0.2738, 0.0024, 2, 0.93, 0.3333, 533, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "mag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " mag = np.linalg.norm(wrist_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L116_C8", "label": "if", "type": "if", "loc": [116, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L111_C4", "vector": [4, 2, 0.2774, 0.0048, 2, 0.93, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mag > self.eq_force_threshold:\n stop = 'force exceed'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L117_C12", "label": "stop =", "type": "assigned_variable", "loc": [117, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L116_C8", "vector": [14, 3, 0.2786, 0.0024, 3, 0.08, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'force exceed'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L119_C8", "label": "if", "type": "if", "loc": [119, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L111_C4", "vector": [4, 2, 0.2905, 0.0167, 2, 0.93, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mag < 1.2 and self.hooked_location_moved:\n if (self.prev_force_mag - mag) > 30.:\n stop = 'slip: force step decrease and below thresold.'\n else:\n self.slip_count += 1\n else:\n self.slip_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L120_C12", "label": "if", "type": "if", "loc": [120, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L119_C8", "vector": [4, 3, 0.2893, 0.0095, 3, 0.51, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.prev_force_mag - mag) > 30.:\n stop = 'slip: force step decrease and below thresold.'\n else:\n self.slip_count += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L121_C16", "label": "stop =", "type": "assigned_variable", "loc": [121, 121], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L120_C12", "vector": [14, 4, 0.2881, 0.0024, 4, 0.53, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'slip: force step decrease and below thresold.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L125_C12", "label": "self.slip_count =", "type": "assigned_variable", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L119_C8", "vector": [14, 3, 0.2976, 0.0024, 3, 0.51, 1.0, 338, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.slip_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.slip_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L127_C8", "label": "if", "type": "if", "loc": [127, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L111_C4", "vector": [4, 2, 0.3036, 0.0048, 2, 0.93, 0.8333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.slip_count == 10:\n stop = 'slip: force below threshold for too long.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L128_C12", "label": "stop =", "type": "assigned_variable", "loc": [128, 128], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L127_C8", "vector": [14, 3, 0.3048, 0.0024, 3, 0.36, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'slip: force below threshold for too long.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Return_L129_C8", "label": "return", "type": "return", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L111_C4", "vector": [13, 2, 0.3071, 0.0024, 2, 0.93, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return stop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L131_C4", "label": "mechanism_kinematics_rot_cb", "type": "function", "loc": [131, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:ClassDef_L46_C0", "vector": [2, 1, 0.319, 0.0167, 1, 0.42, 0.625, 407, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "mechanism_kinematics_rot_cb", "arg_names": ["self", "mk"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def mechanism_kinematics_rot_cb(self, mk):\n self.fit_circle_lock.acquire()\n self.cx_start = mk.cx\n self.cy_start = mk.cy\n self.cz_start = mk.cz\n self.rad = mk.rad\n self.fit_circle_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L132_C8", "label": "acquire()", "type": "expression", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L131_C4", "vector": [8, 2, 0.3143, 0.0024, 2, 0.0, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.fit_circle_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L133_C8", "label": "self.cx_start =", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L131_C4", "vector": [14, 2, 0.3167, 0.0024, 2, 0.0, 0.2, 939, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cx_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cx_start = mk.cx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L134_C8", "label": "self.cy_start =", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L131_C4", "vector": [14, 2, 0.319, 0.0024, 2, 0.0, 0.4, 418, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cy_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cy_start = mk.cy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L135_C8", "label": "self.cz_start =", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L131_C4", "vector": [14, 2, 0.3214, 0.0024, 2, 0.0, 0.6, 113, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cz_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cz_start = mk.cz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L136_C8", "label": "self.rad =", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L131_C4", "vector": [14, 2, 0.3238, 0.0024, 2, 0.0, 0.8, 240, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rad = mk.rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L137_C8", "label": "release()", "type": "expression", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L131_C4", "vector": [8, 2, 0.3262, 0.0024, 2, 0.0, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.fit_circle_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "label": "cep_gen_control_radial_force", "type": "function", "loc": [147, 285], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:ClassDef_L46_C0", "vector": [2, 1, 0.5143, 0.331, 1, 0.42, 0.75, 877, 0, 4, 1, 0, 0, 0, 43], "semantic": {"name": "cep_gen_control_radial_force", "arg_names": ["self", "arm", "cep", "cep_vel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def cep_gen_control_radial_force(self, arm, cep, cep_vel):\n self.log_state(arm)\n if self.started_pulling_on_handle == False:\n cep_vel = 0.02\n\n #step_size = 0.01 * cep_vel\n step_size = 0.1 * cep_vel # 0.1 is the time interval between calls to the equi_generator function (see pull)\n stop = self.common_stopping_conditions()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L148_C8", "label": "log_state()", "type": "expression", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [8, 2, 0.3524, 0.0024, 2, 0.57, 0.0, 805, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log_state", "arg_names": [], "import_names": [], "rhs_call_name": "log_state", "annotation": ""}, "snippet": " self.log_state(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L149_C8", "label": "if", "type": "if", "loc": [149, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [4, 2, 0.356, 0.0048, 2, 0.57, 0.0172, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.started_pulling_on_handle == False:\n cep_vel = 0.02"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L150_C12", "label": "cep_vel =", "type": "assigned_variable", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L149_C8", "vector": [14, 3, 0.3571, 0.0024, 3, 0.89, 0.0, 568, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "cep_vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_vel = 0.02"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L153_C8", "label": "step_size =", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.3643, 0.0024, 2, 0.57, 0.0345, 764, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "step_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " step_size = 0.1 * cep_vel # 0.1 is the time interval between calls to the equi_generator function (see pull)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L154_C8", "label": "stop = common_stopping_conditions()", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.3667, 0.0024, 2, 0.57, 0.0517, 343, 3, 0, 0, 0, 763, 10, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "common_stopping_conditions", "annotation": ""}, "snippet": " stop = self.common_stopping_conditions()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L155_C8", "label": "wrist_force = get_wrist_force()", "type": "assigned_variable", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.369, 0.0024, 2, 0.57, 0.069, 483, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "wrist_force", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " wrist_force = self.robot.get_wrist_force(arm, base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L156_C8", "label": "mag = norm()", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.3714, 0.0024, 2, 0.57, 0.0862, 533, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "mag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " mag = np.linalg.norm(wrist_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L158_C8", "label": "curr_pos, _ = get_ee_jtt()", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.3762, 0.0024, 2, 0.57, 0.1034, 183, 3, 1, 0, 0, 15, 10, 1], "semantic": {"name": "curr_pos, _", "arg_names": [], "import_names": [], "rhs_call_name": "get_ee_jtt", "annotation": ""}, "snippet": " curr_pos, _ = self.robot.get_ee_jtt(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L159_C8", "label": "if", "type": "if", "loc": [159, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [4, 2, 0.3821, 0.0095, 2, 0.57, 0.1207, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(self.ee_list)>1:\n start_pos = np.matrix(self.ee_list[0]).T\n else:\n start_pos = curr_pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L160_C12", "label": "start_pos =", "type": "assigned_variable", "loc": [160, 160], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L159_C8", "vector": [14, 3, 0.381, 0.0024, 3, 0.68, 0.0, 12, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_pos = np.matrix(self.ee_list[0]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L162_C12", "label": "start_pos =", "type": "assigned_variable", "loc": [162, 162], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L159_C8", "vector": [14, 3, 0.3857, 0.0024, 3, 0.68, 1.0, 12, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_pos = curr_pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L165_C8", "label": "if", "type": "if", "loc": [165, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [4, 2, 0.3952, 0.0071, 2, 0.57, 0.1379, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.started_pulling_on_handle:\n self.mech_traj_pub.publish(Point32(curr_pos[0,0],\n curr_pos[1,0], curr_pos[2,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L166_C12", "label": "publish()", "type": "expression", "loc": [166, 167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L165_C8", "vector": [8, 3, 0.3964, 0.0048, 3, 0.13, 0.0, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.mech_traj_pub.publish(Point32(curr_pos[0,0],\n curr_pos[1,0], curr_pos[2,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L169_C8", "label": "acquire()", "type": "expression", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [8, 2, 0.4024, 0.0024, 2, 0.57, 0.1552, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.fit_circle_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L170_C8", "label": "rad =", "type": "assigned_variable", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.4048, 0.0024, 2, 0.57, 0.1724, 439, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = self.rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L171_C8", "label": "cx_start, cy_start =", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.4071, 0.0024, 2, 0.57, 0.1897, 372, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "cx_start, cy_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cx_start, cy_start = self.cx_start, self.cy_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L172_C8", "label": "cz_start =", "type": "assigned_variable", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.4095, 0.0024, 2, 0.57, 0.2069, 322, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cz_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cz_start = self.cz_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L173_C8", "label": "release()", "type": "expression", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [8, 2, 0.4119, 0.0024, 2, 0.57, 0.2241, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.fit_circle_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L174_C8", "label": "cx, cy =", "type": "assigned_variable", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.4143, 0.0024, 2, 0.57, 0.2414, 959, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cx, cy = cx_start, cy_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L175_C8", "label": "cz =", "type": "assigned_variable", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.4167, 0.0024, 2, 0.57, 0.2586, 330, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cz = cz_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L176_C8", "label": "print()", "type": "expression", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [8, 2, 0.419, 0.0024, 2, 0.57, 0.2759, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('cx, cy, r:', cx, cy, rad)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L178_C8", "label": "radial_vec =", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.4238, 0.0024, 2, 0.57, 0.2931, 253, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "radial_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec = curr_pos - np.matrix([cx,cy,cz]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L179_C8", "label": "radial_vec =", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.4262, 0.0024, 2, 0.57, 0.3103, 253, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "radial_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec = radial_vec/np.linalg.norm(radial_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L180_C8", "label": "if", "type": "if", "loc": [180, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [4, 2, 0.4321, 0.0095, 2, 0.57, 0.3276, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cy_start < start_pos[1,0]:\n tan_x,tan_y = -radial_vec[1,0],radial_vec[0,0]\n else:\n tan_x,tan_y = radial_vec[1,0],-radial_vec[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L181_C12", "label": "tan_x, tan_y =", "type": "assigned_variable", "loc": [181, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L180_C8", "vector": [14, 3, 0.431, 0.0024, 3, 0.68, 0.0, 33, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "tan_x, tan_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_x,tan_y = -radial_vec[1,0],radial_vec[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L183_C12", "label": "tan_x, tan_y =", "type": "assigned_variable", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L180_C8", "vector": [14, 3, 0.4357, 0.0024, 3, 0.68, 1.0, 33, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "tan_x, tan_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_x,tan_y = radial_vec[1,0],-radial_vec[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L185_C8", "label": "if", "type": "if", "loc": [185, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [4, 2, 0.4429, 0.0071, 2, 0.57, 0.3448, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tan_x > 0. and (start_pos[0,0]-curr_pos[0,0]) < 0.09:\n tan_x = -tan_x\n tan_y = -tan_y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L186_C12", "label": "tan_x =", "type": "assigned_variable", "loc": [186, 186], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L185_C8", "vector": [14, 3, 0.4429, 0.0024, 3, 0.98, 0.0, 718, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tan_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_x = -tan_x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L187_C12", "label": "tan_y =", "type": "assigned_variable", "loc": [187, 187], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L185_C8", "vector": [14, 3, 0.4452, 0.0024, 3, 0.98, 1.0, 936, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tan_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_y = -tan_y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L189_C8", "label": "if", "type": "if", "loc": [189, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [4, 2, 0.4512, 0.0048, 2, 0.57, 0.3621, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cy_start > start_pos[1,0]:\n radial_vec = -radial_vec # axis to the left, want force in"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L190_C12", "label": "radial_vec =", "type": "assigned_variable", "loc": [190, 190], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L189_C8", "vector": [14, 3, 0.4524, 0.0024, 3, 0.91, 0.0, 253, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radial_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec = -radial_vec # axis to the left, want force in"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L192_C8", "label": "rv =", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.4571, 0.0024, 2, 0.57, 0.3793, 222, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv = radial_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L193_C8", "label": "force_vec =", "type": "assigned_variable", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.4595, 0.0024, 2, 0.57, 0.3966, 819, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "force_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec = np.matrix([rv[0,0], rv[1,0], 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L194_C8", "label": "tangential_vec =", "type": "assigned_variable", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.4619, 0.0024, 2, 0.57, 0.4138, 367, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tangential_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tangential_vec = np.matrix([tan_x, tan_y, 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L196_C8", "label": "tangential_vec_ts =", "type": "assigned_variable", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.4667, 0.0024, 2, 0.57, 0.431, 833, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tangential_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tangential_vec_ts = tangential_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L197_C8", "label": "radial_vec_ts =", "type": "assigned_variable", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.469, 0.0024, 2, 0.57, 0.4483, 149, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radial_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec_ts = radial_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L198_C8", "label": "force_vec_ts =", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.4714, 0.0024, 2, 0.57, 0.4655, 900, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec_ts = force_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L200_C8", "label": "if", "type": "if", "loc": [200, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [4, 2, 0.4821, 0.0143, 2, 0.57, 0.4828, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'right_arm' or arm == 0:\n if force_vec_ts[1,0] < 0.: # only allowing force to the left\n force_vec_ts = -force_vec_ts\n else:\n if force_vec_ts[1,0] > 0.: # only allowing force to the right\n force_vec_ts = -force_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L201_C12", "label": "if", "type": "if", "loc": [201, 202], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L200_C8", "vector": [4, 3, 0.4798, 0.0048, 3, 0.08, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if force_vec_ts[1,0] < 0.: # only allowing force to the left\n force_vec_ts = -force_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L202_C16", "label": "force_vec_ts =", "type": "assigned_variable", "loc": [202, 202], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L201_C12", "vector": [14, 4, 0.481, 0.0024, 4, 0.76, 0.0, 900, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec_ts = -force_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L204_C12", "label": "if", "type": "if", "loc": [204, 205], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L200_C8", "vector": [4, 3, 0.4869, 0.0048, 3, 0.08, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if force_vec_ts[1,0] > 0.: # only allowing force to the right\n force_vec_ts = -force_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L205_C16", "label": "force_vec_ts =", "type": "assigned_variable", "loc": [205, 205], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L204_C12", "vector": [14, 4, 0.4881, 0.0024, 4, 0.28, 0.0, 900, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec_ts = -force_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L207_C8", "label": "f_vec =", "type": "assigned_variable", "loc": [207, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.494, 0.0048, 2, 0.57, 0.5, 231, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "f_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_vec = -1*np.array([wrist_force[0,0], wrist_force[1,0],\n wrist_force[2,0]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L209_C8", "label": "f_rad_mag = dot()", "type": "assigned_variable", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.4976, 0.0024, 2, 0.57, 0.5172, 421, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "f_rad_mag", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " f_rad_mag = np.dot(f_vec, force_vec.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L210_C8", "label": "err =", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.5, 0.0024, 2, 0.57, 0.5345, 541, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err = f_rad_mag-4."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L211_C8", "label": "if", "type": "if", "loc": [211, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [4, 2, 0.506, 0.0095, 2, 0.57, 0.5517, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if err>0.:\n kp = -0.1\n else:\n kp = -0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L212_C12", "label": "kp =", "type": "assigned_variable", "loc": [212, 212], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L211_C8", "vector": [14, 3, 0.5048, 0.0024, 3, 0.41, 0.0, 93, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "kp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kp = -0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L214_C12", "label": "kp =", "type": "assigned_variable", "loc": [214, 214], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L211_C8", "vector": [14, 3, 0.5095, 0.0024, 3, 0.41, 1.0, 93, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "kp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kp = -0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L215_C8", "label": "radial_motion_mag =", "type": "assigned_variable", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.5119, 0.0024, 2, 0.57, 0.569, 633, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radial_motion_mag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_motion_mag = kp * err # radial_motion_mag in cm (depends on eq_motion step size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L216_C8", "label": "radial_motion_vec =", "type": "assigned_variable", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.5143, 0.0024, 2, 0.57, 0.5862, 721, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radial_motion_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_motion_vec = force_vec * radial_motion_mag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L217_C8", "label": "print()", "type": "expression", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [8, 2, 0.5167, 0.0024, 2, 0.57, 0.6034, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('tangential_vec:', tangential_vec.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L218_C8", "label": "eq_motion_vec = copy()", "type": "assigned_variable", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.519, 0.0024, 2, 0.57, 0.6207, 4, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "eq_motion_vec", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " eq_motion_vec = copy.copy(tangential_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L221_C8", "label": "self.prev_force_mag =", "type": "assigned_variable", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.5262, 0.0024, 2, 0.57, 0.6379, 497, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.prev_force_mag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.prev_force_mag = mag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L223_C8", "label": "if", "type": "if", "loc": [223, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [4, 2, 0.5321, 0.0048, 2, 0.57, 0.6552, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.init_tangent_vector == None or self.started_pulling_on_handle == False:\n self.init_tangent_vector = copy.copy(tangential_vec_ts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L224_C12", "label": "self.init_tangent_vector = copy()", "type": "assigned_variable", "loc": [224, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L223_C8", "vector": [14, 3, 0.5333, 0.0024, 3, 0.45, 0.0, 965, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.init_tangent_vector", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.init_tangent_vector = copy.copy(tangential_vec_ts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L225_C8", "label": "c = dot()", "type": "assigned_variable", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.5357, 0.0024, 2, 0.57, 0.6724, 411, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " c = np.dot(tangential_vec_ts.A1, self.init_tangent_vector.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L226_C8", "label": "ang = arccos()", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.5381, 0.0024, 2, 0.57, 0.6897, 762, 3, 1, 0, 0, 793, 10, 1], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "arccos", "annotation": ""}, "snippet": " ang = np.arccos(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L227_C8", "label": "if", "type": "if", "loc": [227, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [4, 2, 0.5417, 0.0048, 2, 0.57, 0.7069, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.isnan(ang):\n ang = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L228_C12", "label": "ang =", "type": "assigned_variable", "loc": [228, 228], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L227_C8", "vector": [14, 3, 0.5429, 0.0024, 3, 0.15, 0.0, 762, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ang = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L230_C8", "label": "tangential_vec =", "type": "assigned_variable", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.5476, 0.0024, 2, 0.57, 0.7241, 367, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tangential_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tangential_vec = tangential_vec / np.linalg.norm(tangential_vec) # paranoia abot vectors not being unit vectors."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L231_C8", "label": "dist_moved = dot()", "type": "assigned_variable", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.55, 0.0024, 2, 0.57, 0.7414, 696, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "dist_moved", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " dist_moved = np.dot((curr_pos - start_pos).A1, tangential_vec_ts.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L232_C8", "label": "ftan = abs()", "type": "assigned_variable", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.5524, 0.0024, 2, 0.57, 0.7586, 771, 3, 1, 0, 0, 799, 10, 2], "semantic": {"name": "ftan", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " ftan = abs(np.dot(wrist_force.A1, tangential_vec.A1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L233_C8", "label": "append()", "type": "expression", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [8, 2, 0.5548, 0.0024, 2, 0.57, 0.7759, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.ft.tangential_force.append(ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L234_C8", "label": "append()", "type": "expression", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [8, 2, 0.5571, 0.0024, 2, 0.57, 0.7931, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.ft.radial_force.append(f_rad_mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L236_C8", "label": "if", "type": "if", "loc": [236, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [4, 2, 0.5667, 0.0119, 2, 0.57, 0.8103, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.ft.type == 'rotary':\n self.ft.configuration.append(ang)\n else: # drawer\n print('dist_moved:', dist_moved)\n self.ft.configuration.append(dist_moved)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L237_C12", "label": "append()", "type": "expression", "loc": [237, 237], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L236_C8", "vector": [8, 3, 0.5643, 0.0024, 3, 0.87, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.ft.configuration.append(ang)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L239_C12", "label": "print()", "type": "expression", "loc": [239, 239], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L236_C8", "vector": [8, 3, 0.569, 0.0024, 3, 0.87, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('dist_moved:', dist_moved)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L240_C12", "label": "append()", "type": "expression", "loc": [240, 240], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L236_C8", "vector": [8, 3, 0.5714, 0.0024, 3, 0.87, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.ft.configuration.append(dist_moved)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L242_C8", "label": "if", "type": "if", "loc": [242, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [4, 2, 0.5774, 0.0048, 2, 0.57, 0.8276, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.started_pulling_on_handle:\n self.force_traj_pub.publish(self.ft)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L243_C12", "label": "publish()", "type": "expression", "loc": [243, 243], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L242_C8", "vector": [8, 3, 0.5786, 0.0024, 3, 0.42, 0.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.force_traj_pub.publish(self.ft)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L258_C8", "label": "if", "type": "if", "loc": [258, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [4, 2, 0.619, 0.0119, 2, 0.57, 0.8448, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if abs(dist_moved) > 0.09 and self.hooked_location_moved == False:\n # change the force threshold once the hook has started pulling.\n self.hooked_location_moved = True\n self.eq_force_threshold = ut.bound(mag+30.,20.,80.)\n self.ftan_threshold = 1.2 * self.ftan_threshold + 20."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L260_C12", "label": "self.hooked_location_moved =", "type": "assigned_variable", "loc": [260, 260], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L258_C8", "vector": [14, 3, 0.619, 0.0024, 3, 0.04, 0.0, 183, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.hooked_location_moved", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.hooked_location_moved = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L261_C12", "label": "self.eq_force_threshold = bound()", "type": "assigned_variable", "loc": [261, 261], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L258_C8", "vector": [14, 3, 0.6214, 0.0024, 3, 0.04, 0.5, 675, 3, 3, 0, 0, 996, 10, 1], "semantic": {"name": "self.eq_force_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "bound", "annotation": ""}, "snippet": " self.eq_force_threshold = ut.bound(mag+30.,20.,80.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L262_C12", "label": "self.ftan_threshold =", "type": "assigned_variable", "loc": [262, 262], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L258_C8", "vector": [14, 3, 0.6238, 0.0024, 3, 0.04, 1.0, 667, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.ftan_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ftan_threshold = 1.2 * self.ftan_threshold + 20."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L263_C8", "label": "if", "type": "if", "loc": [263, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [4, 2, 0.631, 0.0119, 2, 0.57, 0.8621, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.hooked_location_moved:\n if abs(tangential_vec_ts[2,0]) < 0.2 and ftan > self.ftan_threshold:\n stop = 'ftan threshold exceed: %f'%ftan\n else:\n self.ftan_threshold = max(self.ftan_threshold, ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L264_C12", "label": "if", "type": "if", "loc": [264, 265], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L263_C8", "vector": [4, 3, 0.6298, 0.0048, 3, 0.05, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if abs(tangential_vec_ts[2,0]) < 0.2 and ftan > self.ftan_threshold:\n stop = 'ftan threshold exceed: %f'%ftan"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L265_C16", "label": "stop =", "type": "assigned_variable", "loc": [265, 265], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L264_C12", "vector": [14, 4, 0.631, 0.0024, 4, 0.2, 0.0, 343, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'ftan threshold exceed: %f'%ftan"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L267_C12", "label": "self.ftan_threshold = max()", "type": "assigned_variable", "loc": [267, 267], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L263_C8", "vector": [14, 3, 0.6357, 0.0024, 3, 0.05, 1.0, 667, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "self.ftan_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " self.ftan_threshold = max(self.ftan_threshold, ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L269_C8", "label": "if", "type": "if", "loc": [269, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [4, 2, 0.6476, 0.0167, 2, 0.57, 0.8793, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.hooked_location_moved and ang > math.radians(85.):\n print('Angle:', math.degrees(ang))\n self.open_ang_exceed_count += 1\n if self.open_ang_exceed_count > 2:\n stop = 'opened mechanism through large angle: %.1f'%(math.degrees(ang))\n else:\n self.open_ang_exceed_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L270_C12", "label": "print()", "type": "expression", "loc": [270, 270], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L269_C8", "vector": [8, 3, 0.6429, 0.0024, 3, 0.22, 0.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Angle:', math.degrees(ang))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L272_C12", "label": "if", "type": "if", "loc": [272, 273], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L269_C8", "vector": [4, 3, 0.6488, 0.0048, 3, 0.22, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.open_ang_exceed_count > 2:\n stop = 'opened mechanism through large angle: %.1f'%(math.degrees(ang))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L273_C16", "label": "stop =", "type": "assigned_variable", "loc": [273, 273], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L272_C12", "vector": [14, 4, 0.65, 0.0024, 4, 0.31, 0.0, 343, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'opened mechanism through large angle: %.1f'%(math.degrees(ang))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L275_C12", "label": "self.open_ang_exceed_count =", "type": "assigned_variable", "loc": [275, 275], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L269_C8", "vector": [14, 3, 0.6548, 0.0024, 3, 0.22, 1.0, 172, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.open_ang_exceed_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.open_ang_exceed_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L277_C8", "label": "cep_t =", "type": "assigned_variable", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.6595, 0.0024, 2, 0.57, 0.8966, 772, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cep_t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_t = cep + eq_motion_vec * step_size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L278_C8", "label": "assign", "type": "assigned_variable", "loc": [278, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.6619, 0.0024, 2, 0.57, 0.9138, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[0,0] = cep_t[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L279_C8", "label": "assign", "type": "assigned_variable", "loc": [279, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.6643, 0.0024, 2, 0.57, 0.931, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[1,0] = cep_t[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L280_C8", "label": "assign", "type": "assigned_variable", "loc": [280, 280], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.6667, 0.0024, 2, 0.57, 0.9483, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[2,0] = cep_t[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L282_C8", "label": "print()", "type": "expression", "loc": [282, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [8, 2, 0.6714, 0.0024, 2, 0.57, 0.9655, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('CEP:', cep.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L284_C8", "label": "stop =", "type": "assigned_variable", "loc": [284, 284], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [14, 2, 0.6762, 0.0024, 2, 0.57, 0.9828, 343, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = stop + self.stopping_string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Return_L285_C8", "label": "return", "type": "return", "loc": [285, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "vector": [13, 2, 0.6786, 0.0024, 2, 0.57, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return stop, (cep, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "label": "pull", "type": "function", "loc": [287, 333], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:ClassDef_L46_C0", "vector": [2, 1, 0.7381, 0.1119, 1, 0.42, 0.875, 964, 0, 5, 0, 0, 0, 0, 12], "semantic": {"name": "pull", "arg_names": ["self", "arm", "force_threshold", "cep_vel", "mechanism_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pull(self, arm, force_threshold, cep_vel, mechanism_type=''):\n self.mechanism_type = mechanism_type\n self.stopping_string = ''\n self.eq_pt_not_moving_counter = 0\n\n self.init_log()\n\n self.init_tangent_vector = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L288_C8", "label": "self.mechanism_type =", "type": "assigned_variable", "loc": [288, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [14, 2, 0.6857, 0.0024, 2, 0.43, 0.0, 701, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.mechanism_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mechanism_type = mechanism_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L289_C8", "label": "self.stopping_string =", "type": "assigned_variable", "loc": [289, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [14, 2, 0.6881, 0.0024, 2, 0.43, 0.0385, 265, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.stopping_string", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.stopping_string = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L290_C8", "label": "self.eq_pt_not_moving_counter =", "type": "assigned_variable", "loc": [290, 290], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [14, 2, 0.6905, 0.0024, 2, 0.43, 0.0769, 123, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.eq_pt_not_moving_counter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.eq_pt_not_moving_counter = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L292_C8", "label": "init_log()", "type": "expression", "loc": [292, 292], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [8, 2, 0.6952, 0.0024, 2, 0.43, 0.1154, 377, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init_log", "arg_names": [], "import_names": [], "rhs_call_name": "init_log", "annotation": ""}, "snippet": " self.init_log()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L294_C8", "label": "self.init_tangent_vector =", "type": "assigned_variable", "loc": [294, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [14, 2, 0.7, 0.0024, 2, 0.43, 0.1538, 965, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.init_tangent_vector", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.init_tangent_vector = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L295_C8", "label": "self.open_ang_exceed_count =", "type": "assigned_variable", "loc": [295, 295], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [14, 2, 0.7024, 0.0024, 2, 0.43, 0.1923, 172, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.open_ang_exceed_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.open_ang_exceed_count = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L297_C8", "label": "self.eq_force_threshold =", "type": "assigned_variable", "loc": [297, 297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [14, 2, 0.7071, 0.0024, 2, 0.43, 0.2308, 675, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.eq_force_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.eq_force_threshold = force_threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L298_C8", "label": "self.ftan_threshold =", "type": "assigned_variable", "loc": [298, 298], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [14, 2, 0.7095, 0.0024, 2, 0.43, 0.2692, 667, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.ftan_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ftan_threshold = 2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L299_C8", "label": "self.hooked_location_moved =", "type": "assigned_variable", "loc": [299, 299], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [14, 2, 0.7119, 0.0024, 2, 0.43, 0.3077, 183, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.hooked_location_moved", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.hooked_location_moved = False # flag to indicate when the hooking location started moving."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L300_C8", "label": "self.prev_force_mag = norm()", "type": "assigned_variable", "loc": [300, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [14, 2, 0.7143, 0.0024, 2, 0.43, 0.3462, 497, 3, 1, 0, 0, 902, 10, 2], "semantic": {"name": "self.prev_force_mag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " self.prev_force_mag = np.linalg.norm(self.robot.get_wrist_force(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L301_C8", "label": "self.slip_count =", "type": "assigned_variable", "loc": [301, 301], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [14, 2, 0.7167, 0.0024, 2, 0.43, 0.3846, 338, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.slip_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.slip_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L303_C8", "label": "self.started_pulling_on_handle =", "type": "assigned_variable", "loc": [303, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [14, 2, 0.7214, 0.0024, 2, 0.43, 0.4231, 945, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.started_pulling_on_handle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.started_pulling_on_handle = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L304_C8", "label": "self.started_pulling_on_handle_count =", "type": "assigned_variable", "loc": [304, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [14, 2, 0.7238, 0.0024, 2, 0.43, 0.4615, 870, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.started_pulling_on_handle_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.started_pulling_on_handle_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L306_C8", "label": "ee_pos, _ = get_ee_jtt()", "type": "assigned_variable", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [14, 2, 0.7286, 0.0024, 2, 0.43, 0.5, 323, 3, 1, 0, 0, 15, 10, 1], "semantic": {"name": "ee_pos, _", "arg_names": [], "import_names": [], "rhs_call_name": "get_ee_jtt", "annotation": ""}, "snippet": " ee_pos, _ = self.robot.get_ee_jtt(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L308_C8", "label": "self.cx_start =", "type": "assigned_variable", "loc": [308, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [14, 2, 0.7333, 0.0024, 2, 0.43, 0.5385, 939, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cx_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cx_start = ee_pos[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L309_C8", "label": "self.rad =", "type": "assigned_variable", "loc": [309, 309], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [14, 2, 0.7357, 0.0024, 2, 0.43, 0.5769, 240, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rad = 10.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L310_C8", "label": "self.cy_start =", "type": "assigned_variable", "loc": [310, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [14, 2, 0.7381, 0.0024, 2, 0.43, 0.6154, 418, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cy_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cy_start = ee_pos[1,0]-self.rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L311_C8", "label": "self.cz_start =", "type": "assigned_variable", "loc": [311, 311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [14, 2, 0.7405, 0.0024, 2, 0.43, 0.6538, 113, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cz_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cz_start = ee_pos[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L313_C8", "label": "cep, _ = get_cep_jtt()", "type": "assigned_variable", "loc": [313, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [14, 2, 0.7452, 0.0024, 2, 0.43, 0.6923, 705, 3, 1, 0, 0, 532, 10, 1], "semantic": {"name": "cep, _", "arg_names": [], "import_names": [], "rhs_call_name": "get_cep_jtt", "annotation": ""}, "snippet": " cep, _ = self.robot.get_cep_jtt(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L314_C8", "label": "arg_list =", "type": "assigned_variable", "loc": [314, 314], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [14, 2, 0.7476, 0.0024, 2, 0.43, 0.7308, 873, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arg_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arg_list = [arm, cep, cep_vel]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L315_C8", "label": "result, _ = epc_motion()", "type": "assigned_variable", "loc": [315, 318], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [14, 2, 0.7536, 0.0095, 2, 0.43, 0.7692, 438, 3, 6, 0, 0, 938, 10, 1], "semantic": {"name": "result, _", "arg_names": [], "import_names": [], "rhs_call_name": "epc_motion", "annotation": ""}, "snippet": " result, _ = self.epc_motion(self.cep_gen_control_radial_force,\n 0.1, arm, arg_list, self.log_state,\n #0.01, arm, arg_list,\n control_function = self.robot.set_cep_jtt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L320_C8", "label": "print()", "type": "expression", "loc": [320, 320], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [8, 2, 0.7619, 0.0024, 2, 0.43, 0.8077, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('EPC motion result:', result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L321_C8", "label": "print()", "type": "expression", "loc": [321, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [8, 2, 0.7643, 0.0024, 2, 0.43, 0.8462, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Original force threshold:', force_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L322_C8", "label": "print()", "type": "expression", "loc": [322, 322], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [8, 2, 0.7667, 0.0024, 2, 0.43, 0.8846, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Adapted force threshold:', self.eq_force_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L323_C8", "label": "print()", "type": "expression", "loc": [323, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [8, 2, 0.769, 0.0024, 2, 0.43, 0.9231, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Adapted ftan threshold:', self.ftan_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L325_C8", "label": "d =", "type": "assigned_variable", "loc": [325, 332], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [14, 2, 0.7821, 0.019, 2, 0.43, 0.9615, 355, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = {\n 'f_list': self.f_list, 'ee_list': self.ee_list,\n 'cep_list': self.cep_list, 'ftan_list': self.ft.tangential_force,\n 'config_list': self.ft.configuration, 'frad_list': self.ft.radial_force,\n 'f_list_ati': self.f_list_ati,\n 'f_list_estimate': self.f_list_estimate,\n 'f_list_torques': self.f_list_torques\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L333_C8", "label": "save_pickle()", "type": "expression", "loc": [333, 333], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "vector": [8, 2, 0.7929, 0.0024, 2, 0.43, 1.0, 390, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(d,'pr2_pull_'+ut.formatted_time()+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "label": "search_and_hook", "type": "function", "loc": [335, 379], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:ClassDef_L46_C0", "vector": [2, 1, 0.85, 0.1071, 1, 0.42, 1.0, 913, 0, 7, 1, 0, 0, 0, 14], "semantic": {"name": "search_and_hook", "arg_names": ["self", "arm", "hook_loc", "hooking_force_threshold", "hit_threshold", "hit_motions", "hook_direction"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def search_and_hook(self, arm, hook_loc, hooking_force_threshold = 5.,\n hit_threshold=15., hit_motions = 1,\n hook_direction = 'left'):\n # this needs to be debugged. Hardcoded for now.\n #if arm == 'right_arm' or arm == 0:\n # hook_dir = np.matrix([0., 1., 0.]).T # hook direc in home position\n # offset = -0.03\n #elif arm == 'left_arm' or arm == 1:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L349_C8", "label": "if", "type": "if", "loc": [349, 356], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "vector": [4, 2, 0.8393, 0.019, 2, 0.95, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hook_direction == 'left':\n #offset = np.matrix([0., -0.03, 0.]).T\n offset = np.matrix([0., -0.0, 0.]).T\n move_dir = np.matrix([0., 1., 0.]).T\n elif hook_direction == 'up':\n #offset = np.matrix([0., 0., -0.03]).T\n offset = np.matrix([0., 0., -0.0]).T\n move_dir = np.matrix([0., 0., 1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L351_C12", "label": "offset =", "type": "assigned_variable", "loc": [351, 351], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L349_C8", "vector": [14, 3, 0.8357, 0.0024, 3, 0.4, 0.0, 132, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " offset = np.matrix([0., -0.0, 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L352_C12", "label": "move_dir =", "type": "assigned_variable", "loc": [352, 352], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L349_C8", "vector": [14, 3, 0.8381, 0.0024, 3, 0.4, 0.5, 21, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "move_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_dir = np.matrix([0., 1., 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L353_C8", "label": "if", "type": "if", "loc": [353, 356], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L349_C8", "vector": [4, 3, 0.844, 0.0095, 3, 0.4, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif hook_direction == 'up':\n #offset = np.matrix([0., 0., -0.03]).T\n offset = np.matrix([0., 0., -0.0]).T\n move_dir = np.matrix([0., 0., 1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L355_C12", "label": "offset =", "type": "assigned_variable", "loc": [355, 355], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L353_C8", "vector": [14, 4, 0.8452, 0.0024, 4, 0.62, 0.0, 132, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " offset = np.matrix([0., 0., -0.0]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L356_C12", "label": "move_dir =", "type": "assigned_variable", "loc": [356, 356], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L353_C8", "vector": [14, 4, 0.8476, 0.0024, 4, 0.62, 1.0, 21, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "move_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_dir = np.matrix([0., 0., 1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L357_C8", "label": "start_loc =", "type": "assigned_variable", "loc": [357, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "vector": [14, 2, 0.85, 0.0024, 2, 0.95, 0.0714, 912, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_loc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_loc = hook_loc + offset"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L360_C8", "label": "normal_tl =", "type": "assigned_variable", "loc": [360, 360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "vector": [14, 2, 0.8571, 0.0024, 2, 0.95, 0.1429, 601, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "normal_tl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " normal_tl = np.matrix([1.0, 0., 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L362_C8", "label": "pt1 =", "type": "assigned_variable", "loc": [362, 362], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "vector": [14, 2, 0.8619, 0.0024, 2, 0.95, 0.2143, 211, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt1 = start_loc - normal_tl * 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L363_C8", "label": "go_cep_jtt()", "type": "expression", "loc": [363, 363], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "vector": [8, 2, 0.8643, 0.0024, 2, 0.95, 0.2857, 219, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "go_cep_jtt", "arg_names": [], "import_names": [], "rhs_call_name": "go_cep_jtt", "annotation": ""}, "snippet": " self.robot.go_cep_jtt(arm, pt1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L367_C8", "label": "vec =", "type": "assigned_variable", "loc": [367, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "vector": [14, 2, 0.8738, 0.0024, 2, 0.95, 0.3571, 132, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vec = normal_tl * 0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L368_C8", "label": "sleep()", "type": "expression", "loc": [368, 368], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "vector": [8, 2, 0.8762, 0.0024, 2, 0.95, 0.4286, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:For_L369_C8", "label": "for i", "type": "for", "loc": [369, 370], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "vector": [6, 2, 0.8798, 0.0048, 2, 0.95, 0.5, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(hit_motions):\n s = self.move_till_hit(arm, vec=vec, force_threshold=hit_threshold, speed=0.07)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L370_C12", "label": "s = move_till_hit()", "type": "assigned_variable", "loc": [370, 370], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:For_L369_C8", "vector": [14, 3, 0.881, 0.0024, 3, 0.3, 0.0, 553, 3, 4, 0, 0, 163, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "move_till_hit", "annotation": ""}, "snippet": " s = self.move_till_hit(arm, vec=vec, force_threshold=hit_threshold, speed=0.07)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L372_C8", "label": "cep_start, _ = get_cep_jtt()", "type": "assigned_variable", "loc": [372, 372], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "vector": [14, 2, 0.8857, 0.0024, 2, 0.95, 0.5714, 342, 3, 1, 0, 0, 532, 10, 1], "semantic": {"name": "cep_start, _", "arg_names": [], "import_names": [], "rhs_call_name": "get_cep_jtt", "annotation": ""}, "snippet": " cep_start, _ = self.robot.get_cep_jtt(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L373_C8", "label": "cep = copy()", "type": "assigned_variable", "loc": [373, 373], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "vector": [14, 2, 0.8881, 0.0024, 2, 0.95, 0.6429, 487, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "cep", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " cep = copy.copy(cep_start)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L374_C8", "label": "arg_list =", "type": "assigned_variable", "loc": [374, 374], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "vector": [14, 2, 0.8905, 0.0024, 2, 0.95, 0.7143, 873, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arg_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arg_list = [arm, move_dir, hooking_force_threshold, cep, cep_start]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L375_C8", "label": "print()", "type": "expression", "loc": [375, 375], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "vector": [8, 2, 0.8929, 0.0024, 2, 0.95, 0.7857, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Hi there.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L376_C8", "label": "s = epc_motion()", "type": "assigned_variable", "loc": [376, 377], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "vector": [14, 2, 0.8964, 0.0048, 2, 0.95, 0.8571, 553, 3, 5, 0, 0, 938, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "epc_motion", "annotation": ""}, "snippet": " s = self.epc_motion(self.cep_gen_surface_follow, 0.1, arm,\n arg_list, control_function = self.robot.set_cep_jtt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L378_C8", "label": "print()", "type": "expression", "loc": [378, 378], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "vector": [8, 2, 0.9, 0.0024, 2, 0.95, 0.9286, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('result:', s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Return_L379_C8", "label": "return", "type": "return", "loc": [379, 379], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "vector": [13, 2, 0.9024, 0.0024, 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 s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "label": "if", "type": "if", "loc": [382, 413], "level": 0, "parent": null, "vector": [4, 0, 0.9464, 0.0762, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 17], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import pr2_arms.pr2_arms as pa\n rospy.init_node('epc_pr2', anonymous = True)\n rospy.logout('epc_pr2: ready')\n\n pr2_arms = pa.PR2Arms(primary_ft_sensor='ati')\n #pr2_arms = pa.PR2Arms(primary_ft_sensor='estimate')\n door_epc = Door_EPC(pr2_arms)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Import_L383_C4", "label": "pr2_arms.pr2_arms import pa", "type": "import", "loc": [383, 383], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "vector": [1, 1, 0.9119, 0.0024, 1, 0.29, 0.0, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "pr2_arms.pr2_arms", "arg_names": [], "import_names": ["pa"], "rhs_call_name": "", "annotation": ""}, "snippet": " import pr2_arms.pr2_arms as pa"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L384_C4", "label": "init_node()", "type": "expression", "loc": [384, 384], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "vector": [8, 1, 0.9143, 0.0024, 1, 0.29, 0.0526, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('epc_pr2', anonymous = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L385_C4", "label": "logout()", "type": "expression", "loc": [385, 385], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "vector": [8, 1, 0.9167, 0.0024, 1, 0.29, 0.1053, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('epc_pr2: ready')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L387_C4", "label": "pr2_arms = PR2Arms()", "type": "assigned_variable", "loc": [387, 387], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "vector": [14, 1, 0.9214, 0.0024, 1, 0.29, 0.1579, 369, 3, 1, 0, 0, 694, 10, 1], "semantic": {"name": "pr2_arms", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Arms", "annotation": ""}, "snippet": " pr2_arms = pa.PR2Arms(primary_ft_sensor='ati')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L389_C4", "label": "door_epc = Door_EPC()", "type": "assigned_variable", "loc": [389, 389], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "vector": [14, 1, 0.9262, 0.0024, 1, 0.29, 0.2105, 350, 3, 1, 0, 0, 468, 10, 1], "semantic": {"name": "door_epc", "arg_names": [], "import_names": [], "rhs_call_name": "Door_EPC", "annotation": ""}, "snippet": " door_epc = Door_EPC(pr2_arms)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L391_C4", "label": "r_arm, l_arm =", "type": "assigned_variable", "loc": [391, 391], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "vector": [14, 1, 0.931, 0.0024, 1, 0.29, 0.2632, 451, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "r_arm, l_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_arm, l_arm = 0, 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L392_C4", "label": "arm =", "type": "assigned_variable", "loc": [392, 392], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "vector": [14, 1, 0.9333, 0.0024, 1, 0.29, 0.3158, 413, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = r_arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L394_C4", "label": "tip =", "type": "assigned_variable", "loc": [394, 394], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "vector": [14, 1, 0.9381, 0.0024, 1, 0.29, 0.3684, 726, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tip = np.matrix([0.32, 0., 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L395_C4", "label": "set_tooltip()", "type": "expression", "loc": [395, 395], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "vector": [8, 1, 0.9405, 0.0024, 1, 0.29, 0.4211, 350, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_tooltip", "arg_names": [], "import_names": [], "rhs_call_name": "set_tooltip", "annotation": ""}, "snippet": " pr2_arms.arms.set_tooltip(arm, tip)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L397_C4", "label": "print()", "type": "expression", "loc": [397, 397], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "vector": [8, 1, 0.9452, 0.0024, 1, 0.29, 0.4737, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Put the hook within the PR2 gripper')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L398_C4", "label": "raw_input()", "type": "expression", "loc": [398, 398], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "vector": [8, 1, 0.9476, 0.0024, 1, 0.29, 0.5263, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Hit ENTER to close')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L399_C4", "label": "close_gripper()", "type": "expression", "loc": [399, 399], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "vector": [8, 1, 0.95, 0.0024, 1, 0.29, 0.5789, 807, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "close_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "close_gripper", "annotation": ""}, "snippet": " pr2_arms.close_gripper(arm, effort=30)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L401_C4", "label": "raw_input()", "type": "expression", "loc": [401, 401], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "vector": [8, 1, 0.9548, 0.0024, 1, 0.29, 0.6316, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Turn off the motors and position the arm so that the hook is in an appropriate orientation')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L406_C4", "label": "p1 =", "type": "assigned_variable", "loc": [406, 406], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "vector": [14, 1, 0.9667, 0.0024, 1, 0.29, 0.6842, 87, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p1 = np.matrix([0.85, -0.4, 0.1]).T # pos 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L408_C4", "label": "go_cep_jtt()", "type": "expression", "loc": [408, 408], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "vector": [8, 1, 0.9714, 0.0024, 1, 0.29, 0.7368, 219, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "go_cep_jtt", "arg_names": [], "import_names": [], "rhs_call_name": "go_cep_jtt", "annotation": ""}, "snippet": " pr2_arms.go_cep_jtt(arm, p1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L409_C4", "label": "print()", "type": "expression", "loc": [409, 409], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "vector": [8, 1, 0.9738, 0.0024, 1, 0.29, 0.7895, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Move the base so that hook is close to the handle')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L410_C4", "label": "raw_input()", "type": "expression", "loc": [410, 410], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "vector": [8, 1, 0.9762, 0.0024, 1, 0.29, 0.8421, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Hit ENTER to start Door Opening')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L411_C4", "label": "close_gripper()", "type": "expression", "loc": [411, 411], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "vector": [8, 1, 0.9786, 0.0024, 1, 0.29, 0.8947, 807, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "close_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "close_gripper", "annotation": ""}, "snippet": " pr2_arms.close_gripper(arm, effort=80)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L412_C4", "label": "search_and_hook()", "type": "expression", "loc": [412, 412], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "vector": [8, 1, 0.981, 0.0024, 1, 0.29, 0.9474, 913, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "search_and_hook", "arg_names": [], "import_names": [], "rhs_call_name": "search_and_hook", "annotation": ""}, "snippet": " door_epc.search_and_hook(arm, p1, hook_direction='left')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L413_C4", "label": "pull()", "type": "expression", "loc": [413, 413], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "vector": [8, 1, 0.9833, 0.0024, 1, 0.29, 1.0, 964, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "pull", "arg_names": [], "import_names": [], "rhs_call_name": "pull", "annotation": ""}, "snippet": " door_epc.pull(arm, force_threshold=40., cep_vel=0.05)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99740:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L69_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L70_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L69_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L95_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L98_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L95_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L99_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L95_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L100_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L102_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L103_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Return_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L120_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L120_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L121_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L127_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L128_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Return_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L149_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L150_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L159_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L160_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L159_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L162_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L165_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L166_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L180_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L181_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L180_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L183_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L185_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L186_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L185_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L187_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L189_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L190_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L200_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L201_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L201_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L202_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L200_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L204_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L204_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L205_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L211_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L212_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L211_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L214_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L224_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L227_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L228_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L236_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L237_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L236_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L239_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L236_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L240_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L242_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L243_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L258_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L260_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L258_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L261_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L258_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L262_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L263_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L264_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L264_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L265_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L263_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L267_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L269_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L270_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L269_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L272_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L272_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L273_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L269_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L275_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L280_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L284_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Return_L285_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L288_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L289_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L290_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L292_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L294_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L295_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L297_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L298_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L299_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L300_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L301_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L303_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L304_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L308_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L310_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L311_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L314_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L320_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L322_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L323_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L325_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L333_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L349_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L349_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L351_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L349_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L352_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L349_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L353_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L353_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L355_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L353_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L356_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L357_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L360_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L362_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L363_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L367_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L368_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:For_L369_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:For_L369_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L370_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L373_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L374_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L375_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L376_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L378_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:FunctionDef_L335_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Return_L379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Import_L383_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L384_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L385_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L387_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L389_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L391_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L392_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L394_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L395_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L397_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L398_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L399_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L401_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Assign_L406_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L408_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L409_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L410_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L411_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L412_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99740:If_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99740:Expr_L413_C4"}]
#!/usr/bin/python # # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Author: Advait Jain import numpy as np, math import copy from threading import RLock import roslib; roslib.load_manifest('hrl_pr2_door_opening') import rospy from hrl_msgs.msg import FloatArray from geometry_msgs.msg import Twist def ft_cb(data): lock.acquire() ft_val[0] = data.linear.x ft_val[1] = data.linear.y ft_val[2] = data.linear.z ft_val[3] = data.angular.x ft_val[4] = data.angular.y ft_val[5] = data.angular.z lock.release() if __name__ == '__main__': import sys rospy.init_node('ati_ft_emulator') print sys.argv # 4 for roslaunch if len(sys.argv) != 2 and len(sys.argv) != 4: rospy.logerr('Need to pass the topic name on the command line. Exiting...') sys.exit() topic = sys.argv[1] lock = RLock() ft_val = [0.] * 6 pub = rospy.Subscriber('/r_cart/state/wrench', Twist, ft_cb) pub = rospy.Publisher(topic, FloatArray) rospy.loginfo('Started the ATI FT emulator.') rt = rospy.Rate(100) while not rospy.is_shutdown(): lock.acquire() send_ft_val = copy.copy(ft_val) lock.release() fa = FloatArray(rospy.Header(stamp=rospy.Time.now()), send_ft_val) pub.publish(fa) rt.sleep()
ajibawa-2023/Python-Code-Large/train/row_99741
38
79
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Import_L31_C0", "label": "numpy import np, math", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.3924, 0.0127, 0, 0.66, 0.0, 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_99741:Import_L32_C0", "label": "copy import copy", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.4051, 0.0127, 0, 0.66, 0.1111, 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_99741:ImportFrom_L33_C0", "label": "from threading import RLock", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.4177, 0.0127, 0, 0.66, 0.2222, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["RLock"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import RLock"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Import_L35_C0", "label": "roslib import roslib", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.443, 0.0127, 0, 0.66, 0.3333, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_door_opening')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L35_C15", "label": "load_manifest()", "type": "expression", "loc": [35, 35], "level": 0, "parent": null, "vector": [8, 0, 0.443, 0.0127, 0, 0.66, 0.4444, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_door_opening')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Import_L36_C0", "label": "rospy import rospy", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.4557, 0.0127, 0, 0.66, 0.5556, 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_99741:ImportFrom_L38_C0", "label": "from hrl_msgs.msg import FloatArray", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.481, 0.0127, 0, 0.66, 0.6667, 513, 0, 1, 0, 0, 513, 0, 0], "semantic": {"name": "hrl_msgs.msg", "arg_names": [], "import_names": ["FloatArray"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_msgs.msg import FloatArray"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:ImportFrom_L39_C0", "label": "from geometry_msgs.msg import Twist", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.4937, 0.0127, 0, 0.66, 0.7778, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Twist"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Twist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:FunctionDef_L41_C0", "label": "ft_cb", "type": "function", "loc": [41, 49], "level": 0, "parent": null, "vector": [2, 0, 0.5696, 0.1139, 0, 0.66, 0.8889, 156, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "ft_cb", "arg_names": ["data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ft_cb(data):\n lock.acquire()\n ft_val[0] = data.linear.x\n ft_val[1] = data.linear.y\n ft_val[2] = data.linear.z\n ft_val[3] = data.angular.x\n ft_val[4] = data.angular.y\n ft_val[5] = data.angular.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L42_C4", "label": "acquire()", "type": "expression", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:FunctionDef_L41_C0", "vector": [8, 1, 0.5316, 0.0127, 1, 0.81, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L43_C4", "label": "assign", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:FunctionDef_L41_C0", "vector": [14, 1, 0.5443, 0.0127, 1, 0.81, 0.1429, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_val[0] = data.linear.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L44_C4", "label": "assign", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:FunctionDef_L41_C0", "vector": [14, 1, 0.557, 0.0127, 1, 0.81, 0.2857, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_val[1] = data.linear.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L45_C4", "label": "assign", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:FunctionDef_L41_C0", "vector": [14, 1, 0.5696, 0.0127, 1, 0.81, 0.4286, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_val[2] = data.linear.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L46_C4", "label": "assign", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:FunctionDef_L41_C0", "vector": [14, 1, 0.5823, 0.0127, 1, 0.81, 0.5714, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_val[3] = data.angular.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L47_C4", "label": "assign", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:FunctionDef_L41_C0", "vector": [14, 1, 0.5949, 0.0127, 1, 0.81, 0.7143, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_val[4] = data.angular.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L48_C4", "label": "assign", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:FunctionDef_L41_C0", "vector": [14, 1, 0.6076, 0.0127, 1, 0.81, 0.8571, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_val[5] = data.angular.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L49_C4", "label": "release()", "type": "expression", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:FunctionDef_L41_C0", "vector": [8, 1, 0.6203, 0.0127, 1, 0.81, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "label": "if", "type": "if", "loc": [51, 77], "level": 0, "parent": null, "vector": [4, 0, 0.8101, 0.3418, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 20], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import sys\n\n rospy.init_node('ati_ft_emulator')\n\n print(sys.argv)\n\n # 4 for roslaunch"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Import_L52_C4", "label": "sys import sys", "type": "import", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "vector": [1, 1, 0.6582, 0.0127, 1, 0.99, 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_99741:Expr_L54_C4", "label": "init_node()", "type": "expression", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "vector": [8, 1, 0.6835, 0.0127, 1, 0.99, 0.0909, 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('ati_ft_emulator')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L56_C4", "label": "print()", "type": "expression", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "vector": [8, 1, 0.7089, 0.0127, 1, 0.99, 0.1818, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(sys.argv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L59_C4", "label": "if", "type": "if", "loc": [59, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "vector": [4, 1, 0.7595, 0.038, 1, 0.99, 0.2727, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(sys.argv) != 2 and len(sys.argv) != 4:\n rospy.logerr('Need to pass the topic name on the command line. Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L60_C8", "label": "logerr()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L59_C4", "vector": [8, 2, 0.7595, 0.0127, 2, 0.59, 0.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Need to pass the topic name on the command line. Exiting...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L61_C8", "label": "exit()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L59_C4", "vector": [8, 2, 0.7722, 0.0127, 2, 0.59, 1.0, 436, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L63_C4", "label": "topic =", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "vector": [14, 1, 0.7975, 0.0127, 1, 0.99, 0.3636, 225, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " topic = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L65_C4", "label": "lock = RLock()", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "vector": [14, 1, 0.8228, 0.0127, 1, 0.99, 0.4545, 104, 3, 0, 0, 0, 207, 10, 1], "semantic": {"name": "lock", "arg_names": [], "import_names": [], "rhs_call_name": "RLock", "annotation": ""}, "snippet": " lock = RLock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L66_C4", "label": "ft_val =", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "vector": [14, 1, 0.8354, 0.0127, 1, 0.99, 0.5455, 62, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ft_val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_val = [0.] * 6"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L67_C4", "label": "pub = Subscriber()", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "vector": [14, 1, 0.8481, 0.0127, 1, 0.99, 0.6364, 41, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " pub = rospy.Subscriber('/r_cart/state/wrench', Twist, ft_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L68_C4", "label": "pub = Publisher()", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "vector": [14, 1, 0.8608, 0.0127, 1, 0.99, 0.7273, 41, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " pub = rospy.Publisher(topic, FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L69_C4", "label": "loginfo()", "type": "expression", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "vector": [8, 1, 0.8734, 0.0127, 1, 0.99, 0.8182, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Started the ATI FT emulator.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L70_C4", "label": "rt = Rate()", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "vector": [14, 1, 0.8861, 0.0127, 1, 0.99, 0.9091, 991, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "rt", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " rt = rospy.Rate(100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:While_L71_C4", "label": "while", "type": "while", "loc": [71, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "vector": [5, 1, 0.9367, 0.0886, 1, 0.99, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n lock.acquire()\n send_ft_val = copy.copy(ft_val)\n lock.release()\n fa = FloatArray(rospy.Header(stamp=rospy.Time.now()), send_ft_val)\n pub.publish(fa)\n rt.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L72_C8", "label": "acquire()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:While_L71_C4", "vector": [8, 2, 0.9114, 0.0127, 2, 0.23, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L73_C8", "label": "send_ft_val = copy()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:While_L71_C4", "vector": [14, 2, 0.9241, 0.0127, 2, 0.23, 0.2, 47, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "send_ft_val", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " send_ft_val = copy.copy(ft_val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L74_C8", "label": "release()", "type": "expression", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:While_L71_C4", "vector": [8, 2, 0.9367, 0.0127, 2, 0.23, 0.4, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L75_C8", "label": "fa = FloatArray()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:While_L71_C4", "vector": [14, 2, 0.9494, 0.0127, 2, 0.23, 0.6, 730, 3, 2, 0, 0, 755, 10, 3], "semantic": {"name": "fa", "arg_names": [], "import_names": [], "rhs_call_name": "FloatArray", "annotation": ""}, "snippet": " fa = FloatArray(rospy.Header(stamp=rospy.Time.now()), send_ft_val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L76_C8", "label": "publish()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:While_L71_C4", "vector": [8, 2, 0.962, 0.0127, 2, 0.23, 0.8, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " pub.publish(fa)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L77_C8", "label": "sleep()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99741:While_L71_C4", "vector": [8, 2, 0.9747, 0.0127, 2, 0.23, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rt.sleep()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99741:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Import_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:If_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:While_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:While_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:While_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:While_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:While_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:While_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99741:While_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99741:Expr_L77_C8"}]
# # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Author: Advait Jain import math, numpy as np import m3.rt_proxy as m3p import m3.component_factory as m3f import m3.toolbox as m3t import m3.arm THETA_GC = 5 THETA = 3 def safeop_things(proxy): robot_name = 'm3humanoid_bimanual_mr1' chain_names = ['m3arm_ma1', 'm3arm_ma2'] dynamatics_nms = ['m3dynamatics_ma1', 'm3dynamatics_ma2'] proxy.make_safe_operational(robot_name) for c in chain_names: proxy.make_safe_operational(c) for d in dynamatics_nms: proxy.make_safe_operational(d) proxy = m3p.M3RtProxy() proxy.start() pwr_nm = 'm3pwr_pwr003' pwr = m3f.create_component(pwr_nm) proxy.publish_command(pwr) joint_names = ['m3joint_ma1_j0', 'm3joint_ma1_j1', 'm3joint_ma1_j2', 'm3joint_ma1_j3', 'm3joint_ma1_j4', 'm3joint_ma1_j5', 'm3joint_ma1_j6'] comp_list = [] stiff_list = [0.2, 0.67, 1., 0.7, 0.75, 0.5, 0.5] for i, c in enumerate(joint_names): comp = m3f.create_component(c) comp_list.append(comp) proxy.publish_command(comp) if i < 5: comp.set_control_mode(THETA_GC) else: comp.set_control_mode(THETA) comp.set_stiffness(stiff_list[i]) comp.set_slew_rate_proportion(1.) # safeop_things must be after make_operational_all. proxy.make_operational_all() safeop_things(proxy) #ma1 = m3.arm.M3Arm('m3arm_ma1') #proxy.subscribe_status(ma1) proxy.step() proxy.step() raw_input('Hit ENTER to power on') pwr.set_motor_power_on() proxy.step() proxy.step() raw_input('Hit ENTER to move the joint') q = [0., 0., 0., 90., 0., 0., 0.] q = np.radians(q) for i, c in enumerate(comp_list): c.set_theta_rad(q[i]) proxy.step() proxy.step() raw_input('Hit ENTER to stop') proxy.stop() #-------------- older code --------------- ##Force safe-op of robot, etc are present #types=['m3humanoid','m3hand','m3gripper'] #for t in types: # cc = proxy.get_available_components(t) # for ccc in cc: # print 'ccc:', ccc # proxy.make_safe_operational(ccc) # # ##Force safe-op of chain so that gravity terms are computed #chain=None #if len(joint_names)>0: # for j in joint_names: # chain_name=m3t.get_joint_chain_name(j) # print 'chain_name:', chain_name # if chain_name!="": # proxy.make_safe_operational(chain_name) # # #Force safe-op of chain so that gravity terms are computed # dynamatics_name = m3t.get_chain_dynamatics_component_name(chain_name) # print 'dynamatics_name:', dynamatics_name # if dynamatics_name != "": # proxy.make_safe_operational(dynamatics_name) # # # ##Force safe-op of robot so that gravity terms are computed #robot_name = m3t.get_robot_name() #print 'robot_name:', robot_name #if robot_name != "": # proxy.make_safe_operational(robot_name)
ajibawa-2023/Python-Code-Large/train/row_99742
50
147
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Import_L31_C0", "label": "math import math, np", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.2109, 0.0068, 0, 0.66, 0.0, 526, 0, 2, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math", "np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math, numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Import_L32_C0", "label": "m3.rt_proxy import m3p", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.2177, 0.0068, 0, 0.66, 0.0312, 826, 0, 1, 0, 0, 826, 0, 0], "semantic": {"name": "m3.rt_proxy", "arg_names": [], "import_names": ["m3p"], "rhs_call_name": "", "annotation": ""}, "snippet": "import m3.rt_proxy as m3p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Import_L33_C0", "label": "m3.component_factory import m3f", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.2245, 0.0068, 0, 0.66, 0.0625, 932, 0, 1, 0, 0, 932, 0, 0], "semantic": {"name": "m3.component_factory", "arg_names": [], "import_names": ["m3f"], "rhs_call_name": "", "annotation": ""}, "snippet": "import m3.component_factory as m3f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Import_L34_C0", "label": "m3.toolbox import m3t", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.2313, 0.0068, 0, 0.66, 0.0938, 478, 0, 1, 0, 0, 478, 0, 0], "semantic": {"name": "m3.toolbox", "arg_names": [], "import_names": ["m3t"], "rhs_call_name": "", "annotation": ""}, "snippet": "import m3.toolbox as m3t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Import_L35_C0", "label": "m3.arm import m3.arm", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.2381, 0.0068, 0, 0.66, 0.125, 234, 0, 1, 0, 0, 234, 0, 0], "semantic": {"name": "m3.arm", "arg_names": [], "import_names": ["m3.arm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import m3.arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Assign_L37_C0", "label": "THETA_GC =", "type": "assigned_variable", "loc": [37, 37], "level": 0, "parent": null, "vector": [14, 0, 0.2517, 0.0068, 0, 0.66, 0.1562, 109, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "THETA_GC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THETA_GC = 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Assign_L38_C0", "label": "THETA =", "type": "assigned_variable", "loc": [38, 38], "level": 0, "parent": null, "vector": [14, 0, 0.2585, 0.0068, 0, 0.66, 0.1875, 47, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "THETA", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THETA = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:FunctionDef_L40_C0", "label": "safeop_things", "type": "function", "loc": [40, 49], "level": 0, "parent": null, "vector": [2, 0, 0.3027, 0.068, 0, 0.66, 0.2188, 898, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "safeop_things", "arg_names": ["proxy"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def safeop_things(proxy):\n robot_name = 'm3humanoid_bimanual_mr1'\n chain_names = ['m3arm_ma1', 'm3arm_ma2']\n dynamatics_nms = ['m3dynamatics_ma1', 'm3dynamatics_ma2']\n\n proxy.make_safe_operational(robot_name)\n for c in chain_names:\n proxy.make_safe_operational(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Assign_L41_C4", "label": "robot_name =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99742:FunctionDef_L40_C0", "vector": [14, 1, 0.2789, 0.0068, 1, 0.55, 0.0, 868, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "robot_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " robot_name = 'm3humanoid_bimanual_mr1'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Assign_L42_C4", "label": "chain_names =", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99742:FunctionDef_L40_C0", "vector": [14, 1, 0.2857, 0.0068, 1, 0.55, 0.2, 304, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "chain_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " chain_names = ['m3arm_ma1', 'm3arm_ma2']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Assign_L43_C4", "label": "dynamatics_nms =", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99742:FunctionDef_L40_C0", "vector": [14, 1, 0.2925, 0.0068, 1, 0.55, 0.4, 860, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "dynamatics_nms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dynamatics_nms = ['m3dynamatics_ma1', 'm3dynamatics_ma2']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L45_C4", "label": "make_safe_operational()", "type": "expression", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99742:FunctionDef_L40_C0", "vector": [8, 1, 0.3061, 0.0068, 1, 0.55, 0.6, 545, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "make_safe_operational", "arg_names": [], "import_names": [], "rhs_call_name": "make_safe_operational", "annotation": ""}, "snippet": " proxy.make_safe_operational(robot_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L46_C4", "label": "for c", "type": "for", "loc": [46, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99742:FunctionDef_L40_C0", "vector": [6, 1, 0.3163, 0.0136, 1, 0.55, 0.8, 411, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c in chain_names:\n proxy.make_safe_operational(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L47_C8", "label": "make_safe_operational()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L46_C4", "vector": [8, 2, 0.3197, 0.0068, 2, 0.16, 0.0, 545, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "make_safe_operational", "arg_names": [], "import_names": [], "rhs_call_name": "make_safe_operational", "annotation": ""}, "snippet": " proxy.make_safe_operational(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L48_C4", "label": "for d", "type": "for", "loc": [48, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99742:FunctionDef_L40_C0", "vector": [6, 1, 0.3299, 0.0136, 1, 0.55, 1.0, 355, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for d in dynamatics_nms:\n proxy.make_safe_operational(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L49_C8", "label": "make_safe_operational()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L48_C4", "vector": [8, 2, 0.3333, 0.0068, 2, 0.2, 0.0, 545, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "make_safe_operational", "arg_names": [], "import_names": [], "rhs_call_name": "make_safe_operational", "annotation": ""}, "snippet": " proxy.make_safe_operational(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Assign_L52_C0", "label": "proxy = M3RtProxy()", "type": "assigned_variable", "loc": [52, 52], "level": 0, "parent": null, "vector": [14, 0, 0.3537, 0.0068, 0, 0.66, 0.25, 916, 3, 0, 0, 0, 238, 10, 1], "semantic": {"name": "proxy", "arg_names": [], "import_names": [], "rhs_call_name": "M3RtProxy", "annotation": ""}, "snippet": "proxy = m3p.M3RtProxy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L53_C0", "label": "start()", "type": "expression", "loc": [53, 53], "level": 0, "parent": null, "vector": [8, 0, 0.3605, 0.0068, 0, 0.66, 0.2812, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": "proxy.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Assign_L55_C0", "label": "pwr_nm =", "type": "assigned_variable", "loc": [55, 55], "level": 0, "parent": null, "vector": [14, 0, 0.3741, 0.0068, 0, 0.66, 0.3125, 953, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "pwr_nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "pwr_nm = 'm3pwr_pwr003'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Assign_L56_C0", "label": "pwr = create_component()", "type": "assigned_variable", "loc": [56, 56], "level": 0, "parent": null, "vector": [14, 0, 0.381, 0.0068, 0, 0.66, 0.3438, 264, 3, 1, 0, 0, 585, 10, 1], "semantic": {"name": "pwr", "arg_names": [], "import_names": [], "rhs_call_name": "create_component", "annotation": ""}, "snippet": "pwr = m3f.create_component(pwr_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L57_C0", "label": "publish_command()", "type": "expression", "loc": [57, 57], "level": 0, "parent": null, "vector": [8, 0, 0.3878, 0.0068, 0, 0.66, 0.375, 611, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish_command", "arg_names": [], "import_names": [], "rhs_call_name": "publish_command", "annotation": ""}, "snippet": "proxy.publish_command(pwr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Assign_L59_C0", "label": "joint_names =", "type": "assigned_variable", "loc": [59, 59], "level": 0, "parent": null, "vector": [14, 0, 0.4014, 0.0068, 0, 0.66, 0.4062, 393, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "joint_names = ['m3joint_ma1_j0', 'm3joint_ma1_j1', 'm3joint_ma1_j2', 'm3joint_ma1_j3', 'm3joint_ma1_j4', 'm3joint_ma1_j5', 'm3joint_ma1_j6']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Assign_L61_C0", "label": "comp_list =", "type": "assigned_variable", "loc": [61, 61], "level": 0, "parent": null, "vector": [14, 0, 0.415, 0.0068, 0, 0.66, 0.4375, 722, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "comp_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "comp_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Assign_L62_C0", "label": "stiff_list =", "type": "assigned_variable", "loc": [62, 62], "level": 0, "parent": null, "vector": [14, 0, 0.4218, 0.0068, 0, 0.66, 0.4688, 457, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "stiff_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "stiff_list = [0.2, 0.67, 1., 0.7, 0.75, 0.5, 0.5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L63_C0", "label": "for i, c", "type": "for", "loc": [63, 72], "level": 0, "parent": null, "vector": [6, 0, 0.4592, 0.068, 0, 0.66, 0.5, 787, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "i, c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for i, c in enumerate(joint_names):\n comp = m3f.create_component(c)\n comp_list.append(comp)\n proxy.publish_command(comp)\n if i < 5:\n comp.set_control_mode(THETA_GC)\n else:\n comp.set_control_mode(THETA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Assign_L64_C4", "label": "comp = create_component()", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L63_C0", "vector": [14, 1, 0.4354, 0.0068, 1, 0.29, 0.0, 913, 3, 1, 0, 0, 585, 10, 1], "semantic": {"name": "comp", "arg_names": [], "import_names": [], "rhs_call_name": "create_component", "annotation": ""}, "snippet": " comp = m3f.create_component(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L65_C4", "label": "append()", "type": "expression", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L63_C0", "vector": [8, 1, 0.4422, 0.0068, 1, 0.29, 0.2, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " comp_list.append(comp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L66_C4", "label": "publish_command()", "type": "expression", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L63_C0", "vector": [8, 1, 0.449, 0.0068, 1, 0.29, 0.4, 611, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish_command", "arg_names": [], "import_names": [], "rhs_call_name": "publish_command", "annotation": ""}, "snippet": " proxy.publish_command(comp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:If_L67_C4", "label": "if", "type": "if", "loc": [67, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L63_C0", "vector": [4, 1, 0.466, 0.0272, 1, 0.29, 0.6, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i < 5:\n comp.set_control_mode(THETA_GC)\n else:\n comp.set_control_mode(THETA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L68_C8", "label": "set_control_mode()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99742:If_L67_C4", "vector": [8, 2, 0.4626, 0.0068, 2, 0.81, 0.0, 552, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_control_mode", "arg_names": [], "import_names": [], "rhs_call_name": "set_control_mode", "annotation": ""}, "snippet": " comp.set_control_mode(THETA_GC)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L70_C8", "label": "set_control_mode()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99742:If_L67_C4", "vector": [8, 2, 0.4762, 0.0068, 2, 0.81, 1.0, 552, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_control_mode", "arg_names": [], "import_names": [], "rhs_call_name": "set_control_mode", "annotation": ""}, "snippet": " comp.set_control_mode(THETA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L71_C4", "label": "set_stiffness()", "type": "expression", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L63_C0", "vector": [8, 1, 0.483, 0.0068, 1, 0.29, 0.8, 418, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_stiffness", "arg_names": [], "import_names": [], "rhs_call_name": "set_stiffness", "annotation": ""}, "snippet": " comp.set_stiffness(stiff_list[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L72_C4", "label": "set_slew_rate_proportion()", "type": "expression", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L63_C0", "vector": [8, 1, 0.4898, 0.0068, 1, 0.29, 1.0, 645, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_slew_rate_proportion", "arg_names": [], "import_names": [], "rhs_call_name": "set_slew_rate_proportion", "annotation": ""}, "snippet": " comp.set_slew_rate_proportion(1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L75_C0", "label": "make_operational_all()", "type": "expression", "loc": [75, 75], "level": 0, "parent": null, "vector": [8, 0, 0.5102, 0.0068, 0, 0.66, 0.5312, 283, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "make_operational_all", "arg_names": [], "import_names": [], "rhs_call_name": "make_operational_all", "annotation": ""}, "snippet": "proxy.make_operational_all()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L76_C0", "label": "safeop_things()", "type": "expression", "loc": [76, 76], "level": 0, "parent": null, "vector": [8, 0, 0.517, 0.0068, 0, 0.66, 0.5625, 898, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "safeop_things", "arg_names": [], "import_names": [], "rhs_call_name": "safeop_things", "annotation": ""}, "snippet": "safeop_things(proxy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L81_C0", "label": "step()", "type": "expression", "loc": [81, 81], "level": 0, "parent": null, "vector": [8, 0, 0.551, 0.0068, 0, 0.66, 0.5938, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": "proxy.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L82_C0", "label": "step()", "type": "expression", "loc": [82, 82], "level": 0, "parent": null, "vector": [8, 0, 0.5578, 0.0068, 0, 0.66, 0.625, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": "proxy.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L84_C0", "label": "raw_input()", "type": "expression", "loc": [84, 84], "level": 0, "parent": null, "vector": [8, 0, 0.5714, 0.0068, 0, 0.66, 0.6562, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": "raw_input('Hit ENTER to power on')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L85_C0", "label": "set_motor_power_on()", "type": "expression", "loc": [85, 85], "level": 0, "parent": null, "vector": [8, 0, 0.5782, 0.0068, 0, 0.66, 0.6875, 777, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_motor_power_on", "arg_names": [], "import_names": [], "rhs_call_name": "set_motor_power_on", "annotation": ""}, "snippet": "pwr.set_motor_power_on()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L87_C0", "label": "step()", "type": "expression", "loc": [87, 87], "level": 0, "parent": null, "vector": [8, 0, 0.5918, 0.0068, 0, 0.66, 0.7188, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": "proxy.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L88_C0", "label": "step()", "type": "expression", "loc": [88, 88], "level": 0, "parent": null, "vector": [8, 0, 0.5986, 0.0068, 0, 0.66, 0.75, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": "proxy.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L90_C0", "label": "raw_input()", "type": "expression", "loc": [90, 90], "level": 0, "parent": null, "vector": [8, 0, 0.6122, 0.0068, 0, 0.66, 0.7812, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": "raw_input('Hit ENTER to move the joint')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Assign_L91_C0", "label": "q =", "type": "assigned_variable", "loc": [91, 91], "level": 0, "parent": null, "vector": [14, 0, 0.619, 0.0068, 0, 0.66, 0.8125, 516, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "q = [0., 0., 0., 90., 0., 0., 0.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Assign_L92_C0", "label": "q = radians()", "type": "assigned_variable", "loc": [92, 92], "level": 0, "parent": null, "vector": [14, 0, 0.6259, 0.0068, 0, 0.66, 0.8438, 516, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": "q = np.radians(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L94_C0", "label": "for i, c", "type": "for", "loc": [94, 95], "level": 0, "parent": null, "vector": [6, 0, 0.6429, 0.0136, 0, 0.66, 0.875, 787, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i, c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for i, c in enumerate(comp_list):\n c.set_theta_rad(q[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L95_C4", "label": "set_theta_rad()", "type": "expression", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L94_C0", "vector": [8, 1, 0.6463, 0.0068, 1, 0.67, 0.0, 274, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_theta_rad", "arg_names": [], "import_names": [], "rhs_call_name": "set_theta_rad", "annotation": ""}, "snippet": " c.set_theta_rad(q[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L97_C0", "label": "step()", "type": "expression", "loc": [97, 97], "level": 0, "parent": null, "vector": [8, 0, 0.6599, 0.0068, 0, 0.66, 0.9062, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": "proxy.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L98_C0", "label": "step()", "type": "expression", "loc": [98, 98], "level": 0, "parent": null, "vector": [8, 0, 0.6667, 0.0068, 0, 0.66, 0.9375, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": "proxy.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L100_C0", "label": "raw_input()", "type": "expression", "loc": [100, 100], "level": 0, "parent": null, "vector": [8, 0, 0.6803, 0.0068, 0, 0.66, 0.9688, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": "raw_input('Hit ENTER to stop')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L101_C0", "label": "stop()", "type": "expression", "loc": [101, 101], "level": 0, "parent": null, "vector": [8, 0, 0.6871, 0.0068, 0, 0.66, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": "proxy.stop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99742:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99742:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99742:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99742:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99742:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99742:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99742:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99742:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99742:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99742:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99742:If_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99742:If_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99742:If_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99742:For_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99742:Expr_L95_C4"}]
# # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Author: Advait Jain import numpy as np, math import copy import hrl_lib.transforms as tr # dictionary for transforming different coorsinate frames to global coord frame # global is NOT the world or fixed frame, its just a convenient global frame _globalT = { 'torso' : None, 'thok0' : None, 'utm0' : None, 'utmcam0': None, 'mecanum': None } def create_globalTDict(): """ call the create functions for all the coord frames """ createTorsoTransform() createThok0Transform() createUtm0Transform() createMecanumTransform() def createTorsoTransform(): ''' torso frame -> global frame ''' disp = np.matrix([0.,0.,0.]).T rot = np.matrix(np.eye(3)) t = tr.composeHomogeneousTransform(rot,disp) _globalT['torso'] = t def createThok0Transform(): ''' thok0 frame -> global frame ''' disp = np.matrix([0.,0.,0.09]).T rot = np.matrix(np.eye(3)) t = tr.composeHomogeneousTransform(rot,disp) _globalT['thok0'] = t def createUtm0Transform(): ''' utm0 frame -> global frame ''' disp = copy.copy(tr.getDispSubMat(_globalT['thok0'])) disp[2,0] += 0.055 rot = np.matrix(np.eye(3)) t = tr.composeHomogeneousTransform(rot,disp) _globalT['utm0'] = t def createMecanumTransform(): ''' mecanum frame -> global frame (ignores the zenither) ''' disp = np.matrix([-0.28,0.,0.0]).T rot = np.matrix(np.eye(3)) t = tr.composeHomogeneousTransform(rot,disp) _globalT['mecanum'] = t create_globalTDict() def globalTmecanum(p,floating_vector=False): ''' 3x1 vector from mecanum to global. ''' p_hom = tr.xyzToHomogenous(p, floating_vector) p_gl = _globalT['mecanum'] * p_hom if floating_vector == False: return p_gl[0:3]/p_gl[3] else: return p_gl[0:3] def mecanumTglobal(p,floating_vector=False): ''' 3x1 vector from global to mecanum. ''' p_hom = tr.xyzToHomogenous(p, floating_vector) p_gl = tr.invertHomogeneousTransform(_globalT['mecanum']) * p_hom if floating_vector == False: return p_gl[0:3]/p_gl[3] else: return p_gl[0:3] def globalTtorso(p,floating_vector=False): ''' 3x1 vector from torso to global. ''' p_hom = tr.xyzToHomogenous(p, floating_vector) p_gl = _globalT['torso'] * p_hom if floating_vector == False: return p_gl[0:3]/p_gl[3] else: return p_gl[0:3] def torsoTglobal(p,floating_vector=False): ''' 3x1 vector from global to torso. ''' p_hom = tr.xyzToHomogenous(p, floating_vector) p_gl = tr.invertHomogeneousTransform(_globalT['torso']) * p_hom if floating_vector == False: return p_gl[0:3]/p_gl[3] else: return p_gl[0:3] def globalTthok0(p,floating_vector=False): ''' 3x1 vector from thok0 to global. ''' p_hom = tr.xyzToHomogenous(p, floating_vector) p_gl = _globalT['thok0'] * p_hom if floating_vector == False: return p_gl[0:3]/p_gl[3] else: return p_gl[0:3] def thok0Tglobal(p,floating_vector=False): ''' 3x1 vector from global to thok0. ''' p_hom = tr.xyzToHomogenous(p, floating_vector) p_gl = tr.invertHomogeneousTransform(_globalT['thok0']) * p_hom if floating_vector == False: return p_gl[0:3]/p_gl[3] else: return p_gl[0:3] def globalTutm0(p,floating_vector=False): ''' 3x1 vector from utm0 to global. ''' p_hom = tr.xyzToHomogenous(p, floating_vector) p_gl = _globalT['utm0'] * p_hom if floating_vector == False: return p_gl[0:3]/p_gl[3] else: return p_gl[0:3] def utm0Tglobal(p,floating_vector=False): ''' 3x1 vector from global to utm0. ''' p_hom = tr.xyzToHomogenous(p, floating_vector) p_gl = tr.invertHomogeneousTransform(_globalT['utm0']) * p_hom if floating_vector == False: return p_gl[0:3]/p_gl[3] else: return p_gl[0:3] ## transformation matrix to go from global to utmcam0 coord frame. # @param ang - servo angle (in RADIANS) # @return 4x4 transformation matrix. def utmcam0Tglobal_mat(ang): thok0Tglobal_mat = tr.invertHomogeneousTransform(_globalT['thok0']) # servo angle. disp = np.matrix([0.,0.,0.]).T tmat = tr.composeHomogeneousTransform(tr.Ry(ang),disp)*thok0Tglobal_mat # cameraTlaser from thok_cam_calib.py x = 0.012 y = -0.056 z = 0.035 r1 = 0. r2 = 0. r3 = -0.7 disp = np.matrix([-x,-y,-z]).T r = tr.Rz(math.radians(-90))*tr.Ry(math.radians(90.)) disp = r*disp r = r*tr.Rx(math.radians(r1)) r = r*tr.Ry(math.radians(r2)) r = r*tr.Rz(math.radians(r3)) t = tr.composeHomogeneousTransform(r, disp) tmat = t*tmat return tmat ## global to utmcam0 coord frame. # @param p - 3xN np matrix. # @param ang - servo angle (in RADIANS) # @param floating_vector - interpretation of p. False -> position vector. True -> floating vector (rotation only). # @return 3xN np matrix in the new coord frame. def utmcam0Tglobal(p,ang,floating_vector=False): t = utmcam0Tglobal_mat(ang) p_hom = tr.xyzToHomogenous(p, floating_vector) p_c = t * p_hom if floating_vector == False: pt = p_c[0:3]/p_c[3] else: pt = p_c[0:3] return pt ## utmcam0 coord frame to global # @param p - 3xN np matrix. # @param ang - servo angle (in RADIANS) # @param floating_vector - interpretation of p. False -> position vector. True -> floating vector (rotation only). # @return 3xN np matrix in the new coord frame. def globalTutmcam0(p,ang,floating_vector=False): t = utmcam0Tglobal_mat(ang) t = tr.invertHomogeneousTransform(t) p_hom = tr.xyzToHomogenous(p, floating_vector) p_c = t * p_hom if floating_vector == False: pt = p_c[0:3]/p_c[3] else: pt = p_c[0:3] return pt
ajibawa-2023/Python-Code-Large/train/row_99743
127
229
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Import_L31_C0", "label": "numpy import np, math", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.1354, 0.0044, 0, 0.66, 0.0, 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_99743:Import_L32_C0", "label": "copy import copy", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.1397, 0.0044, 0, 0.66, 0.05, 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_99743:Import_L33_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.1441, 0.0044, 0, 0.66, 0.1, 82, 0, 1, 0, 0, 82, 0, 0], "semantic": {"name": "hrl_lib.transforms", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L37_C0", "label": "_globalT =", "type": "assigned_variable", "loc": [37, 43], "level": 0, "parent": null, "vector": [14, 0, 0.1747, 0.0306, 0, 0.66, 0.15, 276, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "_globalT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_globalT = {\n 'torso' : None,\n 'thok0' : None,\n 'utm0' : None,\n 'utmcam0': None,\n 'mecanum': None\n}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L45_C0", "label": "create_globalTDict", "type": "function", "loc": [45, 51], "level": 0, "parent": null, "vector": [2, 0, 0.2096, 0.0306, 0, 0.66, 0.2, 430, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "create_globalTDict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_globalTDict():\n \"\"\" call the create functions for all the coord frames\n \"\"\"\n createTorsoTransform()\n createThok0Transform()\n createUtm0Transform()\n createMecanumTransform()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L46_C4", "label": "expression", "type": "expression", "loc": [46, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L45_C0", "vector": [8, 1, 0.2031, 0.0087, 1, 0.02, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" call the create functions for all the coord frames\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L48_C4", "label": "createTorsoTransform()", "type": "expression", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L45_C0", "vector": [8, 1, 0.2096, 0.0044, 1, 0.02, 0.25, 911, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "createTorsoTransform", "arg_names": [], "import_names": [], "rhs_call_name": "createTorsoTransform", "annotation": ""}, "snippet": " createTorsoTransform()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L49_C4", "label": "createThok0Transform()", "type": "expression", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L45_C0", "vector": [8, 1, 0.214, 0.0044, 1, 0.02, 0.5, 480, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "createThok0Transform", "arg_names": [], "import_names": [], "rhs_call_name": "createThok0Transform", "annotation": ""}, "snippet": " createThok0Transform()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L50_C4", "label": "createUtm0Transform()", "type": "expression", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L45_C0", "vector": [8, 1, 0.2183, 0.0044, 1, 0.02, 0.75, 84, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "createUtm0Transform", "arg_names": [], "import_names": [], "rhs_call_name": "createUtm0Transform", "annotation": ""}, "snippet": " createUtm0Transform()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L51_C4", "label": "createMecanumTransform()", "type": "expression", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L45_C0", "vector": [8, 1, 0.2227, 0.0044, 1, 0.02, 1.0, 361, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "createMecanumTransform", "arg_names": [], "import_names": [], "rhs_call_name": "createMecanumTransform", "annotation": ""}, "snippet": " createMecanumTransform()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L53_C0", "label": "createTorsoTransform", "type": "function", "loc": [53, 59], "level": 0, "parent": null, "vector": [2, 0, 0.2445, 0.0306, 0, 0.66, 0.25, 911, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "createTorsoTransform", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def createTorsoTransform():\n ''' torso frame -> global frame\n '''\n disp = np.matrix([0.,0.,0.]).T\n rot = np.matrix(np.eye(3))\n t = tr.composeHomogeneousTransform(rot,disp)\n _globalT['torso'] = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L54_C4", "label": "expression", "type": "expression", "loc": [54, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L53_C0", "vector": [8, 1, 0.238, 0.0087, 1, 0.86, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' torso frame -> global frame\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L56_C4", "label": "disp =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L53_C0", "vector": [14, 1, 0.2445, 0.0044, 1, 0.86, 0.25, 654, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " disp = np.matrix([0.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L57_C4", "label": "rot = matrix()", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L53_C0", "vector": [14, 1, 0.2489, 0.0044, 1, 0.86, 0.5, 812, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " rot = np.matrix(np.eye(3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L58_C4", "label": "t = composeHomogeneousTransform()", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L53_C0", "vector": [14, 1, 0.2533, 0.0044, 1, 0.86, 0.75, 15, 3, 2, 0, 0, 126, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "composeHomogeneousTransform", "annotation": ""}, "snippet": " t = tr.composeHomogeneousTransform(rot,disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L59_C4", "label": "assign", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L53_C0", "vector": [14, 1, 0.2576, 0.0044, 1, 0.86, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _globalT['torso'] = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L61_C0", "label": "createThok0Transform", "type": "function", "loc": [61, 67], "level": 0, "parent": null, "vector": [2, 0, 0.2795, 0.0306, 0, 0.66, 0.3, 480, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "createThok0Transform", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def createThok0Transform():\n ''' thok0 frame -> global frame\n '''\n disp = np.matrix([0.,0.,0.09]).T\n rot = np.matrix(np.eye(3))\n t = tr.composeHomogeneousTransform(rot,disp)\n _globalT['thok0'] = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L62_C4", "label": "expression", "type": "expression", "loc": [62, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L61_C0", "vector": [8, 1, 0.2729, 0.0087, 1, 0.97, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' thok0 frame -> global frame\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L64_C4", "label": "disp =", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L61_C0", "vector": [14, 1, 0.2795, 0.0044, 1, 0.97, 0.25, 654, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " disp = np.matrix([0.,0.,0.09]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L65_C4", "label": "rot = matrix()", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L61_C0", "vector": [14, 1, 0.2838, 0.0044, 1, 0.97, 0.5, 812, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " rot = np.matrix(np.eye(3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L66_C4", "label": "t = composeHomogeneousTransform()", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L61_C0", "vector": [14, 1, 0.2882, 0.0044, 1, 0.97, 0.75, 15, 3, 2, 0, 0, 126, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "composeHomogeneousTransform", "annotation": ""}, "snippet": " t = tr.composeHomogeneousTransform(rot,disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L67_C4", "label": "assign", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L61_C0", "vector": [14, 1, 0.2926, 0.0044, 1, 0.97, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _globalT['thok0'] = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L69_C0", "label": "createUtm0Transform", "type": "function", "loc": [69, 76], "level": 0, "parent": null, "vector": [2, 0, 0.3166, 0.0349, 0, 0.66, 0.35, 84, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "createUtm0Transform", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def createUtm0Transform():\n ''' utm0 frame -> global frame\n '''\n disp = copy.copy(tr.getDispSubMat(_globalT['thok0']))\n disp[2,0] += 0.055\n rot = np.matrix(np.eye(3))\n t = tr.composeHomogeneousTransform(rot,disp)\n _globalT['utm0'] = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L70_C4", "label": "expression", "type": "expression", "loc": [70, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L69_C0", "vector": [8, 1, 0.3079, 0.0087, 1, 0.46, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' utm0 frame -> global frame\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L72_C4", "label": "disp = copy()", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L69_C0", "vector": [14, 1, 0.3144, 0.0044, 1, 0.46, 0.25, 654, 3, 1, 0, 0, 739, 10, 2], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " disp = copy.copy(tr.getDispSubMat(_globalT['thok0']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L74_C4", "label": "rot = matrix()", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L69_C0", "vector": [14, 1, 0.3231, 0.0044, 1, 0.46, 0.5, 812, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " rot = np.matrix(np.eye(3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L75_C4", "label": "t = composeHomogeneousTransform()", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L69_C0", "vector": [14, 1, 0.3275, 0.0044, 1, 0.46, 0.75, 15, 3, 2, 0, 0, 126, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "composeHomogeneousTransform", "annotation": ""}, "snippet": " t = tr.composeHomogeneousTransform(rot,disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L76_C4", "label": "assign", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L69_C0", "vector": [14, 1, 0.3319, 0.0044, 1, 0.46, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _globalT['utm0'] = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L78_C0", "label": "createMecanumTransform", "type": "function", "loc": [78, 84], "level": 0, "parent": null, "vector": [2, 0, 0.3537, 0.0306, 0, 0.66, 0.4, 361, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "createMecanumTransform", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def createMecanumTransform():\n ''' mecanum frame -> global frame (ignores the zenither)\n '''\n disp = np.matrix([-0.28,0.,0.0]).T\n rot = np.matrix(np.eye(3))\n t = tr.composeHomogeneousTransform(rot,disp)\n _globalT['mecanum'] = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L79_C4", "label": "expression", "type": "expression", "loc": [79, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L78_C0", "vector": [8, 1, 0.3472, 0.0087, 1, 0.31, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' mecanum frame -> global frame (ignores the zenither)\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L81_C4", "label": "disp =", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L78_C0", "vector": [14, 1, 0.3537, 0.0044, 1, 0.31, 0.25, 654, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " disp = np.matrix([-0.28,0.,0.0]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L82_C4", "label": "rot = matrix()", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L78_C0", "vector": [14, 1, 0.3581, 0.0044, 1, 0.31, 0.5, 812, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " rot = np.matrix(np.eye(3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L83_C4", "label": "t = composeHomogeneousTransform()", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L78_C0", "vector": [14, 1, 0.3624, 0.0044, 1, 0.31, 0.75, 15, 3, 2, 0, 0, 126, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "composeHomogeneousTransform", "annotation": ""}, "snippet": " t = tr.composeHomogeneousTransform(rot,disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L84_C4", "label": "assign", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L78_C0", "vector": [14, 1, 0.3668, 0.0044, 1, 0.31, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _globalT['mecanum'] = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L86_C0", "label": "create_globalTDict()", "type": "expression", "loc": [86, 86], "level": 0, "parent": null, "vector": [8, 0, 0.3755, 0.0044, 0, 0.66, 0.45, 430, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "create_globalTDict", "arg_names": [], "import_names": [], "rhs_call_name": "create_globalTDict", "annotation": ""}, "snippet": "create_globalTDict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L89_C0", "label": "globalTmecanum", "type": "function", "loc": [89, 97], "level": 0, "parent": null, "vector": [2, 0, 0.4061, 0.0393, 0, 0.66, 0.5, 734, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "globalTmecanum", "arg_names": ["p", "floating_vector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def globalTmecanum(p,floating_vector=False):\n ''' 3x1 vector from mecanum to global.\n '''\n p_hom = tr.xyzToHomogenous(p, floating_vector)\n p_gl = _globalT['mecanum'] * p_hom\n if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L90_C4", "label": "expression", "type": "expression", "loc": [90, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L89_C0", "vector": [8, 1, 0.3952, 0.0087, 1, 0.85, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' 3x1 vector from mecanum to global.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L92_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L89_C0", "vector": [14, 1, 0.4017, 0.0044, 1, 0.85, 0.3333, 254, 3, 2, 0, 0, 438, 10, 1], "semantic": {"name": "p_hom", "arg_names": [], "import_names": [], "rhs_call_name": "xyzToHomogenous", "annotation": ""}, "snippet": " p_hom = tr.xyzToHomogenous(p, floating_vector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L93_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L89_C0", "vector": [14, 1, 0.4061, 0.0044, 1, 0.85, 0.6667, 258, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_gl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_gl = _globalT['mecanum'] * p_hom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L94_C4", "label": "if", "type": "if", "loc": [94, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L89_C0", "vector": [4, 1, 0.417, 0.0175, 1, 0.85, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:\n return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L95_C8", "label": "return", "type": "return", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L94_C4", "vector": [13, 2, 0.4148, 0.0044, 2, 0.35, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]/p_gl[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L97_C8", "label": "return", "type": "return", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L94_C4", "vector": [13, 2, 0.4236, 0.0044, 2, 0.35, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L99_C0", "label": "mecanumTglobal", "type": "function", "loc": [99, 107], "level": 0, "parent": null, "vector": [2, 0, 0.4498, 0.0393, 0, 0.66, 0.55, 406, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "mecanumTglobal", "arg_names": ["p", "floating_vector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def mecanumTglobal(p,floating_vector=False):\n ''' 3x1 vector from global to mecanum.\n '''\n p_hom = tr.xyzToHomogenous(p, floating_vector)\n p_gl = tr.invertHomogeneousTransform(_globalT['mecanum']) * p_hom\n if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L100_C4", "label": "expression", "type": "expression", "loc": [100, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L99_C0", "vector": [8, 1, 0.4389, 0.0087, 1, 0.54, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' 3x1 vector from global to mecanum.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L102_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L99_C0", "vector": [14, 1, 0.4454, 0.0044, 1, 0.54, 0.3333, 254, 3, 2, 0, 0, 438, 10, 1], "semantic": {"name": "p_hom", "arg_names": [], "import_names": [], "rhs_call_name": "xyzToHomogenous", "annotation": ""}, "snippet": " p_hom = tr.xyzToHomogenous(p, floating_vector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L103_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L99_C0", "vector": [14, 1, 0.4498, 0.0044, 1, 0.54, 0.6667, 258, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p_gl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_gl = tr.invertHomogeneousTransform(_globalT['mecanum']) * p_hom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L104_C4", "label": "if", "type": "if", "loc": [104, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L99_C0", "vector": [4, 1, 0.4607, 0.0175, 1, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:\n return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L105_C8", "label": "return", "type": "return", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L104_C4", "vector": [13, 2, 0.4585, 0.0044, 2, 0.16, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]/p_gl[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L107_C8", "label": "return", "type": "return", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L104_C4", "vector": [13, 2, 0.4672, 0.0044, 2, 0.16, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L109_C0", "label": "globalTtorso", "type": "function", "loc": [109, 117], "level": 0, "parent": null, "vector": [2, 0, 0.4934, 0.0393, 0, 0.66, 0.6, 609, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "globalTtorso", "arg_names": ["p", "floating_vector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def globalTtorso(p,floating_vector=False):\n ''' 3x1 vector from torso to global.\n '''\n p_hom = tr.xyzToHomogenous(p, floating_vector)\n p_gl = _globalT['torso'] * p_hom\n if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L110_C4", "label": "expression", "type": "expression", "loc": [110, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L109_C0", "vector": [8, 1, 0.4825, 0.0087, 1, 0.29, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' 3x1 vector from torso to global.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L112_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L109_C0", "vector": [14, 1, 0.4891, 0.0044, 1, 0.29, 0.3333, 254, 3, 2, 0, 0, 438, 10, 1], "semantic": {"name": "p_hom", "arg_names": [], "import_names": [], "rhs_call_name": "xyzToHomogenous", "annotation": ""}, "snippet": " p_hom = tr.xyzToHomogenous(p, floating_vector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L113_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L109_C0", "vector": [14, 1, 0.4934, 0.0044, 1, 0.29, 0.6667, 258, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_gl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_gl = _globalT['torso'] * p_hom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L114_C4", "label": "if", "type": "if", "loc": [114, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L109_C0", "vector": [4, 1, 0.5044, 0.0175, 1, 0.29, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:\n return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L115_C8", "label": "return", "type": "return", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L114_C4", "vector": [13, 2, 0.5022, 0.0044, 2, 0.9, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]/p_gl[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L117_C8", "label": "return", "type": "return", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L114_C4", "vector": [13, 2, 0.5109, 0.0044, 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 p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L119_C0", "label": "torsoTglobal", "type": "function", "loc": [119, 127], "level": 0, "parent": null, "vector": [2, 0, 0.5371, 0.0393, 0, 0.66, 0.65, 309, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "torsoTglobal", "arg_names": ["p", "floating_vector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def torsoTglobal(p,floating_vector=False):\n ''' 3x1 vector from global to torso.\n '''\n p_hom = tr.xyzToHomogenous(p, floating_vector)\n p_gl = tr.invertHomogeneousTransform(_globalT['torso']) * p_hom\n if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L120_C4", "label": "expression", "type": "expression", "loc": [120, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L119_C0", "vector": [8, 1, 0.5262, 0.0087, 1, 0.39, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' 3x1 vector from global to torso.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L122_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L119_C0", "vector": [14, 1, 0.5328, 0.0044, 1, 0.39, 0.3333, 254, 3, 2, 0, 0, 438, 10, 1], "semantic": {"name": "p_hom", "arg_names": [], "import_names": [], "rhs_call_name": "xyzToHomogenous", "annotation": ""}, "snippet": " p_hom = tr.xyzToHomogenous(p, floating_vector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L123_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L119_C0", "vector": [14, 1, 0.5371, 0.0044, 1, 0.39, 0.6667, 258, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p_gl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_gl = tr.invertHomogeneousTransform(_globalT['torso']) * p_hom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L124_C4", "label": "if", "type": "if", "loc": [124, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L119_C0", "vector": [4, 1, 0.548, 0.0175, 1, 0.39, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:\n return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L125_C8", "label": "return", "type": "return", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L124_C4", "vector": [13, 2, 0.5459, 0.0044, 2, 0.97, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]/p_gl[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L127_C8", "label": "return", "type": "return", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L124_C4", "vector": [13, 2, 0.5546, 0.0044, 2, 0.97, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L129_C0", "label": "globalTthok0", "type": "function", "loc": [129, 137], "level": 0, "parent": null, "vector": [2, 0, 0.5808, 0.0393, 0, 0.66, 0.7, 124, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "globalTthok0", "arg_names": ["p", "floating_vector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def globalTthok0(p,floating_vector=False):\n ''' 3x1 vector from thok0 to global.\n '''\n p_hom = tr.xyzToHomogenous(p, floating_vector)\n p_gl = _globalT['thok0'] * p_hom\n if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L130_C4", "label": "expression", "type": "expression", "loc": [130, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L129_C0", "vector": [8, 1, 0.5699, 0.0087, 1, 0.54, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' 3x1 vector from thok0 to global.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L132_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [132, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L129_C0", "vector": [14, 1, 0.5764, 0.0044, 1, 0.54, 0.3333, 254, 3, 2, 0, 0, 438, 10, 1], "semantic": {"name": "p_hom", "arg_names": [], "import_names": [], "rhs_call_name": "xyzToHomogenous", "annotation": ""}, "snippet": " p_hom = tr.xyzToHomogenous(p, floating_vector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L133_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L129_C0", "vector": [14, 1, 0.5808, 0.0044, 1, 0.54, 0.6667, 258, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_gl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_gl = _globalT['thok0'] * p_hom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L134_C4", "label": "if", "type": "if", "loc": [134, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L129_C0", "vector": [4, 1, 0.5917, 0.0175, 1, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:\n return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L135_C8", "label": "return", "type": "return", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L134_C4", "vector": [13, 2, 0.5895, 0.0044, 2, 0.13, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]/p_gl[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L137_C8", "label": "return", "type": "return", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L134_C4", "vector": [13, 2, 0.5983, 0.0044, 2, 0.13, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L139_C0", "label": "thok0Tglobal", "type": "function", "loc": [139, 147], "level": 0, "parent": null, "vector": [2, 0, 0.6245, 0.0393, 0, 0.66, 0.75, 419, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "thok0Tglobal", "arg_names": ["p", "floating_vector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def thok0Tglobal(p,floating_vector=False):\n ''' 3x1 vector from global to thok0.\n '''\n p_hom = tr.xyzToHomogenous(p, floating_vector)\n p_gl = tr.invertHomogeneousTransform(_globalT['thok0']) * p_hom\n if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L140_C4", "label": "expression", "type": "expression", "loc": [140, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L139_C0", "vector": [8, 1, 0.6135, 0.0087, 1, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' 3x1 vector from global to thok0.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L142_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [142, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L139_C0", "vector": [14, 1, 0.6201, 0.0044, 1, 0.92, 0.3333, 254, 3, 2, 0, 0, 438, 10, 1], "semantic": {"name": "p_hom", "arg_names": [], "import_names": [], "rhs_call_name": "xyzToHomogenous", "annotation": ""}, "snippet": " p_hom = tr.xyzToHomogenous(p, floating_vector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L143_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [143, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L139_C0", "vector": [14, 1, 0.6245, 0.0044, 1, 0.92, 0.6667, 258, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p_gl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_gl = tr.invertHomogeneousTransform(_globalT['thok0']) * p_hom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L144_C4", "label": "if", "type": "if", "loc": [144, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L139_C0", "vector": [4, 1, 0.6354, 0.0175, 1, 0.92, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:\n return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L145_C8", "label": "return", "type": "return", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L144_C4", "vector": [13, 2, 0.6332, 0.0044, 2, 0.11, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]/p_gl[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L147_C8", "label": "return", "type": "return", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L144_C4", "vector": [13, 2, 0.6419, 0.0044, 2, 0.11, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L149_C0", "label": "globalTutm0", "type": "function", "loc": [149, 157], "level": 0, "parent": null, "vector": [2, 0, 0.6681, 0.0393, 0, 0.66, 0.8, 942, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "globalTutm0", "arg_names": ["p", "floating_vector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def globalTutm0(p,floating_vector=False):\n ''' 3x1 vector from utm0 to global.\n '''\n p_hom = tr.xyzToHomogenous(p, floating_vector)\n p_gl = _globalT['utm0'] * p_hom\n if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L150_C4", "label": "expression", "type": "expression", "loc": [150, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L149_C0", "vector": [8, 1, 0.6572, 0.0087, 1, 0.69, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' 3x1 vector from utm0 to global.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L152_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [152, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L149_C0", "vector": [14, 1, 0.6638, 0.0044, 1, 0.69, 0.3333, 254, 3, 2, 0, 0, 438, 10, 1], "semantic": {"name": "p_hom", "arg_names": [], "import_names": [], "rhs_call_name": "xyzToHomogenous", "annotation": ""}, "snippet": " p_hom = tr.xyzToHomogenous(p, floating_vector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L153_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [153, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L149_C0", "vector": [14, 1, 0.6681, 0.0044, 1, 0.69, 0.6667, 258, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_gl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_gl = _globalT['utm0'] * p_hom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L154_C4", "label": "if", "type": "if", "loc": [154, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L149_C0", "vector": [4, 1, 0.679, 0.0175, 1, 0.69, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:\n return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L155_C8", "label": "return", "type": "return", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L154_C4", "vector": [13, 2, 0.6769, 0.0044, 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 p_gl[0:3]/p_gl[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L157_C8", "label": "return", "type": "return", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L154_C4", "vector": [13, 2, 0.6856, 0.0044, 2, 0.5, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L159_C0", "label": "utm0Tglobal", "type": "function", "loc": [159, 167], "level": 0, "parent": null, "vector": [2, 0, 0.7118, 0.0393, 0, 0.66, 0.85, 692, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "utm0Tglobal", "arg_names": ["p", "floating_vector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def utm0Tglobal(p,floating_vector=False):\n ''' 3x1 vector from global to utm0.\n '''\n p_hom = tr.xyzToHomogenous(p, floating_vector)\n p_gl = tr.invertHomogeneousTransform(_globalT['utm0']) * p_hom\n if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L160_C4", "label": "expression", "type": "expression", "loc": [160, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L159_C0", "vector": [8, 1, 0.7009, 0.0087, 1, 0.79, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' 3x1 vector from global to utm0.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L162_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [162, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L159_C0", "vector": [14, 1, 0.7074, 0.0044, 1, 0.79, 0.3333, 254, 3, 2, 0, 0, 438, 10, 1], "semantic": {"name": "p_hom", "arg_names": [], "import_names": [], "rhs_call_name": "xyzToHomogenous", "annotation": ""}, "snippet": " p_hom = tr.xyzToHomogenous(p, floating_vector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L163_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [163, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L159_C0", "vector": [14, 1, 0.7118, 0.0044, 1, 0.79, 0.6667, 258, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p_gl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_gl = tr.invertHomogeneousTransform(_globalT['utm0']) * p_hom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L164_C4", "label": "if", "type": "if", "loc": [164, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L159_C0", "vector": [4, 1, 0.7227, 0.0175, 1, 0.79, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if floating_vector == False:\n return p_gl[0:3]/p_gl[3]\n else:\n return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L165_C8", "label": "return", "type": "return", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L164_C4", "vector": [13, 2, 0.7205, 0.0044, 2, 0.97, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]/p_gl[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L167_C8", "label": "return", "type": "return", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L164_C4", "vector": [13, 2, 0.7293, 0.0044, 2, 0.97, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "label": "utmcam0Tglobal_mat", "type": "function", "loc": [172, 194], "level": 0, "parent": null, "vector": [2, 0, 0.7991, 0.1004, 0, 0.66, 0.9, 670, 0, 1, 1, 0, 0, 0, 16], "semantic": {"name": "utmcam0Tglobal_mat", "arg_names": ["ang"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def utmcam0Tglobal_mat(ang):\n thok0Tglobal_mat = tr.invertHomogeneousTransform(_globalT['thok0'])\n # servo angle.\n disp = np.matrix([0.,0.,0.]).T\n tmat = tr.composeHomogeneousTransform(tr.Ry(ang),disp)*thok0Tglobal_mat\n\n # cameraTlaser from thok_cam_calib.py\n x = 0.012"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L173_C4", "label": "thok0Tglobal_mat = invertHomogeneousTransform()", "type": "assigned_variable", "loc": [173, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "vector": [14, 1, 0.7555, 0.0044, 1, 0.1, 0.0, 214, 3, 1, 0, 0, 505, 10, 1], "semantic": {"name": "thok0Tglobal_mat", "arg_names": [], "import_names": [], "rhs_call_name": "invertHomogeneousTransform", "annotation": ""}, "snippet": " thok0Tglobal_mat = tr.invertHomogeneousTransform(_globalT['thok0'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L175_C4", "label": "disp =", "type": "assigned_variable", "loc": [175, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "vector": [14, 1, 0.7642, 0.0044, 1, 0.1, 0.0588, 654, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " disp = np.matrix([0.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L176_C4", "label": "tmat =", "type": "assigned_variable", "loc": [176, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "vector": [14, 1, 0.7686, 0.0044, 1, 0.1, 0.1176, 205, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "tmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tmat = tr.composeHomogeneousTransform(tr.Ry(ang),disp)*thok0Tglobal_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L179_C4", "label": "x =", "type": "assigned_variable", "loc": [179, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "vector": [14, 1, 0.7817, 0.0044, 1, 0.1, 0.1765, 190, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = 0.012"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L180_C4", "label": "y =", "type": "assigned_variable", "loc": [180, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "vector": [14, 1, 0.786, 0.0044, 1, 0.1, 0.2353, 304, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = -0.056"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L181_C4", "label": "z =", "type": "assigned_variable", "loc": [181, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "vector": [14, 1, 0.7904, 0.0044, 1, 0.1, 0.2941, 859, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = 0.035"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L182_C4", "label": "r1 =", "type": "assigned_variable", "loc": [182, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "vector": [14, 1, 0.7948, 0.0044, 1, 0.1, 0.3529, 648, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "r1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r1 = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L183_C4", "label": "r2 =", "type": "assigned_variable", "loc": [183, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "vector": [14, 1, 0.7991, 0.0044, 1, 0.1, 0.4118, 959, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "r2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r2 = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L184_C4", "label": "r3 =", "type": "assigned_variable", "loc": [184, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "vector": [14, 1, 0.8035, 0.0044, 1, 0.1, 0.4706, 837, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r3", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r3 = -0.7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L185_C4", "label": "disp =", "type": "assigned_variable", "loc": [185, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "vector": [14, 1, 0.8079, 0.0044, 1, 0.1, 0.5294, 654, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " disp = np.matrix([-x,-y,-z]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L186_C4", "label": "r =", "type": "assigned_variable", "loc": [186, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "vector": [14, 1, 0.8122, 0.0044, 1, 0.1, 0.5882, 436, 4, 0, 0, 0, 0, 0, 4], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = tr.Rz(math.radians(-90))*tr.Ry(math.radians(90.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L187_C4", "label": "disp =", "type": "assigned_variable", "loc": [187, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "vector": [14, 1, 0.8166, 0.0044, 1, 0.1, 0.6471, 654, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "disp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " disp = r*disp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L188_C4", "label": "r =", "type": "assigned_variable", "loc": [188, 188], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "vector": [14, 1, 0.821, 0.0044, 1, 0.1, 0.7059, 436, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = r*tr.Rx(math.radians(r1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L189_C4", "label": "r =", "type": "assigned_variable", "loc": [189, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "vector": [14, 1, 0.8253, 0.0044, 1, 0.1, 0.7647, 436, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = r*tr.Ry(math.radians(r2))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L190_C4", "label": "r =", "type": "assigned_variable", "loc": [190, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "vector": [14, 1, 0.8297, 0.0044, 1, 0.1, 0.8235, 436, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = r*tr.Rz(math.radians(r3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L192_C4", "label": "t = composeHomogeneousTransform()", "type": "assigned_variable", "loc": [192, 192], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "vector": [14, 1, 0.8384, 0.0044, 1, 0.1, 0.8824, 15, 3, 2, 0, 0, 126, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "composeHomogeneousTransform", "annotation": ""}, "snippet": " t = tr.composeHomogeneousTransform(r, disp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L193_C4", "label": "tmat =", "type": "assigned_variable", "loc": [193, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "vector": [14, 1, 0.8428, 0.0044, 1, 0.1, 0.9412, 205, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tmat = t*tmat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L194_C4", "label": "return", "type": "return", "loc": [194, 194], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "vector": [13, 1, 0.8472, 0.0044, 1, 0.1, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tmat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L201_C0", "label": "utmcam0Tglobal", "type": "function", "loc": [201, 210], "level": 0, "parent": null, "vector": [2, 0, 0.8974, 0.0437, 0, 0.66, 0.95, 894, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "utmcam0Tglobal", "arg_names": ["p", "ang", "floating_vector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def utmcam0Tglobal(p,ang,floating_vector=False):\n t = utmcam0Tglobal_mat(ang)\n p_hom = tr.xyzToHomogenous(p, floating_vector)\n p_c = t * p_hom\n if floating_vector == False:\n pt = p_c[0:3]/p_c[3]\n else:\n pt = p_c[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L202_C4", "label": "t = utmcam0Tglobal_mat()", "type": "assigned_variable", "loc": [202, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L201_C0", "vector": [14, 1, 0.8821, 0.0044, 1, 0.64, 0.0, 15, 3, 1, 0, 0, 670, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "utmcam0Tglobal_mat", "annotation": ""}, "snippet": " t = utmcam0Tglobal_mat(ang)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L203_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [203, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L201_C0", "vector": [14, 1, 0.8865, 0.0044, 1, 0.64, 0.25, 254, 3, 2, 0, 0, 438, 10, 1], "semantic": {"name": "p_hom", "arg_names": [], "import_names": [], "rhs_call_name": "xyzToHomogenous", "annotation": ""}, "snippet": " p_hom = tr.xyzToHomogenous(p, floating_vector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L204_C4", "label": "p_c =", "type": "assigned_variable", "loc": [204, 204], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L201_C0", "vector": [14, 1, 0.8908, 0.0044, 1, 0.64, 0.5, 748, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_c = t * p_hom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L205_C4", "label": "if", "type": "if", "loc": [205, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L201_C0", "vector": [4, 1, 0.9017, 0.0175, 1, 0.64, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if floating_vector == False:\n pt = p_c[0:3]/p_c[3]\n else:\n pt = p_c[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L206_C8", "label": "pt =", "type": "assigned_variable", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L205_C4", "vector": [14, 2, 0.8996, 0.0044, 2, 0.2, 0.0, 989, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = p_c[0:3]/p_c[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L208_C8", "label": "pt =", "type": "assigned_variable", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L205_C4", "vector": [14, 2, 0.9083, 0.0044, 2, 0.2, 1.0, 989, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = p_c[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L210_C4", "label": "return", "type": "return", "loc": [210, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L201_C0", "vector": [13, 1, 0.917, 0.0044, 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 pt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L217_C0", "label": "globalTutmcam0", "type": "function", "loc": [217, 227], "level": 0, "parent": null, "vector": [2, 0, 0.9694, 0.048, 0, 0.66, 1.0, 741, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "globalTutmcam0", "arg_names": ["p", "ang", "floating_vector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def globalTutmcam0(p,ang,floating_vector=False):\n t = utmcam0Tglobal_mat(ang)\n t = tr.invertHomogeneousTransform(t)\n p_hom = tr.xyzToHomogenous(p, floating_vector)\n p_c = t * p_hom\n if floating_vector == False:\n pt = p_c[0:3]/p_c[3]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L218_C4", "label": "t = utmcam0Tglobal_mat()", "type": "assigned_variable", "loc": [218, 218], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L217_C0", "vector": [14, 1, 0.952, 0.0044, 1, 0.12, 0.0, 15, 3, 1, 0, 0, 670, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "utmcam0Tglobal_mat", "annotation": ""}, "snippet": " t = utmcam0Tglobal_mat(ang)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L219_C4", "label": "t = invertHomogeneousTransform()", "type": "assigned_variable", "loc": [219, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L217_C0", "vector": [14, 1, 0.9563, 0.0044, 1, 0.12, 0.2, 15, 3, 1, 0, 0, 505, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "invertHomogeneousTransform", "annotation": ""}, "snippet": " t = tr.invertHomogeneousTransform(t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L220_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [220, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L217_C0", "vector": [14, 1, 0.9607, 0.0044, 1, 0.12, 0.4, 254, 3, 2, 0, 0, 438, 10, 1], "semantic": {"name": "p_hom", "arg_names": [], "import_names": [], "rhs_call_name": "xyzToHomogenous", "annotation": ""}, "snippet": " p_hom = tr.xyzToHomogenous(p, floating_vector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L221_C4", "label": "p_c =", "type": "assigned_variable", "loc": [221, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L217_C0", "vector": [14, 1, 0.9651, 0.0044, 1, 0.12, 0.6, 748, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_c = t * p_hom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L222_C4", "label": "if", "type": "if", "loc": [222, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L217_C0", "vector": [4, 1, 0.976, 0.0175, 1, 0.12, 0.8, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if floating_vector == False:\n pt = p_c[0:3]/p_c[3]\n else:\n pt = p_c[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L223_C8", "label": "pt =", "type": "assigned_variable", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L222_C4", "vector": [14, 2, 0.9738, 0.0044, 2, 0.99, 0.0, 989, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = p_c[0:3]/p_c[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L225_C8", "label": "pt =", "type": "assigned_variable", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L222_C4", "vector": [14, 2, 0.9825, 0.0044, 2, 0.99, 1.0, 989, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = p_c[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L227_C4", "label": "return", "type": "return", "loc": [227, 227], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L217_C0", "vector": [13, 1, 0.9913, 0.0044, 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 pt"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Expr_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L186_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L190_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L218_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L220_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L222_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:If_L222_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Assign_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99743:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99743:Return_L227_C4"}]
#!/usr/bin/python # # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Author: Advait Jain import m3.rt_proxy as m3p import m3.arm import m3.toolbox as m3t import m3.pwr as m3w import m3.loadx6 import m3.component_factory as m3f import arm_client as ac import math import numpy as np import sys, time, os import copy from threading import RLock import arms as ar import roslib; roslib.load_manifest('epc_core') import rospy import hrl_lib.transforms as tr from hrl_msgs.msg import FloatArray from roslib.msg import Header from std_msgs.msg import Bool from std_msgs.msg import Empty from std_srvs.srv import Empty as Empty_srv from std_srvs.srv import EmptyResponse from sensor_msgs.msg import JointState THETA_GC = 5 TORQUE_GC = 4 THETA = 3 OFF = 0 # in OFF mode also, the behavior is strange. Not the same as hitting the estop (Advait, Jan 1 2010) ## 1D kalman filter update. def kalman_update(xhat, P, Q, R, z): #time update xhatminus = xhat Pminus = P + Q #measurement update K = Pminus / (Pminus + R) xhat = xhatminus + K * (z-xhatminus) P = (1-K) * Pminus return xhat, P class MekaArmSettings(): def __init__(self, stiffness_list=[0.7,0.7,0.8,0.8,0.3], control_mode='theta_gc'): ''' stiffness_list: list of 5 stiffness values for joints 0-4. control_mode: 'theta_gc' or 'torque_gc' ''' self.set_stiffness_scale(stiffness_list) self.control_mode = control_mode def set_stiffness_scale(self, l): # for safety of wrist roll. Advait Jun 18, 2010. # changed to 0.2 from 0.3 (Advait, Sept 19, 2010) l[4] = min(l[4], 0.2) self.stiffness_list = l class MekaArmServer(): def __init__(self, right_arm_settings=None, left_arm_settings=None): self.arm_settings = {} # dict is set in set_arm_settings self.initialize_joints(right_arm_settings, left_arm_settings) #self.initialize_gripper() self.left_arm_ft = {'force': np.matrix(np.zeros((3,1),dtype='float32')), 'torque': np.matrix(np.zeros((3,1),dtype='float32'))} self.right_arm_ft = {'force': np.matrix(np.zeros((3,1),dtype='float32')), 'torque': np.matrix(np.zeros((3,1),dtype='float32'))} self.fts_bias = {'left_arm': self.left_arm_ft, 'right_arm': self.right_arm_ft} # kalman filtering force vector. (self.step and bias_wrist_ft) self.Q_force, self.R_force = {}, {} self.xhat_force, self.P_force = {}, {} self.Q_force['right_arm'] = [1e-3, 1e-3, 1e-3] self.R_force['right_arm'] = [0.2**2, 0.2**2, 0.2**2] self.xhat_force['right_arm'] = [0., 0., 0.] self.P_force['right_arm'] = [1.0, 1.0, 1.0] self.Q_force['left_arm'] = [1e-3, 1e-3, 1e-3] self.R_force['left_arm'] = [0.2**2, 0.2**2, 0.2**2] self.xhat_force['left_arm'] = [0., 0., 0.] self.P_force['left_arm'] = [1.0, 1.0, 1.0] #----- ROS interface --------- rospy.init_node('arm_server', anonymous=False) rospy.Service('toggle_floating_arms', Empty_srv, self.floating_arms_cb) self.q_r_pub = rospy.Publisher('/r_arm/q', FloatArray) self.q_l_pub = rospy.Publisher('/l_arm/q', FloatArray) self.force_raw_r_pub = rospy.Publisher('/r_arm/force_raw', FloatArray) self.force_raw_l_pub = rospy.Publisher('/l_arm/force_raw', FloatArray) self.force_r_pub = rospy.Publisher('/r_arm/force', FloatArray) self.force_l_pub = rospy.Publisher('/l_arm/force', FloatArray) self.jep_r_pub = rospy.Publisher('/r_arm/jep', FloatArray) self.jep_l_pub = rospy.Publisher('/l_arm/jep', FloatArray) self.alph_r_pub = rospy.Publisher('/r_arm/joint_impedance_scale', FloatArray) self.alph_l_pub = rospy.Publisher('/l_arm/joint_impedance_scale', FloatArray) self.pwr_state_pub = rospy.Publisher('/arms/pwr_state', Bool) self.joint_state_pub = rospy.Publisher('/joint_states', JointState) rospy.Subscriber('/r_arm/command/jep', FloatArray, self.r_jep_cb) rospy.Subscriber('/l_arm/command/jep', FloatArray, self.l_jep_cb) rospy.Subscriber('/r_arm/command/joint_impedance_scale', FloatArray, self.r_alpha_cb) rospy.Subscriber('/l_arm/command/joint_impedance_scale', FloatArray, self.l_alpha_cb) # publishing to this message will stop the arms but also crash # the server (since meka server crashes.) Advait Nov 14, 2010 rospy.Subscriber('/arms/stop', Empty, self.stop) rospy.Subscriber('/arms/command/motors_off', Empty, self.motors_off) self.cb_lock = RLock() self.r_jep = None # see set_jep self.l_jep = None # see set_jep self.qr_prev = None # see step_ros self.ql_prev = None # see step_ros self.joint_names_list = ac.get_joint_name_dict() self.floating_arms = False self.floating_arms_counter = 0 def floating_arms_cb(self, req): self.floating_arms_counter = 0 self.floating_arms = not self.floating_arms #rospy.logout('floating_arms_cb called') return EmptyResponse() def set_arm_settings(self,right_arm_settings,left_arm_settings): self.arm_settings['right_arm'] = right_arm_settings self.arm_settings['left_arm'] = left_arm_settings for arm,arm_settings in zip(['right_arm','left_arm'],[right_arm_settings,left_arm_settings]): joint_component_list = self.joint_list_dict[arm] # OFF mode doesn't seem to work. (Advait, Jan 1 2010) if arm_settings == None: for c in joint_component_list: c.set_control_mode(OFF) continue stiffness_list = arm_settings.stiffness_list if arm_settings.control_mode == 'torque_gc': print 'setting control mode to torque_gc' for c in joint_component_list: c.set_control_mode(TORQUE_GC) c.set_torque_mNm(0.0) elif arm_settings.control_mode == 'theta_gc': print 'setting control mode to theta_gc' for i in range(5): joint_component_list[i].set_control_mode(THETA_GC) joint_component_list[i].set_stiffness(stiffness_list[i]) joint_component_list[i].set_slew_rate_proportion(1.) joint_component_list[5].set_control_mode(THETA) joint_component_list[5].set_slew_rate_proportion(1.) joint_component_list[6].set_control_mode(THETA) joint_component_list[6].set_slew_rate_proportion(1.) elif arm_settings.control_mode == 'wrist_theta_gc': print 'setting control mode to theta_gc include wrist joints' for i in range(7): joint_component_list[i].set_control_mode(THETA_GC) joint_component_list[i].set_stiffness(stiffness_list[i]) joint_component_list[i].set_slew_rate_proportion(1.) else: print 'hrl_robot.initialize_joints. unknown control mode for ', arm,':', arm_settings.control_mode # put a few things into safeop so that individual joint # components work. def safeop_things(self): robot_name = 'm3humanoid_bimanual_mr1' chain_names = ['m3arm_ma1', 'm3arm_ma2'] dynamatics_nms = ['m3dynamatics_ma1', 'm3dynamatics_ma2'] self.proxy.make_safe_operational(robot_name) for c in chain_names: self.proxy.make_safe_operational(c) for d in dynamatics_nms: self.proxy.make_safe_operational(d) def initialize_joints(self, right_arm_settings, left_arm_settings): self.proxy = m3p.M3RtProxy() self.proxy.start() for c in ['m3pwr_pwr003','m3loadx6_ma1_l0','m3arm_ma1','m3loadx6_ma2_l0','m3arm_ma2']: if not self.proxy.is_component_available(c): raise m3t.M3Exception('Component '+c+' is not available.') self.joint_list_dict = {} right_l = [] for c in ['m3joint_ma1_j0','m3joint_ma1_j1','m3joint_ma1_j2', 'm3joint_ma1_j3','m3joint_ma1_j4','m3joint_ma1_j5', 'm3joint_ma1_j6']: if not self.proxy.is_component_available(c): raise m3t.M3Exception('Component '+c+' is not available.') right_l.append(m3f.create_component(c)) self.joint_list_dict['right_arm'] = right_l left_l = [] for c in ['m3joint_ma2_j0','m3joint_ma2_j1','m3joint_ma2_j2', 'm3joint_ma2_j3','m3joint_ma2_j4','m3joint_ma2_j5', 'm3joint_ma2_j6']: if not self.proxy.is_component_available(c): raise m3t.M3Exception('Component '+c+' is not available.') left_l.append(m3f.create_component(c)) self.joint_list_dict['left_arm'] = left_l for arm,arm_settings in zip(['right_arm','left_arm'],[right_arm_settings,left_arm_settings]): if arm_settings == None: continue for comp in self.joint_list_dict[arm]: self.proxy.subscribe_status(comp) self.proxy.publish_command(comp) self.set_arm_settings(right_arm_settings,left_arm_settings) right_fts=m3.loadx6.M3LoadX6('m3loadx6_ma1_l0') self.proxy.subscribe_status(right_fts) left_fts=m3.loadx6.M3LoadX6('m3loadx6_ma2_l0') self.proxy.subscribe_status(left_fts) self.fts = {'right_arm':right_fts,'left_arm':left_fts} #self.pwr=m3w.M3Pwr('m3pwr_pwr003') self.pwr=m3f.create_component('m3pwr_pwr003') self.proxy.subscribe_status(self.pwr) self.proxy.publish_command(self.pwr) self.arms = {} self.arms['right_arm']=m3.arm.M3Arm('m3arm_ma1') self.proxy.subscribe_status(self.arms['right_arm']) self.arms['left_arm']=m3.arm.M3Arm('m3arm_ma2') self.proxy.subscribe_status(self.arms['left_arm']) self.proxy.step() self.proxy.step() def initialize_gripper(self): #self.right_gripper = m3h.M3Gripper('m3gripper_mg0') self.right_gripper = m3h.M3Gripper('m3gripper_mg1') self.proxy.publish_command(self.right_gripper) self.proxy.subscribe_status(self.right_gripper) def step(self): self.proxy.step() for arm in ['left_arm', 'right_arm']: z = self.get_wrist_force(arm).A1 # Force vector #if arm == 'right_arm': # z = self.get_wrist_force_nano().A1 for i in range(3): xhat, p = kalman_update(self.xhat_force[arm][i], self.P_force[arm][i], self.Q_force[arm][i], self.R_force[arm][i], z[i]) if abs(z[i] - self.xhat_force[arm][i]) > 3.: xhat = z[i] # not filtering step changes. self.xhat_force[arm][i] = xhat self.P_force[arm][i] = p def step_ros(self): r_arm = 'right_arm' l_arm = 'left_arm' self.cb_lock.acquire() r_jep = copy.copy(self.r_jep) l_jep = copy.copy(self.l_jep) r_alpha = copy.copy(self.arm_settings['right_arm'].stiffness_list) l_alpha = copy.copy(self.arm_settings['left_arm'].stiffness_list) self.cb_lock.release() self.set_jep(r_arm, r_jep) self.set_jep(l_arm, l_jep) self.set_alpha(r_arm, r_alpha) self.set_alpha(l_arm, l_alpha) self.step() motor_pwr_state = self.is_motor_power_on() if not motor_pwr_state: self.maintain_configuration() q_r = self.get_joint_angles(r_arm) q_l = self.get_joint_angles(l_arm) if self.floating_arms: if self.qr_prev == None or self.floating_arms_counter < 100: self.qr_prev = q_r self.ql_prev = q_l self.floating_arms_counter += 1 else: tol = np.radians([5., 2., 10., 2., 10., 0.03, 0.6]) r_arr = np.array(q_r) l_arr = np.array(q_l) prev_r_arr = np.array(self.qr_prev) prev_l_arr = np.array(self.ql_prev) dqr = np.array(q_r) - np.array(prev_r_arr) dql = np.array(q_l) - np.array(prev_l_arr) dqr = dqr * (np.abs(dqr) > tol) dql = dql * (np.abs(dql) > tol) r_jep = (np.array(r_jep) + dqr).tolist() l_jep = (np.array(l_jep) + dql).tolist() self.cb_lock.acquire() self.r_jep = copy.copy(r_jep) self.l_jep = copy.copy(l_jep) self.cb_lock.release() change_idxs = np.where(dqr != 0) prev_r_arr[change_idxs] = r_arr[change_idxs] change_idxs = np.where(dql != 0) prev_l_arr[change_idxs] = l_arr[change_idxs] self.qr_prev = prev_r_arr.tolist() self.ql_prev = prev_l_arr.tolist() f_raw_r = self.get_wrist_force(r_arm).A1.tolist() f_raw_l = self.get_wrist_force(l_arm).A1.tolist() f_r = self.xhat_force[r_arm] f_l = self.xhat_force[l_arm] # publish stuff over ROS. time_stamp = rospy.Time.now() h = Header() h.stamp = time_stamp self.q_r_pub.publish(FloatArray(h, q_r)) self.q_l_pub.publish(FloatArray(h, q_l)) self.jep_r_pub.publish(FloatArray(h, r_jep)) self.jep_l_pub.publish(FloatArray(h, l_jep)) self.alph_r_pub.publish(FloatArray(h, r_alpha)) self.alph_l_pub.publish(FloatArray(h, l_alpha)) h.frame_id = '/torso_lift_link' nms = self.joint_names_list['right_arm'] + self.joint_names_list['left_arm'] pos = q_r + q_l self.joint_state_pub.publish(JointState(h, nms, pos, [0.]*len(pos), [0.]*len(pos))) h.frame_id = ar.link_tf_name(r_arm, 7) self.force_raw_r_pub.publish(FloatArray(h, f_raw_r)) self.force_r_pub.publish(FloatArray(h, f_r)) h.frame_id = ar.link_tf_name(l_arm, 7) self.force_raw_l_pub.publish(FloatArray(h, f_raw_l)) self.force_l_pub.publish(FloatArray(h, f_l)) self.pwr_state_pub.publish(Bool(motor_pwr_state)) def is_motor_power_on(self): return self.pwr.is_motor_power_on(None) # Advait, Aug 8, 2009 # two steps in motors_on and off because with simply one step # pwr.is_motor_on does not get the correct value. (I think this is # because at the clock edge when motor on command is sent, the power # is still off and thus the status is not affected.) def motors_off(self, msg=None): self.pwr.set_motor_power_off() def motors_on(self): self.maintain_configuration() self.pwr.set_motor_power_on() self.step() self.step() def maintain_configuration(self): for arm in ['right_arm','left_arm']: q = self.get_joint_angles(arm) if self.arm_settings[arm] == None: continue if 'theta_gc' not in self.arm_settings[arm].control_mode: raise RuntimeError('bad control mode: %s', self.arm_settings[arm].control_mode) self.set_jep(arm, q) self.cb_lock.acquire() if arm == 'right_arm': self.r_jep = q else: self.l_jep = q self.cb_lock.release() def power_on(self): self.maintain_configuration() self.proxy.make_operational_all() self.safeop_things() self.pwr.set_motor_power_on() self.step() self.step() def stop(self, msg=None): self.pwr.set_motor_power_off() self.step() self.proxy.stop() ##3X1 numpy matrix of forces measured by the wrist FT sensor. #(This is the force that the environment is applying on the wrist) # @param arm - 'left_arm' or 'right_arm' # @return in SI units #coord frame - tool tip coord frame (parallel to the base frame in the home position) # 2010/2/5 Advait, Aaron King, Tiffany verified that coordinate frame # from Meka is the left-hand coordinate frame. def get_wrist_force(self, arm): m = [] lc = self.fts[arm] m.append(lc.get_Fx_mN()/1000.) m.append(lc.get_Fy_mN()/1000.) m.append(-lc.get_Fz_mN()/1000.) m = tr.Rz(math.radians(-30.0))*np.matrix(m).T m[1,0] = -m[1,0] m[2,0] = -m[2,0] return m def get_wrist_force_nano(self): f = self.r_arm_ftc.read()[0:3, :] f = tr.Rz(math.radians(-60.)) * f f[1,0] = f[1,0] * -1 return f #-------------------- getting and setting joint angles ------------ ## # @param arm - 'left_arm' or 'right_arm' # @return list of 7 joint accelerations in RADIANS/s^2. # according to meka's coordinate frames. def get_joint_accelerations(self, arm): return self.arms[arm].get_thetadotdot_rad().tolist() ## # @param arm - 'left_arm' or 'right_arm' # @return list of 7 joint velocities in RADIANS/s. # according to meka's coordinate frames. def get_joint_velocities(self, arm): return self.arms[arm].get_thetadot_rad().tolist() def get_joint_angles(self, arm): ''' returns list of 7 joint angles in RADIANS. according to meka's coordinate frames. ''' return self.arms[arm].get_theta_rad().tolist() def l_jep_cb(self, msg): self.cb_lock.acquire() self.l_jep = msg.data self.cb_lock.release() def r_jep_cb(self, msg): self.cb_lock.acquire() self.r_jep = msg.data self.cb_lock.release() ## # @param q - list of 7 joint angles in RADIANS. according to meka's coordinate frames. def set_jep(self, arm, q): if self.arm_settings[arm] == None: return if self.arm_settings[arm].control_mode != 'theta_gc' and \ self.arm_settings[arm].control_mode != 'wrist_theta_gc': raise RuntimeError('Bad control mode: %s'%(self.arm_settings[arm].control_mode)) for i,qi in enumerate(q): ## NOTE - meka's set_theta_deg takes angle in radians. #self.joint_list_dict[arm][i].set_theta_deg(qi) # Not anymore. (Advait Aug 27, 2009) self.joint_list_dict[arm][i].set_theta_rad(qi) self.cb_lock.acquire() if arm == 'right_arm': self.r_jep = q else: self.l_jep = q self.cb_lock.release() def r_alpha_cb(self, msg): self.cb_lock.acquire() self.arm_settings['right_arm'].set_stiffness_scale(list(msg.data)) self.cb_lock.release() def l_alpha_cb(self, msg): self.cb_lock.acquire() self.arm_settings['left_arm'].set_stiffness_scale(list(msg.data)) self.cb_lock.release() def set_alpha(self, arm, alpha): jcl = self.joint_list_dict[arm] for i,a in enumerate(alpha): jcl[i].set_stiffness(a) if __name__ == '__main__': try: settings_r = MekaArmSettings(stiffness_list=[0.1939,0.6713,0.748,0.7272,0.75]) #settings_r = None settings_l = MekaArmSettings(stiffness_list=[0.1939,0.6713,0.748,0.7272,0.75]) #settings_l = None cody_arms = MekaArmServer(settings_r, settings_l) # print 'hit a key to power up the arms.' # k=m3t.get_keystroke() cody_arms.power_on() while not rospy.is_shutdown(): cody_arms.step_ros() rospy.sleep(0.005) cody_arms.stop() except m3t.M3Exception: print '############################################################' print 'In all likelihood the Meka server is not running.' print '############################################################' raise except: # only use cody_arms if it was successfully created. if 'cody_arms' in locals(): cody_arms.stop() raise
ajibawa-2023/Python-Code-Large/train/row_99744
350
573
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Import_L32_C0", "label": "m3.rt_proxy import m3p", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.0558, 0.0017, 0, 0.66, 0.0, 826, 0, 1, 0, 0, 826, 0, 0], "semantic": {"name": "m3.rt_proxy", "arg_names": [], "import_names": ["m3p"], "rhs_call_name": "", "annotation": ""}, "snippet": "import m3.rt_proxy as m3p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Import_L33_C0", "label": "m3.arm import m3.arm", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.0576, 0.0017, 0, 0.66, 0.0323, 234, 0, 1, 0, 0, 234, 0, 0], "semantic": {"name": "m3.arm", "arg_names": [], "import_names": ["m3.arm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import m3.arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Import_L34_C0", "label": "m3.toolbox import m3t", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0593, 0.0017, 0, 0.66, 0.0645, 478, 0, 1, 0, 0, 478, 0, 0], "semantic": {"name": "m3.toolbox", "arg_names": [], "import_names": ["m3t"], "rhs_call_name": "", "annotation": ""}, "snippet": "import m3.toolbox as m3t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Import_L35_C0", "label": "m3.pwr import m3w", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.0611, 0.0017, 0, 0.66, 0.0968, 597, 0, 1, 0, 0, 597, 0, 0], "semantic": {"name": "m3.pwr", "arg_names": [], "import_names": ["m3w"], "rhs_call_name": "", "annotation": ""}, "snippet": "import m3.pwr as m3w"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Import_L36_C0", "label": "m3.loadx6 import m3.loadx6", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.0628, 0.0017, 0, 0.66, 0.129, 913, 0, 1, 0, 0, 913, 0, 0], "semantic": {"name": "m3.loadx6", "arg_names": [], "import_names": ["m3.loadx6"], "rhs_call_name": "", "annotation": ""}, "snippet": "import m3.loadx6"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Import_L38_C0", "label": "m3.component_factory import m3f", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.0663, 0.0017, 0, 0.66, 0.1613, 932, 0, 1, 0, 0, 932, 0, 0], "semantic": {"name": "m3.component_factory", "arg_names": [], "import_names": ["m3f"], "rhs_call_name": "", "annotation": ""}, "snippet": "import m3.component_factory as m3f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Import_L40_C0", "label": "arm_client import ac", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.0698, 0.0017, 0, 0.66, 0.1935, 435, 0, 1, 0, 0, 435, 0, 0], "semantic": {"name": "arm_client", "arg_names": [], "import_names": ["ac"], "rhs_call_name": "", "annotation": ""}, "snippet": "import arm_client as ac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Import_L42_C0", "label": "math import math", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.0733, 0.0017, 0, 0.66, 0.2258, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Import_L43_C0", "label": "numpy import np", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.075, 0.0017, 0, 0.66, 0.2581, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Import_L44_C0", "label": "sys import sys, time, os", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.0768, 0.0017, 0, 0.66, 0.2903, 509, 0, 3, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "time", "os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, time, os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Import_L45_C0", "label": "copy import copy", "type": "import", "loc": [45, 45], "level": 0, "parent": null, "vector": [1, 0, 0.0785, 0.0017, 0, 0.66, 0.3226, 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_99744:ImportFrom_L46_C0", "label": "from threading import RLock", "type": "import", "loc": [46, 46], "level": 0, "parent": null, "vector": [1, 0, 0.0803, 0.0017, 0, 0.66, 0.3548, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["RLock"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import RLock"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Import_L48_C0", "label": "arms import ar", "type": "import", "loc": [48, 48], "level": 0, "parent": null, "vector": [1, 0, 0.0838, 0.0017, 0, 0.66, 0.3871, 375, 0, 1, 0, 0, 375, 0, 0], "semantic": {"name": "arms", "arg_names": [], "import_names": ["ar"], "rhs_call_name": "", "annotation": ""}, "snippet": "import arms as ar"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Import_L49_C0", "label": "roslib import roslib", "type": "import", "loc": [49, 49], "level": 0, "parent": null, "vector": [1, 0, 0.0855, 0.0017, 0, 0.66, 0.4194, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('epc_core')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L49_C15", "label": "load_manifest()", "type": "expression", "loc": [49, 49], "level": 0, "parent": null, "vector": [8, 0, 0.0855, 0.0017, 0, 0.66, 0.4516, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('epc_core')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Import_L50_C0", "label": "rospy import rospy", "type": "import", "loc": [50, 50], "level": 0, "parent": null, "vector": [1, 0, 0.0873, 0.0017, 0, 0.66, 0.4839, 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_99744:Import_L52_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [52, 52], "level": 0, "parent": null, "vector": [1, 0, 0.0908, 0.0017, 0, 0.66, 0.5161, 82, 0, 1, 0, 0, 82, 0, 0], "semantic": {"name": "hrl_lib.transforms", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:ImportFrom_L53_C0", "label": "from hrl_msgs.msg import FloatArray", "type": "import", "loc": [53, 53], "level": 0, "parent": null, "vector": [1, 0, 0.0925, 0.0017, 0, 0.66, 0.5484, 513, 0, 1, 0, 0, 513, 0, 0], "semantic": {"name": "hrl_msgs.msg", "arg_names": [], "import_names": ["FloatArray"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_msgs.msg import FloatArray"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:ImportFrom_L54_C0", "label": "from roslib.msg import Header", "type": "import", "loc": [54, 54], "level": 0, "parent": null, "vector": [1, 0, 0.0942, 0.0017, 0, 0.66, 0.5806, 276, 0, 1, 0, 0, 276, 0, 0], "semantic": {"name": "roslib.msg", "arg_names": [], "import_names": ["Header"], "rhs_call_name": "", "annotation": ""}, "snippet": "from roslib.msg import Header"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:ImportFrom_L55_C0", "label": "from std_msgs.msg import Bool", "type": "import", "loc": [55, 55], "level": 0, "parent": null, "vector": [1, 0, 0.096, 0.0017, 0, 0.66, 0.6129, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Bool"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Bool"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:ImportFrom_L56_C0", "label": "from std_msgs.msg import Empty", "type": "import", "loc": [56, 56], "level": 0, "parent": null, "vector": [1, 0, 0.0977, 0.0017, 0, 0.66, 0.6452, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Empty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:ImportFrom_L57_C0", "label": "from std_srvs.srv import Empty_srv", "type": "import", "loc": [57, 57], "level": 0, "parent": null, "vector": [1, 0, 0.0995, 0.0017, 0, 0.66, 0.6774, 261, 0, 1, 0, 0, 261, 0, 0], "semantic": {"name": "std_srvs.srv", "arg_names": [], "import_names": ["Empty_srv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_srvs.srv import Empty as Empty_srv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:ImportFrom_L58_C0", "label": "from std_srvs.srv import EmptyResponse", "type": "import", "loc": [58, 58], "level": 0, "parent": null, "vector": [1, 0, 0.1012, 0.0017, 0, 0.66, 0.7097, 261, 0, 1, 0, 0, 261, 0, 0], "semantic": {"name": "std_srvs.srv", "arg_names": [], "import_names": ["EmptyResponse"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_srvs.srv import EmptyResponse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:ImportFrom_L59_C0", "label": "from sensor_msgs.msg import JointState", "type": "import", "loc": [59, 59], "level": 0, "parent": null, "vector": [1, 0, 0.103, 0.0017, 0, 0.66, 0.7419, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["JointState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import JointState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L61_C0", "label": "THETA_GC =", "type": "assigned_variable", "loc": [61, 61], "level": 0, "parent": null, "vector": [14, 0, 0.1065, 0.0017, 0, 0.66, 0.7742, 109, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "THETA_GC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THETA_GC = 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L62_C0", "label": "TORQUE_GC =", "type": "assigned_variable", "loc": [62, 62], "level": 0, "parent": null, "vector": [14, 0, 0.1082, 0.0017, 0, 0.66, 0.8065, 737, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "TORQUE_GC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TORQUE_GC = 4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L63_C0", "label": "THETA =", "type": "assigned_variable", "loc": [63, 63], "level": 0, "parent": null, "vector": [14, 0, 0.1099, 0.0017, 0, 0.66, 0.8387, 47, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "THETA", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THETA = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L64_C0", "label": "OFF =", "type": "assigned_variable", "loc": [64, 64], "level": 0, "parent": null, "vector": [14, 0, 0.1117, 0.0017, 0, 0.66, 0.871, 578, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "OFF", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "OFF = 0 # in OFF mode also, the behavior is strange. Not the same as hitting the estop (Advait, Jan 1 2010)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L68_C0", "label": "kalman_update", "type": "function", "loc": [68, 76], "level": 0, "parent": null, "vector": [2, 0, 0.1257, 0.0157, 0, 0.66, 0.9032, 73, 0, 5, 1, 0, 0, 0, 0], "semantic": {"name": "kalman_update", "arg_names": ["xhat", "P", "Q", "R", "z"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def kalman_update(xhat, P, Q, R, z):\n #time update\n xhatminus = xhat\n Pminus = P + Q\n #measurement update\n K = Pminus / (Pminus + R)\n xhat = xhatminus + K * (z-xhatminus)\n P = (1-K) * Pminus"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L70_C4", "label": "xhatminus =", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L68_C0", "vector": [14, 1, 0.1222, 0.0017, 1, 0.08, 0.0, 151, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xhatminus", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xhatminus = xhat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L71_C4", "label": "Pminus =", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L68_C0", "vector": [14, 1, 0.1239, 0.0017, 1, 0.08, 0.2, 965, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "Pminus", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " Pminus = P + Q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L73_C4", "label": "K =", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L68_C0", "vector": [14, 1, 0.1274, 0.0017, 1, 0.08, 0.4, 126, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "K", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " K = Pminus / (Pminus + R)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L74_C4", "label": "xhat =", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L68_C0", "vector": [14, 1, 0.1291, 0.0017, 1, 0.08, 0.6, 388, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xhat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xhat = xhatminus + K * (z-xhatminus)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L75_C4", "label": "P =", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L68_C0", "vector": [14, 1, 0.1309, 0.0017, 1, 0.08, 0.8, 707, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "P", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " P = (1-K) * Pminus"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Return_L76_C4", "label": "return", "type": "return", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L68_C0", "vector": [13, 1, 0.1326, 0.0017, 1, 0.08, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return xhat, P"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L78_C0", "label": "MekaArmSettings", "type": "class", "loc": [78, 91], "level": 0, "parent": null, "vector": [3, 0, 0.1475, 0.0244, 0, 0.66, 0.9355, 503, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "MekaArmSettings", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MekaArmSettings():\n def __init__(self, stiffness_list=[0.7,0.7,0.8,0.8,0.3],\n control_mode='theta_gc'):\n ''' stiffness_list: list of 5 stiffness values for joints 0-4.\n control_mode: 'theta_gc' or 'torque_gc'\n '''\n self.set_stiffness_scale(stiffness_list)\n self.control_mode = control_mode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L79_C4", "label": "__init__", "type": "function", "loc": [79, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L78_C0", "vector": [2, 1, 0.1431, 0.0122, 1, 0.38, 0.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "stiffness_list", "control_mode"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, stiffness_list=[0.7,0.7,0.8,0.8,0.3],\n control_mode='theta_gc'):\n ''' stiffness_list: list of 5 stiffness values for joints 0-4.\n control_mode: 'theta_gc' or 'torque_gc'\n '''\n self.set_stiffness_scale(stiffness_list)\n self.control_mode = control_mode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L81_C8", "label": "expression", "type": "expression", "loc": [81, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L79_C4", "vector": [8, 2, 0.1431, 0.0052, 2, 0.03, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' stiffness_list: list of 5 stiffness values for joints 0-4.\n control_mode: 'theta_gc' or 'torque_gc'\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L84_C8", "label": "set_stiffness_scale()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L79_C4", "vector": [8, 2, 0.1466, 0.0017, 2, 0.03, 0.5, 88, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_stiffness_scale", "arg_names": [], "import_names": [], "rhs_call_name": "set_stiffness_scale", "annotation": ""}, "snippet": " self.set_stiffness_scale(stiffness_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L85_C8", "label": "self.control_mode =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L79_C4", "vector": [14, 2, 0.1483, 0.0017, 2, 0.03, 1.0, 81, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.control_mode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.control_mode = control_mode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L87_C4", "label": "set_stiffness_scale", "type": "function", "loc": [87, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L78_C0", "vector": [2, 1, 0.1553, 0.0087, 1, 0.38, 1.0, 88, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_stiffness_scale", "arg_names": ["self", "l"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_stiffness_scale(self, l):\n # for safety of wrist roll. Advait Jun 18, 2010.\n # changed to 0.2 from 0.3 (Advait, Sept 19, 2010)\n l[4] = min(l[4], 0.2)\n self.stiffness_list = l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L90_C8", "label": " = min()", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L87_C4", "vector": [14, 2, 0.1571, 0.0017, 2, 0.45, 0.0, 0, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " l[4] = min(l[4], 0.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L91_C8", "label": "self.stiffness_list =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L87_C4", "vector": [14, 2, 0.1588, 0.0017, 2, 0.45, 1.0, 980, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.stiffness_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.stiffness_list = l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "label": "MekaArmServer", "type": "class", "loc": [94, 538], "level": 0, "parent": null, "vector": [3, 0, 0.5515, 0.7766, 0, 0.66, 0.9677, 388, 0, 25, 0, 0, 0, 0, 99], "semantic": {"name": "MekaArmServer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MekaArmServer():\n def __init__(self, right_arm_settings=None, left_arm_settings=None):\n self.arm_settings = {} # dict is set in set_arm_settings\n self.initialize_joints(right_arm_settings, left_arm_settings)\n\n #self.initialize_gripper()\n\n self.left_arm_ft = {'force': np.matrix(np.zeros((3,1),dtype='float32')),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "label": "__init__", "type": "function", "loc": [95, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.2234, 0.1169, 1, 0.0, 0.0, 555, 0, 3, 0, 0, 0, 0, 31], "semantic": {"name": "__init__", "arg_names": ["self", "right_arm_settings", "left_arm_settings"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, right_arm_settings=None, left_arm_settings=None):\n self.arm_settings = {} # dict is set in set_arm_settings\n self.initialize_joints(right_arm_settings, left_arm_settings)\n\n #self.initialize_gripper()\n\n self.left_arm_ft = {'force': np.matrix(np.zeros((3,1),dtype='float32')),\n 'torque': np.matrix(np.zeros((3,1),dtype='float32'))}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L96_C8", "label": "self.arm_settings =", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.1675, 0.0017, 2, 0.29, 0.0, 746, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.arm_settings", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_settings = {} # dict is set in set_arm_settings"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L97_C8", "label": "initialize_joints()", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [8, 2, 0.1693, 0.0017, 2, 0.29, 0.0238, 254, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "initialize_joints", "arg_names": [], "import_names": [], "rhs_call_name": "initialize_joints", "annotation": ""}, "snippet": " self.initialize_joints(right_arm_settings, left_arm_settings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L101_C8", "label": "self.left_arm_ft =", "type": "assigned_variable", "loc": [101, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.1771, 0.0035, 2, 0.29, 0.0476, 527, 0, 0, 0, 0, 0, 6, 4], "semantic": {"name": "self.left_arm_ft", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.left_arm_ft = {'force': np.matrix(np.zeros((3,1),dtype='float32')),\n 'torque': np.matrix(np.zeros((3,1),dtype='float32'))}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L103_C8", "label": "self.right_arm_ft =", "type": "assigned_variable", "loc": [103, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.1806, 0.0035, 2, 0.29, 0.0714, 452, 0, 0, 0, 0, 0, 6, 4], "semantic": {"name": "self.right_arm_ft", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_arm_ft = {'force': np.matrix(np.zeros((3,1),dtype='float32')),\n 'torque': np.matrix(np.zeros((3,1),dtype='float32'))}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L105_C8", "label": "self.fts_bias =", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.1832, 0.0017, 2, 0.29, 0.0952, 959, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.fts_bias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.fts_bias = {'left_arm': self.left_arm_ft, 'right_arm': self.right_arm_ft}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L108_C8", "label": "assign", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.1885, 0.0017, 2, 0.29, 0.119, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.Q_force, self.R_force = {}, {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L109_C8", "label": "assign", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.1902, 0.0017, 2, 0.29, 0.1429, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.xhat_force, self.P_force = {}, {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L111_C8", "label": "assign", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.1937, 0.0017, 2, 0.29, 0.1667, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.Q_force['right_arm'] = [1e-3, 1e-3, 1e-3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L112_C8", "label": "assign", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.1955, 0.0017, 2, 0.29, 0.1905, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.R_force['right_arm'] = [0.2**2, 0.2**2, 0.2**2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L113_C8", "label": "assign", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.1972, 0.0017, 2, 0.29, 0.2143, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.xhat_force['right_arm'] = [0., 0., 0.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L114_C8", "label": "assign", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.199, 0.0017, 2, 0.29, 0.2381, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.P_force['right_arm'] = [1.0, 1.0, 1.0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L116_C8", "label": "assign", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2024, 0.0017, 2, 0.29, 0.2619, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.Q_force['left_arm'] = [1e-3, 1e-3, 1e-3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L117_C8", "label": "assign", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2042, 0.0017, 2, 0.29, 0.2857, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.R_force['left_arm'] = [0.2**2, 0.2**2, 0.2**2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L118_C8", "label": "assign", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2059, 0.0017, 2, 0.29, 0.3095, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.xhat_force['left_arm'] = [0., 0., 0.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L119_C8", "label": "assign", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2077, 0.0017, 2, 0.29, 0.3333, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.P_force['left_arm'] = [1.0, 1.0, 1.0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L122_C8", "label": "init_node()", "type": "expression", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [8, 2, 0.2129, 0.0017, 2, 0.29, 0.3571, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('arm_server', anonymous=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L124_C8", "label": "Service()", "type": "expression", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [8, 2, 0.2164, 0.0017, 2, 0.29, 0.381, 451, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Service", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " rospy.Service('toggle_floating_arms', Empty_srv, self.floating_arms_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L125_C8", "label": "self.q_r_pub = Publisher()", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2182, 0.0017, 2, 0.29, 0.4048, 671, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.q_r_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.q_r_pub = rospy.Publisher('/r_arm/q', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L126_C8", "label": "self.q_l_pub = Publisher()", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2199, 0.0017, 2, 0.29, 0.4286, 268, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.q_l_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.q_l_pub = rospy.Publisher('/l_arm/q', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L128_C8", "label": "self.force_raw_r_pub = Publisher()", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2234, 0.0017, 2, 0.29, 0.4524, 512, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.force_raw_r_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.force_raw_r_pub = rospy.Publisher('/r_arm/force_raw', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L129_C8", "label": "self.force_raw_l_pub = Publisher()", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2251, 0.0017, 2, 0.29, 0.4762, 652, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.force_raw_l_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.force_raw_l_pub = rospy.Publisher('/l_arm/force_raw', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L130_C8", "label": "self.force_r_pub = Publisher()", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2269, 0.0017, 2, 0.29, 0.5, 353, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.force_r_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.force_r_pub = rospy.Publisher('/r_arm/force', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L131_C8", "label": "self.force_l_pub = Publisher()", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2286, 0.0017, 2, 0.29, 0.5238, 187, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.force_l_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.force_l_pub = rospy.Publisher('/l_arm/force', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L133_C8", "label": "self.jep_r_pub = Publisher()", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2321, 0.0017, 2, 0.29, 0.5476, 29, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.jep_r_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.jep_r_pub = rospy.Publisher('/r_arm/jep', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L134_C8", "label": "self.jep_l_pub = Publisher()", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2339, 0.0017, 2, 0.29, 0.5714, 176, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.jep_l_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.jep_l_pub = rospy.Publisher('/l_arm/jep', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L135_C8", "label": "self.alph_r_pub = Publisher()", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2356, 0.0017, 2, 0.29, 0.5952, 597, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.alph_r_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.alph_r_pub = rospy.Publisher('/r_arm/joint_impedance_scale', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L136_C8", "label": "self.alph_l_pub = Publisher()", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2373, 0.0017, 2, 0.29, 0.619, 96, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.alph_l_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.alph_l_pub = rospy.Publisher('/l_arm/joint_impedance_scale', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L138_C8", "label": "self.pwr_state_pub = Publisher()", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2408, 0.0017, 2, 0.29, 0.6429, 879, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.pwr_state_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.pwr_state_pub = rospy.Publisher('/arms/pwr_state', Bool)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L139_C8", "label": "self.joint_state_pub = Publisher()", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2426, 0.0017, 2, 0.29, 0.6667, 810, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.joint_state_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.joint_state_pub = rospy.Publisher('/joint_states', JointState)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L141_C8", "label": "Subscriber()", "type": "expression", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [8, 2, 0.2461, 0.0017, 2, 0.29, 0.6905, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/r_arm/command/jep', FloatArray, self.r_jep_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L142_C8", "label": "Subscriber()", "type": "expression", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [8, 2, 0.2478, 0.0017, 2, 0.29, 0.7143, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/l_arm/command/jep', FloatArray, self.l_jep_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L143_C8", "label": "Subscriber()", "type": "expression", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [8, 2, 0.2496, 0.0017, 2, 0.29, 0.7381, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/r_arm/command/joint_impedance_scale', FloatArray, self.r_alpha_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L144_C8", "label": "Subscriber()", "type": "expression", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [8, 2, 0.2513, 0.0017, 2, 0.29, 0.7619, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/l_arm/command/joint_impedance_scale', FloatArray, self.l_alpha_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L148_C8", "label": "Subscriber()", "type": "expression", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [8, 2, 0.2583, 0.0017, 2, 0.29, 0.7857, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/arms/stop', Empty, self.stop)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L149_C8", "label": "Subscriber()", "type": "expression", "loc": [149, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [8, 2, 0.2609, 0.0035, 2, 0.29, 0.8095, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/arms/command/motors_off', Empty,\n self.motors_off)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L152_C8", "label": "self.cb_lock = RLock()", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2653, 0.0017, 2, 0.29, 0.8333, 725, 3, 0, 0, 0, 207, 10, 1], "semantic": {"name": "self.cb_lock", "arg_names": [], "import_names": [], "rhs_call_name": "RLock", "annotation": ""}, "snippet": " self.cb_lock = RLock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L153_C8", "label": "self.r_jep =", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.267, 0.0017, 2, 0.29, 0.8571, 273, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.r_jep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_jep = None # see set_jep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L154_C8", "label": "self.l_jep =", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2688, 0.0017, 2, 0.29, 0.881, 912, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.l_jep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l_jep = None # see set_jep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L155_C8", "label": "self.qr_prev =", "type": "assigned_variable", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2705, 0.0017, 2, 0.29, 0.9048, 705, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.qr_prev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.qr_prev = None # see step_ros"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L156_C8", "label": "self.ql_prev =", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2723, 0.0017, 2, 0.29, 0.9286, 4, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.ql_prev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ql_prev = None # see step_ros"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L158_C8", "label": "self.joint_names_list = get_joint_name_dict()", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2757, 0.0017, 2, 0.29, 0.9524, 515, 3, 0, 0, 0, 823, 10, 1], "semantic": {"name": "self.joint_names_list", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_name_dict", "annotation": ""}, "snippet": " self.joint_names_list = ac.get_joint_name_dict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L160_C8", "label": "self.floating_arms =", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.2792, 0.0017, 2, 0.29, 0.9762, 537, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.floating_arms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.floating_arms = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L161_C8", "label": "self.floating_arms_counter =", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "vector": [14, 2, 0.281, 0.0017, 2, 0.29, 1.0, 601, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.floating_arms_counter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.floating_arms_counter = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L163_C4", "label": "floating_arms_cb", "type": "function", "loc": [163, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.288, 0.0087, 1, 0.0, 0.0417, 829, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "floating_arms_cb", "arg_names": ["self", "req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def floating_arms_cb(self, req):\n self.floating_arms_counter = 0\n self.floating_arms = not self.floating_arms\n #rospy.logout('floating_arms_cb called')\n return EmptyResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L164_C8", "label": "self.floating_arms_counter =", "type": "assigned_variable", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L163_C4", "vector": [14, 2, 0.2862, 0.0017, 2, 0.82, 0.0, 601, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.floating_arms_counter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.floating_arms_counter = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L165_C8", "label": "self.floating_arms =", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L163_C4", "vector": [14, 2, 0.288, 0.0017, 2, 0.82, 0.5, 537, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.floating_arms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.floating_arms = not self.floating_arms"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Return_L167_C8", "label": "return", "type": "return", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L163_C4", "vector": [13, 2, 0.2914, 0.0017, 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 EmptyResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L170_C4", "label": "set_arm_settings", "type": "function", "loc": [170, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.3316, 0.0716, 1, 0.0, 0.0833, 99, 0, 3, 0, 0, 0, 0, 20], "semantic": {"name": "set_arm_settings", "arg_names": ["self", "right_arm_settings", "left_arm_settings"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_arm_settings(self,right_arm_settings,left_arm_settings):\n self.arm_settings['right_arm'] = right_arm_settings\n self.arm_settings['left_arm'] = left_arm_settings\n\n for arm,arm_settings in zip(['right_arm','left_arm'],[right_arm_settings,left_arm_settings]):\n joint_component_list = self.joint_list_dict[arm]\n\n# OFF mode doesn't seem to work. (Advait, Jan 1 2010)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L171_C8", "label": "assign", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L170_C4", "vector": [14, 2, 0.2984, 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": " self.arm_settings['right_arm'] = right_arm_settings"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L172_C8", "label": "assign", "type": "assigned_variable", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L170_C4", "vector": [14, 2, 0.3002, 0.0017, 2, 0.54, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_settings['left_arm'] = left_arm_settings"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L174_C8", "label": "for arm, arm_settings", "type": "for", "loc": [174, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L170_C4", "vector": [6, 2, 0.3351, 0.0646, 2, 0.54, 1.0, 353, 3, 0, 0, 0, 0, 0, 20], "semantic": {"name": "arm, arm_settings", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for arm,arm_settings in zip(['right_arm','left_arm'],[right_arm_settings,left_arm_settings]):\n joint_component_list = self.joint_list_dict[arm]\n\n# OFF mode doesn't seem to work. (Advait, Jan 1 2010)\n if arm_settings == None:\n for c in joint_component_list:\n c.set_control_mode(OFF)\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L175_C12", "label": "joint_component_list =", "type": "assigned_variable", "loc": [175, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L174_C8", "vector": [14, 3, 0.3054, 0.0017, 3, 0.86, 0.0, 142, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "joint_component_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joint_component_list = self.joint_list_dict[arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L178_C12", "label": "if", "type": "if", "loc": [178, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L174_C8", "vector": [4, 3, 0.3133, 0.007, 3, 0.86, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm_settings == None:\n for c in joint_component_list:\n c.set_control_mode(OFF)\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L179_C16", "label": "for c", "type": "for", "loc": [179, 180], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L178_C12", "vector": [6, 4, 0.3133, 0.0035, 4, 0.31, 0.0, 411, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c in joint_component_list:\n c.set_control_mode(OFF)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L180_C20", "label": "set_control_mode()", "type": "expression", "loc": [180, 180], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L179_C16", "vector": [8, 5, 0.3141, 0.0017, 5, 0.73, 0.0, 552, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_control_mode", "arg_names": [], "import_names": [], "rhs_call_name": "set_control_mode", "annotation": ""}, "snippet": " c.set_control_mode(OFF)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L183_C12", "label": "stiffness_list =", "type": "assigned_variable", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L174_C8", "vector": [14, 3, 0.3194, 0.0017, 3, 0.86, 0.6667, 439, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stiffness_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stiffness_list = arm_settings.stiffness_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L185_C12", "label": "if", "type": "if", "loc": [185, 210], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L174_C8", "vector": [4, 3, 0.3447, 0.0454, 3, 0.86, 1.0, 0, 0, 0, 0, 0, 0, 0, 18], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm_settings.control_mode == 'torque_gc':\n print('setting control mode to torque_gc')\n for c in joint_component_list:\n c.set_control_mode(TORQUE_GC)\n c.set_torque_mNm(0.0)\n elif arm_settings.control_mode == 'theta_gc':\n print('setting control mode to theta_gc')\n for i in range(5):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L186_C16", "label": "print()", "type": "expression", "loc": [186, 186], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L185_C12", "vector": [8, 4, 0.3246, 0.0017, 4, 0.31, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('setting control mode to torque_gc')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L187_C16", "label": "for c", "type": "for", "loc": [187, 189], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L185_C12", "vector": [6, 4, 0.3281, 0.0052, 4, 0.31, 0.5, 411, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c in joint_component_list:\n c.set_control_mode(TORQUE_GC)\n c.set_torque_mNm(0.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L188_C20", "label": "set_control_mode()", "type": "expression", "loc": [188, 188], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L187_C16", "vector": [8, 5, 0.3281, 0.0017, 5, 0.88, 0.0, 552, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_control_mode", "arg_names": [], "import_names": [], "rhs_call_name": "set_control_mode", "annotation": ""}, "snippet": " c.set_control_mode(TORQUE_GC)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L189_C20", "label": "set_torque_mNm()", "type": "expression", "loc": [189, 189], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L187_C16", "vector": [8, 5, 0.3298, 0.0017, 5, 0.88, 1.0, 722, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_torque_mNm", "arg_names": [], "import_names": [], "rhs_call_name": "set_torque_mNm", "annotation": ""}, "snippet": " c.set_torque_mNm(0.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L190_C12", "label": "if", "type": "if", "loc": [190, 210], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L185_C12", "vector": [4, 4, 0.349, 0.0366, 4, 0.31, 1.0, 0, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif arm_settings.control_mode == 'theta_gc':\n print('setting control mode to theta_gc')\n for i in range(5):\n joint_component_list[i].set_control_mode(THETA_GC)\n joint_component_list[i].set_stiffness(stiffness_list[i])\n joint_component_list[i].set_slew_rate_proportion(1.)\n\n joint_component_list[5].set_control_mode(THETA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L191_C16", "label": "print()", "type": "expression", "loc": [191, 191], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L190_C12", "vector": [8, 5, 0.3333, 0.0017, 5, 0.62, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('setting control mode to theta_gc')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L192_C16", "label": "for i", "type": "for", "loc": [192, 195], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L190_C12", "vector": [6, 5, 0.3377, 0.007, 5, 0.62, 0.1667, 826, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(5):\n joint_component_list[i].set_control_mode(THETA_GC)\n joint_component_list[i].set_stiffness(stiffness_list[i])\n joint_component_list[i].set_slew_rate_proportion(1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L193_C20", "label": "set_control_mode()", "type": "expression", "loc": [193, 193], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L192_C16", "vector": [8, 6, 0.3368, 0.0017, 6, 0.76, 0.0, 552, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_control_mode", "arg_names": [], "import_names": [], "rhs_call_name": "set_control_mode", "annotation": ""}, "snippet": " joint_component_list[i].set_control_mode(THETA_GC)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L194_C20", "label": "set_stiffness()", "type": "expression", "loc": [194, 194], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L192_C16", "vector": [8, 6, 0.3386, 0.0017, 6, 0.76, 0.5, 418, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_stiffness", "arg_names": [], "import_names": [], "rhs_call_name": "set_stiffness", "annotation": ""}, "snippet": " joint_component_list[i].set_stiffness(stiffness_list[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L195_C20", "label": "set_slew_rate_proportion()", "type": "expression", "loc": [195, 195], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L192_C16", "vector": [8, 6, 0.3403, 0.0017, 6, 0.76, 1.0, 645, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_slew_rate_proportion", "arg_names": [], "import_names": [], "rhs_call_name": "set_slew_rate_proportion", "annotation": ""}, "snippet": " joint_component_list[i].set_slew_rate_proportion(1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L197_C16", "label": "set_control_mode()", "type": "expression", "loc": [197, 197], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L190_C12", "vector": [8, 5, 0.3438, 0.0017, 5, 0.62, 0.3333, 552, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_control_mode", "arg_names": [], "import_names": [], "rhs_call_name": "set_control_mode", "annotation": ""}, "snippet": " joint_component_list[5].set_control_mode(THETA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L198_C16", "label": "set_slew_rate_proportion()", "type": "expression", "loc": [198, 198], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L190_C12", "vector": [8, 5, 0.3455, 0.0017, 5, 0.62, 0.5, 645, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_slew_rate_proportion", "arg_names": [], "import_names": [], "rhs_call_name": "set_slew_rate_proportion", "annotation": ""}, "snippet": " joint_component_list[5].set_slew_rate_proportion(1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L199_C16", "label": "set_control_mode()", "type": "expression", "loc": [199, 199], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L190_C12", "vector": [8, 5, 0.3473, 0.0017, 5, 0.62, 0.6667, 552, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_control_mode", "arg_names": [], "import_names": [], "rhs_call_name": "set_control_mode", "annotation": ""}, "snippet": " joint_component_list[6].set_control_mode(THETA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L200_C16", "label": "set_slew_rate_proportion()", "type": "expression", "loc": [200, 200], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L190_C12", "vector": [8, 5, 0.349, 0.0017, 5, 0.62, 0.8333, 645, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_slew_rate_proportion", "arg_names": [], "import_names": [], "rhs_call_name": "set_slew_rate_proportion", "annotation": ""}, "snippet": " joint_component_list[6].set_slew_rate_proportion(1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L202_C12", "label": "if", "type": "if", "loc": [202, 210], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L190_C12", "vector": [4, 5, 0.3595, 0.0157, 5, 0.62, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif arm_settings.control_mode == 'wrist_theta_gc':\n print('setting control mode to theta_gc include wrist joints')\n for i in range(7):\n joint_component_list[i].set_control_mode(THETA_GC)\n joint_component_list[i].set_stiffness(stiffness_list[i])\n joint_component_list[i].set_slew_rate_proportion(1.)\n\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L203_C16", "label": "print()", "type": "expression", "loc": [203, 203], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L202_C12", "vector": [8, 6, 0.3543, 0.0017, 6, 0.64, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('setting control mode to theta_gc include wrist joints')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L204_C16", "label": "for i", "type": "for", "loc": [204, 207], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L202_C12", "vector": [6, 6, 0.3586, 0.007, 6, 0.64, 0.5, 826, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(7):\n joint_component_list[i].set_control_mode(THETA_GC)\n joint_component_list[i].set_stiffness(stiffness_list[i])\n joint_component_list[i].set_slew_rate_proportion(1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L205_C20", "label": "set_control_mode()", "type": "expression", "loc": [205, 205], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L204_C16", "vector": [8, 7, 0.3578, 0.0017, 7, 0.76, 0.0, 552, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_control_mode", "arg_names": [], "import_names": [], "rhs_call_name": "set_control_mode", "annotation": ""}, "snippet": " joint_component_list[i].set_control_mode(THETA_GC)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L206_C20", "label": "set_stiffness()", "type": "expression", "loc": [206, 206], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L204_C16", "vector": [8, 7, 0.3595, 0.0017, 7, 0.76, 0.5, 418, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_stiffness", "arg_names": [], "import_names": [], "rhs_call_name": "set_stiffness", "annotation": ""}, "snippet": " joint_component_list[i].set_stiffness(stiffness_list[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L207_C20", "label": "set_slew_rate_proportion()", "type": "expression", "loc": [207, 207], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L204_C16", "vector": [8, 7, 0.3613, 0.0017, 7, 0.76, 1.0, 645, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_slew_rate_proportion", "arg_names": [], "import_names": [], "rhs_call_name": "set_slew_rate_proportion", "annotation": ""}, "snippet": " joint_component_list[i].set_slew_rate_proportion(1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L210_C16", "label": "print()", "type": "expression", "loc": [210, 210], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L202_C12", "vector": [8, 6, 0.3665, 0.0017, 6, 0.64, 1.0, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('hrl_robot.initialize_joints. unknown control mode for ', arm,':', arm_settings.control_mode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L214_C4", "label": "safeop_things", "type": "function", "loc": [214, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.3813, 0.0175, 1, 0.0, 0.125, 898, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "safeop_things", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def safeop_things(self):\n robot_name = 'm3humanoid_bimanual_mr1'\n chain_names = ['m3arm_ma1', 'm3arm_ma2']\n dynamatics_nms = ['m3dynamatics_ma1', 'm3dynamatics_ma2']\n\n self.proxy.make_safe_operational(robot_name)\n for c in chain_names:\n self.proxy.make_safe_operational(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L215_C8", "label": "robot_name =", "type": "assigned_variable", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L214_C4", "vector": [14, 2, 0.3752, 0.0017, 2, 0.54, 0.0, 868, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "robot_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " robot_name = 'm3humanoid_bimanual_mr1'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L216_C8", "label": "chain_names =", "type": "assigned_variable", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L214_C4", "vector": [14, 2, 0.377, 0.0017, 2, 0.54, 0.2, 304, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "chain_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " chain_names = ['m3arm_ma1', 'm3arm_ma2']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L217_C8", "label": "dynamatics_nms =", "type": "assigned_variable", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L214_C4", "vector": [14, 2, 0.3787, 0.0017, 2, 0.54, 0.4, 860, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "dynamatics_nms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dynamatics_nms = ['m3dynamatics_ma1', 'm3dynamatics_ma2']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L219_C8", "label": "make_safe_operational()", "type": "expression", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L214_C4", "vector": [8, 2, 0.3822, 0.0017, 2, 0.54, 0.6, 545, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "make_safe_operational", "arg_names": [], "import_names": [], "rhs_call_name": "make_safe_operational", "annotation": ""}, "snippet": " self.proxy.make_safe_operational(robot_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L220_C8", "label": "for c", "type": "for", "loc": [220, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L214_C4", "vector": [6, 2, 0.3848, 0.0035, 2, 0.54, 0.8, 411, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c in chain_names:\n self.proxy.make_safe_operational(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L221_C12", "label": "make_safe_operational()", "type": "expression", "loc": [221, 221], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L220_C8", "vector": [8, 3, 0.3857, 0.0017, 3, 0.65, 0.0, 545, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "make_safe_operational", "arg_names": [], "import_names": [], "rhs_call_name": "make_safe_operational", "annotation": ""}, "snippet": " self.proxy.make_safe_operational(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L222_C8", "label": "for d", "type": "for", "loc": [222, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L214_C4", "vector": [6, 2, 0.3883, 0.0035, 2, 0.54, 1.0, 355, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for d in dynamatics_nms:\n self.proxy.make_safe_operational(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L223_C12", "label": "make_safe_operational()", "type": "expression", "loc": [223, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L222_C8", "vector": [8, 3, 0.3892, 0.0017, 3, 0.78, 0.0, 545, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "make_safe_operational", "arg_names": [], "import_names": [], "rhs_call_name": "make_safe_operational", "annotation": ""}, "snippet": " self.proxy.make_safe_operational(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "label": "initialize_joints", "type": "function", "loc": [225, 283], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.4433, 0.103, 1, 0.0, 0.1667, 254, 0, 3, 0, 0, 0, 0, 29], "semantic": {"name": "initialize_joints", "arg_names": ["self", "right_arm_settings", "left_arm_settings"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def initialize_joints(self, right_arm_settings, left_arm_settings):\n self.proxy = m3p.M3RtProxy()\n self.proxy.start()\n for c in ['m3pwr_pwr003','m3loadx6_ma1_l0','m3arm_ma1','m3loadx6_ma2_l0','m3arm_ma2']:\n if not self.proxy.is_component_available(c):\n raise m3t.M3Exception('Component '+c+' is not available.')\n \n self.joint_list_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L226_C8", "label": "self.proxy = M3RtProxy()", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [14, 2, 0.3944, 0.0017, 2, 0.07, 0.0, 837, 3, 0, 0, 0, 238, 10, 1], "semantic": {"name": "self.proxy", "arg_names": [], "import_names": [], "rhs_call_name": "M3RtProxy", "annotation": ""}, "snippet": " self.proxy = m3p.M3RtProxy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L227_C8", "label": "start()", "type": "expression", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [8, 2, 0.3962, 0.0017, 2, 0.07, 0.0385, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.proxy.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L228_C8", "label": "for c", "type": "for", "loc": [228, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [6, 2, 0.3997, 0.0052, 2, 0.07, 0.0769, 411, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c in ['m3pwr_pwr003','m3loadx6_ma1_l0','m3arm_ma1','m3loadx6_ma2_l0','m3arm_ma2']:\n if not self.proxy.is_component_available(c):\n raise m3t.M3Exception('Component '+c+' is not available.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L229_C12", "label": "if", "type": "if", "loc": [229, 230], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L228_C8", "vector": [4, 3, 0.4005, 0.0035, 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.proxy.is_component_available(c):\n raise m3t.M3Exception('Component '+c+' is not available.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L232_C8", "label": "self.joint_list_dict =", "type": "assigned_variable", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [14, 2, 0.4049, 0.0017, 2, 0.07, 0.1154, 776, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.joint_list_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_list_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L234_C8", "label": "right_l =", "type": "assigned_variable", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [14, 2, 0.4084, 0.0017, 2, 0.07, 0.1538, 912, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "right_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " right_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L235_C8", "label": "for c", "type": "for", "loc": [235, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [6, 2, 0.4145, 0.0105, 2, 0.07, 0.1923, 411, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c in ['m3joint_ma1_j0','m3joint_ma1_j1','m3joint_ma1_j2',\n 'm3joint_ma1_j3','m3joint_ma1_j4','m3joint_ma1_j5',\n 'm3joint_ma1_j6']:\n if not self.proxy.is_component_available(c):\n raise m3t.M3Exception('Component '+c+' is not available.')\n right_l.append(m3f.create_component(c))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L238_C12", "label": "if", "type": "if", "loc": [238, 239], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L235_C8", "vector": [4, 3, 0.4162, 0.0035, 3, 0.96, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.proxy.is_component_available(c):\n raise m3t.M3Exception('Component '+c+' is not available.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L240_C12", "label": "append()", "type": "expression", "loc": [240, 240], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L235_C8", "vector": [8, 3, 0.4188, 0.0017, 3, 0.96, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " right_l.append(m3f.create_component(c))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L241_C8", "label": "assign", "type": "assigned_variable", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [14, 2, 0.4206, 0.0017, 2, 0.07, 0.2308, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_list_dict['right_arm'] = right_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L243_C8", "label": "left_l =", "type": "assigned_variable", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [14, 2, 0.4241, 0.0017, 2, 0.07, 0.2692, 321, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "left_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L244_C8", "label": "for c", "type": "for", "loc": [244, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [6, 2, 0.4302, 0.0105, 2, 0.07, 0.3077, 411, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c in ['m3joint_ma2_j0','m3joint_ma2_j1','m3joint_ma2_j2',\n 'm3joint_ma2_j3','m3joint_ma2_j4','m3joint_ma2_j5',\n 'm3joint_ma2_j6']:\n if not self.proxy.is_component_available(c):\n raise m3t.M3Exception('Component '+c+' is not available.')\n left_l.append(m3f.create_component(c))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L247_C12", "label": "if", "type": "if", "loc": [247, 248], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L244_C8", "vector": [4, 3, 0.4319, 0.0035, 3, 0.72, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.proxy.is_component_available(c):\n raise m3t.M3Exception('Component '+c+' is not available.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L249_C12", "label": "append()", "type": "expression", "loc": [249, 249], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L244_C8", "vector": [8, 3, 0.4346, 0.0017, 3, 0.72, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " left_l.append(m3f.create_component(c))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L250_C8", "label": "assign", "type": "assigned_variable", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [14, 2, 0.4363, 0.0017, 2, 0.07, 0.3462, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_list_dict['left_arm'] = left_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L253_C8", "label": "for arm, arm_settings", "type": "for", "loc": [253, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [6, 2, 0.4468, 0.0122, 2, 0.07, 0.3846, 353, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "arm, arm_settings", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for arm,arm_settings in zip(['right_arm','left_arm'],[right_arm_settings,left_arm_settings]):\n if arm_settings == None:\n continue\n\n for comp in self.joint_list_dict[arm]:\n self.proxy.subscribe_status(comp)\n self.proxy.publish_command(comp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L254_C12", "label": "if", "type": "if", "loc": [254, 255], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L253_C8", "vector": [4, 3, 0.4442, 0.0035, 3, 0.96, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm_settings == None:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L257_C12", "label": "for comp", "type": "for", "loc": [257, 259], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L253_C8", "vector": [6, 3, 0.4503, 0.0052, 3, 0.96, 1.0, 913, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "comp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for comp in self.joint_list_dict[arm]:\n self.proxy.subscribe_status(comp)\n self.proxy.publish_command(comp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L258_C16", "label": "subscribe_status()", "type": "expression", "loc": [258, 258], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L257_C12", "vector": [8, 4, 0.4503, 0.0017, 4, 0.72, 0.0, 321, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subscribe_status", "arg_names": [], "import_names": [], "rhs_call_name": "subscribe_status", "annotation": ""}, "snippet": " self.proxy.subscribe_status(comp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L259_C16", "label": "publish_command()", "type": "expression", "loc": [259, 259], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L257_C12", "vector": [8, 4, 0.452, 0.0017, 4, 0.72, 1.0, 611, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish_command", "arg_names": [], "import_names": [], "rhs_call_name": "publish_command", "annotation": ""}, "snippet": " self.proxy.publish_command(comp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L261_C8", "label": "set_arm_settings()", "type": "expression", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [8, 2, 0.4555, 0.0017, 2, 0.07, 0.4231, 99, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_arm_settings", "arg_names": [], "import_names": [], "rhs_call_name": "set_arm_settings", "annotation": ""}, "snippet": " self.set_arm_settings(right_arm_settings,left_arm_settings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L263_C8", "label": "right_fts = M3LoadX6()", "type": "assigned_variable", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [14, 2, 0.459, 0.0017, 2, 0.07, 0.4615, 777, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "right_fts", "arg_names": [], "import_names": [], "rhs_call_name": "M3LoadX6", "annotation": ""}, "snippet": " right_fts=m3.loadx6.M3LoadX6('m3loadx6_ma1_l0')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L264_C8", "label": "subscribe_status()", "type": "expression", "loc": [264, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [8, 2, 0.4607, 0.0017, 2, 0.07, 0.5, 321, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subscribe_status", "arg_names": [], "import_names": [], "rhs_call_name": "subscribe_status", "annotation": ""}, "snippet": " self.proxy.subscribe_status(right_fts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L265_C8", "label": "left_fts = M3LoadX6()", "type": "assigned_variable", "loc": [265, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [14, 2, 0.4625, 0.0017, 2, 0.07, 0.5385, 428, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "left_fts", "arg_names": [], "import_names": [], "rhs_call_name": "M3LoadX6", "annotation": ""}, "snippet": " left_fts=m3.loadx6.M3LoadX6('m3loadx6_ma2_l0')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L266_C8", "label": "subscribe_status()", "type": "expression", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [8, 2, 0.4642, 0.0017, 2, 0.07, 0.5769, 321, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subscribe_status", "arg_names": [], "import_names": [], "rhs_call_name": "subscribe_status", "annotation": ""}, "snippet": " self.proxy.subscribe_status(left_fts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L268_C8", "label": "self.fts =", "type": "assigned_variable", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [14, 2, 0.4677, 0.0017, 2, 0.07, 0.6154, 675, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.fts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.fts = {'right_arm':right_fts,'left_arm':left_fts}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L271_C8", "label": "self.pwr = create_component()", "type": "assigned_variable", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [14, 2, 0.4729, 0.0017, 2, 0.07, 0.6538, 4, 3, 1, 0, 0, 585, 10, 1], "semantic": {"name": "self.pwr", "arg_names": [], "import_names": [], "rhs_call_name": "create_component", "annotation": ""}, "snippet": " self.pwr=m3f.create_component('m3pwr_pwr003')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L272_C8", "label": "subscribe_status()", "type": "expression", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [8, 2, 0.4747, 0.0017, 2, 0.07, 0.6923, 321, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subscribe_status", "arg_names": [], "import_names": [], "rhs_call_name": "subscribe_status", "annotation": ""}, "snippet": " self.proxy.subscribe_status(self.pwr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L273_C8", "label": "publish_command()", "type": "expression", "loc": [273, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [8, 2, 0.4764, 0.0017, 2, 0.07, 0.7308, 611, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish_command", "arg_names": [], "import_names": [], "rhs_call_name": "publish_command", "annotation": ""}, "snippet": " self.proxy.publish_command(self.pwr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L275_C8", "label": "self.arms =", "type": "assigned_variable", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [14, 2, 0.4799, 0.0017, 2, 0.07, 0.7692, 495, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.arms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arms = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L276_C8", "label": " = M3Arm()", "type": "assigned_variable", "loc": [276, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [14, 2, 0.4817, 0.0017, 2, 0.07, 0.8077, 0, 3, 1, 0, 0, 811, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "M3Arm", "annotation": ""}, "snippet": " self.arms['right_arm']=m3.arm.M3Arm('m3arm_ma1')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L277_C8", "label": "subscribe_status()", "type": "expression", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [8, 2, 0.4834, 0.0017, 2, 0.07, 0.8462, 321, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subscribe_status", "arg_names": [], "import_names": [], "rhs_call_name": "subscribe_status", "annotation": ""}, "snippet": " self.proxy.subscribe_status(self.arms['right_arm'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L279_C8", "label": " = M3Arm()", "type": "assigned_variable", "loc": [279, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [14, 2, 0.4869, 0.0017, 2, 0.07, 0.8846, 0, 3, 1, 0, 0, 811, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "M3Arm", "annotation": ""}, "snippet": " self.arms['left_arm']=m3.arm.M3Arm('m3arm_ma2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L280_C8", "label": "subscribe_status()", "type": "expression", "loc": [280, 280], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [8, 2, 0.4887, 0.0017, 2, 0.07, 0.9231, 321, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subscribe_status", "arg_names": [], "import_names": [], "rhs_call_name": "subscribe_status", "annotation": ""}, "snippet": " self.proxy.subscribe_status(self.arms['left_arm'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L282_C8", "label": "step()", "type": "expression", "loc": [282, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [8, 2, 0.4921, 0.0017, 2, 0.07, 0.9615, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " self.proxy.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L283_C8", "label": "step()", "type": "expression", "loc": [283, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "vector": [8, 2, 0.4939, 0.0017, 2, 0.07, 1.0, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " self.proxy.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L285_C4", "label": "initialize_gripper", "type": "function", "loc": [285, 289], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.5009, 0.0087, 1, 0.0, 0.2083, 45, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "initialize_gripper", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def initialize_gripper(self):\n #self.right_gripper = m3h.M3Gripper('m3gripper_mg0')\n self.right_gripper = m3h.M3Gripper('m3gripper_mg1')\n self.proxy.publish_command(self.right_gripper)\n self.proxy.subscribe_status(self.right_gripper)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L287_C8", "label": "self.right_gripper = M3Gripper()", "type": "assigned_variable", "loc": [287, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L285_C4", "vector": [14, 2, 0.5009, 0.0017, 2, 0.97, 0.0, 855, 3, 1, 0, 0, 117, 10, 1], "semantic": {"name": "self.right_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "M3Gripper", "annotation": ""}, "snippet": " self.right_gripper = m3h.M3Gripper('m3gripper_mg1')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L288_C8", "label": "publish_command()", "type": "expression", "loc": [288, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L285_C4", "vector": [8, 2, 0.5026, 0.0017, 2, 0.97, 0.5, 611, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish_command", "arg_names": [], "import_names": [], "rhs_call_name": "publish_command", "annotation": ""}, "snippet": " self.proxy.publish_command(self.right_gripper)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L289_C8", "label": "subscribe_status()", "type": "expression", "loc": [289, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L285_C4", "vector": [8, 2, 0.5044, 0.0017, 2, 0.97, 1.0, 321, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subscribe_status", "arg_names": [], "import_names": [], "rhs_call_name": "subscribe_status", "annotation": ""}, "snippet": " self.proxy.subscribe_status(self.right_gripper)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L291_C4", "label": "step", "type": "function", "loc": [291, 306], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.5209, 0.0279, 1, 0.0, 0.25, 880, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "step", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def step(self):\n self.proxy.step()\n for arm in ['left_arm', 'right_arm']:\n z = self.get_wrist_force(arm).A1 # Force vector\n #if arm == 'right_arm':\n # z = self.get_wrist_force_nano().A1\n\n for i in range(3):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L292_C8", "label": "step()", "type": "expression", "loc": [292, 292], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L291_C4", "vector": [8, 2, 0.5096, 0.0017, 2, 0.5, 0.0, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " self.proxy.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L293_C8", "label": "for arm", "type": "for", "loc": [293, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L291_C4", "vector": [6, 2, 0.5227, 0.0244, 2, 0.5, 1.0, 413, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for arm in ['left_arm', 'right_arm']:\n z = self.get_wrist_force(arm).A1 # Force vector\n #if arm == 'right_arm':\n # z = self.get_wrist_force_nano().A1\n\n for i in range(3):\n xhat, p = kalman_update(self.xhat_force[arm][i],\n self.P_force[arm][i],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L294_C12", "label": "z =", "type": "assigned_variable", "loc": [294, 294], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L293_C8", "vector": [14, 3, 0.5131, 0.0017, 3, 0.94, 0.0, 859, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = self.get_wrist_force(arm).A1 # Force vector"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L298_C12", "label": "for i", "type": "for", "loc": [298, 306], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L293_C8", "vector": [6, 3, 0.5271, 0.0157, 3, 0.94, 1.0, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(3):\n xhat, p = kalman_update(self.xhat_force[arm][i],\n self.P_force[arm][i],\n self.Q_force[arm][i],\n self.R_force[arm][i], z[i])\n if abs(z[i] - self.xhat_force[arm][i]) > 3.:\n xhat = z[i] # not filtering step changes.\n self.xhat_force[arm][i] = xhat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L299_C16", "label": "xhat, p = kalman_update()", "type": "assigned_variable", "loc": [299, 302], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L298_C12", "vector": [14, 4, 0.5244, 0.007, 4, 0.61, 0.0, 22, 3, 5, 0, 0, 73, 10, 1], "semantic": {"name": "xhat, p", "arg_names": [], "import_names": [], "rhs_call_name": "kalman_update", "annotation": ""}, "snippet": " xhat, p = kalman_update(self.xhat_force[arm][i],\n self.P_force[arm][i],\n self.Q_force[arm][i],\n self.R_force[arm][i], z[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L303_C16", "label": "if", "type": "if", "loc": [303, 304], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L298_C12", "vector": [4, 4, 0.5297, 0.0035, 4, 0.61, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if abs(z[i] - self.xhat_force[arm][i]) > 3.:\n xhat = z[i] # not filtering step changes."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L304_C20", "label": "xhat =", "type": "assigned_variable", "loc": [304, 304], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L303_C16", "vector": [14, 5, 0.5305, 0.0017, 5, 0.46, 0.0, 388, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xhat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xhat = z[i] # not filtering step changes."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L305_C16", "label": "assign", "type": "assigned_variable", "loc": [305, 305], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L298_C12", "vector": [14, 4, 0.5323, 0.0017, 4, 0.61, 0.6667, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.xhat_force[arm][i] = xhat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L306_C16", "label": "assign", "type": "assigned_variable", "loc": [306, 306], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L298_C12", "vector": [14, 4, 0.534, 0.0017, 4, 0.61, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.P_force[arm][i] = p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "label": "step_ros", "type": "function", "loc": [308, 399], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.6169, 0.1606, 1, 0.0, 0.2917, 188, 0, 1, 0, 0, 0, 0, 72], "semantic": {"name": "step_ros", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def step_ros(self):\n r_arm = 'right_arm'\n l_arm = 'left_arm'\n\n self.cb_lock.acquire()\n r_jep = copy.copy(self.r_jep)\n l_jep = copy.copy(self.l_jep)\n r_alpha = copy.copy(self.arm_settings['right_arm'].stiffness_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L309_C8", "label": "r_arm =", "type": "assigned_variable", "loc": [309, 309], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [14, 2, 0.5393, 0.0017, 2, 0.19, 0.0, 315, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "r_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_arm = 'right_arm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L310_C8", "label": "l_arm =", "type": "assigned_variable", "loc": [310, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [14, 2, 0.541, 0.0017, 2, 0.19, 0.0244, 657, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "l_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l_arm = 'left_arm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L312_C8", "label": "acquire()", "type": "expression", "loc": [312, 312], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [8, 2, 0.5445, 0.0017, 2, 0.19, 0.0488, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L313_C8", "label": "r_jep = copy()", "type": "assigned_variable", "loc": [313, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [14, 2, 0.5462, 0.0017, 2, 0.19, 0.0732, 4, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "r_jep", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " r_jep = copy.copy(self.r_jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L314_C8", "label": "l_jep = copy()", "type": "assigned_variable", "loc": [314, 314], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [14, 2, 0.548, 0.0017, 2, 0.19, 0.0976, 105, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "l_jep", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " l_jep = copy.copy(self.l_jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L315_C8", "label": "r_alpha = copy()", "type": "assigned_variable", "loc": [315, 315], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [14, 2, 0.5497, 0.0017, 2, 0.19, 0.122, 894, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "r_alpha", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " r_alpha = copy.copy(self.arm_settings['right_arm'].stiffness_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L316_C8", "label": "l_alpha = copy()", "type": "assigned_variable", "loc": [316, 316], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [14, 2, 0.5515, 0.0017, 2, 0.19, 0.1463, 79, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "l_alpha", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " l_alpha = copy.copy(self.arm_settings['left_arm'].stiffness_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L317_C8", "label": "release()", "type": "expression", "loc": [317, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [8, 2, 0.5532, 0.0017, 2, 0.19, 0.1707, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L319_C8", "label": "set_jep()", "type": "expression", "loc": [319, 319], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [8, 2, 0.5567, 0.0017, 2, 0.19, 0.1951, 799, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_jep", "arg_names": [], "import_names": [], "rhs_call_name": "set_jep", "annotation": ""}, "snippet": " self.set_jep(r_arm, r_jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L320_C8", "label": "set_jep()", "type": "expression", "loc": [320, 320], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [8, 2, 0.5585, 0.0017, 2, 0.19, 0.2195, 799, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_jep", "arg_names": [], "import_names": [], "rhs_call_name": "set_jep", "annotation": ""}, "snippet": " self.set_jep(l_arm, l_jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L321_C8", "label": "set_alpha()", "type": "expression", "loc": [321, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [8, 2, 0.5602, 0.0017, 2, 0.19, 0.2439, 133, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_alpha", "arg_names": [], "import_names": [], "rhs_call_name": "set_alpha", "annotation": ""}, "snippet": " self.set_alpha(r_arm, r_alpha)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L322_C8", "label": "set_alpha()", "type": "expression", "loc": [322, 322], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [8, 2, 0.562, 0.0017, 2, 0.19, 0.2683, 133, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_alpha", "arg_names": [], "import_names": [], "rhs_call_name": "set_alpha", "annotation": ""}, "snippet": " self.set_alpha(l_arm, l_alpha)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L324_C8", "label": "step()", "type": "expression", "loc": [324, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [8, 2, 0.5654, 0.0017, 2, 0.19, 0.2927, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " self.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L326_C8", "label": "motor_pwr_state = is_motor_power_on()", "type": "assigned_variable", "loc": [326, 326], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [14, 2, 0.5689, 0.0017, 2, 0.19, 0.3171, 748, 3, 0, 0, 0, 123, 10, 1], "semantic": {"name": "motor_pwr_state", "arg_names": [], "import_names": [], "rhs_call_name": "is_motor_power_on", "annotation": ""}, "snippet": " motor_pwr_state = self.is_motor_power_on()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L328_C8", "label": "if", "type": "if", "loc": [328, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [4, 2, 0.5733, 0.0035, 2, 0.19, 0.3415, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not motor_pwr_state:\n self.maintain_configuration()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L329_C12", "label": "maintain_configuration()", "type": "expression", "loc": [329, 329], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L328_C8", "vector": [8, 3, 0.5742, 0.0017, 3, 0.85, 0.0, 171, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "maintain_configuration", "arg_names": [], "import_names": [], "rhs_call_name": "maintain_configuration", "annotation": ""}, "snippet": " self.maintain_configuration()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L331_C8", "label": "q_r = get_joint_angles()", "type": "assigned_variable", "loc": [331, 331], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [14, 2, 0.5777, 0.0017, 2, 0.19, 0.3659, 126, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "q_r", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " q_r = self.get_joint_angles(r_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L332_C8", "label": "q_l = get_joint_angles()", "type": "assigned_variable", "loc": [332, 332], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [14, 2, 0.5794, 0.0017, 2, 0.19, 0.3902, 649, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "q_l", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " q_l = self.get_joint_angles(l_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L334_C8", "label": "if", "type": "if", "loc": [334, 364], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [4, 2, 0.6091, 0.0541, 2, 0.19, 0.4146, 0, 7, 0, 0, 0, 0, 0, 23], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.floating_arms:\n if self.qr_prev == None or self.floating_arms_counter < 100:\n self.qr_prev = q_r\n self.ql_prev = q_l\n self.floating_arms_counter += 1\n else:\n tol = np.radians([5., 2., 10., 2., 10., 0.03, 0.6])\n r_arr = np.array(q_r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "label": "if", "type": "if", "loc": [335, 364], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L334_C8", "vector": [4, 3, 0.6099, 0.0524, 3, 0.42, 0.0, 0, 0, 0, 0, 0, 0, 0, 23], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.qr_prev == None or self.floating_arms_counter < 100:\n self.qr_prev = q_r\n self.ql_prev = q_l\n self.floating_arms_counter += 1\n else:\n tol = np.radians([5., 2., 10., 2., 10., 0.03, 0.6])\n r_arr = np.array(q_r)\n l_arr = np.array(q_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L336_C16", "label": "self.qr_prev =", "type": "assigned_variable", "loc": [336, 336], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [14, 4, 0.5864, 0.0017, 4, 0.52, 0.0, 705, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.qr_prev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.qr_prev = q_r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L337_C16", "label": "self.ql_prev =", "type": "assigned_variable", "loc": [337, 337], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [14, 4, 0.5881, 0.0017, 4, 0.52, 0.0455, 4, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.ql_prev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ql_prev = q_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L340_C16", "label": "tol = radians()", "type": "assigned_variable", "loc": [340, 340], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [14, 4, 0.5934, 0.0017, 4, 0.52, 0.0909, 422, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "tol", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " tol = np.radians([5., 2., 10., 2., 10., 0.03, 0.6])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L341_C16", "label": "r_arr = array()", "type": "assigned_variable", "loc": [341, 341], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [14, 4, 0.5951, 0.0017, 4, 0.52, 0.1364, 600, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "r_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " r_arr = np.array(q_r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L342_C16", "label": "l_arr = array()", "type": "assigned_variable", "loc": [342, 342], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [14, 4, 0.5969, 0.0017, 4, 0.52, 0.1818, 493, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "l_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " l_arr = np.array(q_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L343_C16", "label": "prev_r_arr = array()", "type": "assigned_variable", "loc": [343, 343], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [14, 4, 0.5986, 0.0017, 4, 0.52, 0.2273, 442, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "prev_r_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " prev_r_arr = np.array(self.qr_prev)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L344_C16", "label": "prev_l_arr = array()", "type": "assigned_variable", "loc": [344, 344], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [14, 4, 0.6003, 0.0017, 4, 0.52, 0.2727, 476, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "prev_l_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " prev_l_arr = np.array(self.ql_prev)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L346_C16", "label": "dqr =", "type": "assigned_variable", "loc": [346, 346], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [14, 4, 0.6038, 0.0017, 4, 0.52, 0.3182, 714, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "dqr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dqr = np.array(q_r) - np.array(prev_r_arr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L347_C16", "label": "dql =", "type": "assigned_variable", "loc": [347, 347], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [14, 4, 0.6056, 0.0017, 4, 0.52, 0.3636, 753, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "dql", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dql = np.array(q_l) - np.array(prev_l_arr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L348_C16", "label": "dqr =", "type": "assigned_variable", "loc": [348, 348], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [14, 4, 0.6073, 0.0017, 4, 0.52, 0.4091, 714, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dqr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dqr = dqr * (np.abs(dqr) > tol)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L349_C16", "label": "dql =", "type": "assigned_variable", "loc": [349, 349], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [14, 4, 0.6091, 0.0017, 4, 0.52, 0.4545, 753, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dql", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dql = dql * (np.abs(dql) > tol)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L351_C16", "label": "r_jep = tolist()", "type": "assigned_variable", "loc": [351, 351], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [14, 4, 0.6126, 0.0017, 4, 0.52, 0.5, 4, 3, 0, 0, 0, 185, 10, 2], "semantic": {"name": "r_jep", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " r_jep = (np.array(r_jep) + dqr).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L352_C16", "label": "l_jep = tolist()", "type": "assigned_variable", "loc": [352, 352], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [14, 4, 0.6143, 0.0017, 4, 0.52, 0.5455, 105, 3, 0, 0, 0, 185, 10, 2], "semantic": {"name": "l_jep", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " l_jep = (np.array(l_jep) + dql).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L354_C16", "label": "acquire()", "type": "expression", "loc": [354, 354], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [8, 4, 0.6178, 0.0017, 4, 0.52, 0.5909, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L355_C16", "label": "self.r_jep = copy()", "type": "assigned_variable", "loc": [355, 355], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [14, 4, 0.6195, 0.0017, 4, 0.52, 0.6364, 273, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.r_jep", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.r_jep = copy.copy(r_jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L356_C16", "label": "self.l_jep = copy()", "type": "assigned_variable", "loc": [356, 356], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [14, 4, 0.6213, 0.0017, 4, 0.52, 0.6818, 912, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.l_jep", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.l_jep = copy.copy(l_jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L357_C16", "label": "release()", "type": "expression", "loc": [357, 357], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [8, 4, 0.623, 0.0017, 4, 0.52, 0.7273, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L359_C16", "label": "change_idxs = where()", "type": "assigned_variable", "loc": [359, 359], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [14, 4, 0.6265, 0.0017, 4, 0.52, 0.7727, 460, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "change_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " change_idxs = np.where(dqr != 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L360_C16", "label": "assign", "type": "assigned_variable", "loc": [360, 360], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [14, 4, 0.6283, 0.0017, 4, 0.52, 0.8182, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prev_r_arr[change_idxs] = r_arr[change_idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L361_C16", "label": "change_idxs = where()", "type": "assigned_variable", "loc": [361, 361], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [14, 4, 0.63, 0.0017, 4, 0.52, 0.8636, 460, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "change_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " change_idxs = np.where(dql != 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L362_C16", "label": "assign", "type": "assigned_variable", "loc": [362, 362], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [14, 4, 0.6318, 0.0017, 4, 0.52, 0.9091, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prev_l_arr[change_idxs] = l_arr[change_idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L363_C16", "label": "self.qr_prev = tolist()", "type": "assigned_variable", "loc": [363, 363], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [14, 4, 0.6335, 0.0017, 4, 0.52, 0.9545, 705, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "self.qr_prev", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " self.qr_prev = prev_r_arr.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L364_C16", "label": "self.ql_prev = tolist()", "type": "assigned_variable", "loc": [364, 364], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "vector": [14, 4, 0.6353, 0.0017, 4, 0.52, 1.0, 4, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "self.ql_prev", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " self.ql_prev = prev_l_arr.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L366_C8", "label": "f_raw_r = tolist()", "type": "assigned_variable", "loc": [366, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [14, 2, 0.6387, 0.0017, 2, 0.19, 0.439, 443, 3, 0, 0, 0, 185, 10, 2], "semantic": {"name": "f_raw_r", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " f_raw_r = self.get_wrist_force(r_arm).A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L367_C8", "label": "f_raw_l = tolist()", "type": "assigned_variable", "loc": [367, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [14, 2, 0.6405, 0.0017, 2, 0.19, 0.4634, 795, 3, 0, 0, 0, 185, 10, 2], "semantic": {"name": "f_raw_l", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " f_raw_l = self.get_wrist_force(l_arm).A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L368_C8", "label": "f_r =", "type": "assigned_variable", "loc": [368, 368], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [14, 2, 0.6422, 0.0017, 2, 0.19, 0.4878, 885, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f_r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_r = self.xhat_force[r_arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L369_C8", "label": "f_l =", "type": "assigned_variable", "loc": [369, 369], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [14, 2, 0.644, 0.0017, 2, 0.19, 0.5122, 265, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_l = self.xhat_force[l_arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L372_C8", "label": "time_stamp = now()", "type": "assigned_variable", "loc": [372, 372], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [14, 2, 0.6492, 0.0017, 2, 0.19, 0.5366, 156, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "time_stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " time_stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L373_C8", "label": "h = Header()", "type": "assigned_variable", "loc": [373, 373], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [14, 2, 0.651, 0.0017, 2, 0.19, 0.561, 686, 3, 0, 0, 0, 976, 10, 1], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "Header", "annotation": ""}, "snippet": " h = Header()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L374_C8", "label": "h.stamp =", "type": "assigned_variable", "loc": [374, 374], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [14, 2, 0.6527, 0.0017, 2, 0.19, 0.5854, 57, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "h.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h.stamp = time_stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L376_C8", "label": "publish()", "type": "expression", "loc": [376, 376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [8, 2, 0.6562, 0.0017, 2, 0.19, 0.6098, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.q_r_pub.publish(FloatArray(h, q_r))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L377_C8", "label": "publish()", "type": "expression", "loc": [377, 377], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [8, 2, 0.6579, 0.0017, 2, 0.19, 0.6341, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.q_l_pub.publish(FloatArray(h, q_l))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L379_C8", "label": "publish()", "type": "expression", "loc": [379, 379], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [8, 2, 0.6614, 0.0017, 2, 0.19, 0.6585, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.jep_r_pub.publish(FloatArray(h, r_jep))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L380_C8", "label": "publish()", "type": "expression", "loc": [380, 380], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [8, 2, 0.6632, 0.0017, 2, 0.19, 0.6829, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.jep_l_pub.publish(FloatArray(h, l_jep))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L382_C8", "label": "publish()", "type": "expression", "loc": [382, 382], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [8, 2, 0.6667, 0.0017, 2, 0.19, 0.7073, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.alph_r_pub.publish(FloatArray(h, r_alpha))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L383_C8", "label": "publish()", "type": "expression", "loc": [383, 383], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [8, 2, 0.6684, 0.0017, 2, 0.19, 0.7317, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.alph_l_pub.publish(FloatArray(h, l_alpha))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L385_C8", "label": "h.frame_id =", "type": "assigned_variable", "loc": [385, 385], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [14, 2, 0.6719, 0.0017, 2, 0.19, 0.7561, 54, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "h.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h.frame_id = '/torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L386_C8", "label": "nms =", "type": "assigned_variable", "loc": [386, 386], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [14, 2, 0.6736, 0.0017, 2, 0.19, 0.7805, 550, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "nms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nms = self.joint_names_list['right_arm'] + self.joint_names_list['left_arm']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L387_C8", "label": "pos =", "type": "assigned_variable", "loc": [387, 387], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [14, 2, 0.6754, 0.0017, 2, 0.19, 0.8049, 627, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = q_r + q_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L388_C8", "label": "publish()", "type": "expression", "loc": [388, 389], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [8, 2, 0.678, 0.0035, 2, 0.19, 0.8293, 102, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.joint_state_pub.publish(JointState(h, nms, pos,\n [0.]*len(pos), [0.]*len(pos)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L391_C8", "label": "h.frame_id = link_tf_name()", "type": "assigned_variable", "loc": [391, 391], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [14, 2, 0.6824, 0.0017, 2, 0.19, 0.8537, 54, 3, 2, 0, 0, 958, 10, 1], "semantic": {"name": "h.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "link_tf_name", "annotation": ""}, "snippet": " h.frame_id = ar.link_tf_name(r_arm, 7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L392_C8", "label": "publish()", "type": "expression", "loc": [392, 392], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [8, 2, 0.6841, 0.0017, 2, 0.19, 0.878, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.force_raw_r_pub.publish(FloatArray(h, f_raw_r))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L393_C8", "label": "publish()", "type": "expression", "loc": [393, 393], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [8, 2, 0.6859, 0.0017, 2, 0.19, 0.9024, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.force_r_pub.publish(FloatArray(h, f_r))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L395_C8", "label": "h.frame_id = link_tf_name()", "type": "assigned_variable", "loc": [395, 395], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [14, 2, 0.6894, 0.0017, 2, 0.19, 0.9268, 54, 3, 2, 0, 0, 958, 10, 1], "semantic": {"name": "h.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "link_tf_name", "annotation": ""}, "snippet": " h.frame_id = ar.link_tf_name(l_arm, 7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L396_C8", "label": "publish()", "type": "expression", "loc": [396, 396], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [8, 2, 0.6911, 0.0017, 2, 0.19, 0.9512, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.force_raw_l_pub.publish(FloatArray(h, f_raw_l))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L397_C8", "label": "publish()", "type": "expression", "loc": [397, 397], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [8, 2, 0.6928, 0.0017, 2, 0.19, 0.9756, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.force_l_pub.publish(FloatArray(h, f_l))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L399_C8", "label": "publish()", "type": "expression", "loc": [399, 399], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "vector": [8, 2, 0.6963, 0.0017, 2, 0.19, 1.0, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.pwr_state_pub.publish(Bool(motor_pwr_state))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L401_C4", "label": "is_motor_power_on", "type": "function", "loc": [401, 402], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.7007, 0.0035, 1, 0.0, 0.3333, 123, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "is_motor_power_on", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_motor_power_on(self):\n return self.pwr.is_motor_power_on(None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Return_L402_C8", "label": "return", "type": "return", "loc": [402, 402], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L401_C4", "vector": [13, 2, 0.7016, 0.0017, 2, 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.pwr.is_motor_power_on(None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L409_C4", "label": "motors_off", "type": "function", "loc": [409, 410], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.7147, 0.0035, 1, 0.0, 0.375, 881, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "motors_off", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def motors_off(self, msg=None):\n self.pwr.set_motor_power_off()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L410_C8", "label": "set_motor_power_off()", "type": "expression", "loc": [410, 410], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L409_C4", "vector": [8, 2, 0.7155, 0.0017, 2, 0.73, 0.0, 269, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_motor_power_off", "arg_names": [], "import_names": [], "rhs_call_name": "set_motor_power_off", "annotation": ""}, "snippet": " self.pwr.set_motor_power_off()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L412_C4", "label": "motors_on", "type": "function", "loc": [412, 416], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.7225, 0.0087, 1, 0.0, 0.4167, 466, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "motors_on", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def motors_on(self):\n self.maintain_configuration()\n self.pwr.set_motor_power_on()\n self.step()\n self.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L413_C8", "label": "maintain_configuration()", "type": "expression", "loc": [413, 413], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L412_C4", "vector": [8, 2, 0.7208, 0.0017, 2, 0.31, 0.0, 171, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "maintain_configuration", "arg_names": [], "import_names": [], "rhs_call_name": "maintain_configuration", "annotation": ""}, "snippet": " self.maintain_configuration()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L414_C8", "label": "set_motor_power_on()", "type": "expression", "loc": [414, 414], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L412_C4", "vector": [8, 2, 0.7225, 0.0017, 2, 0.31, 0.3333, 777, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_motor_power_on", "arg_names": [], "import_names": [], "rhs_call_name": "set_motor_power_on", "annotation": ""}, "snippet": " self.pwr.set_motor_power_on()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L415_C8", "label": "step()", "type": "expression", "loc": [415, 415], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L412_C4", "vector": [8, 2, 0.7243, 0.0017, 2, 0.31, 0.6667, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " self.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L416_C8", "label": "step()", "type": "expression", "loc": [416, 416], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L412_C4", "vector": [8, 2, 0.726, 0.0017, 2, 0.31, 1.0, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " self.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L418_C4", "label": "maintain_configuration", "type": "function", "loc": [418, 431], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.7408, 0.0244, 1, 0.0, 0.4583, 171, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "maintain_configuration", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def maintain_configuration(self):\n for arm in ['right_arm','left_arm']:\n q = self.get_joint_angles(arm)\n if self.arm_settings[arm] == None:\n continue\n if 'theta_gc' not in self.arm_settings[arm].control_mode:\n raise RuntimeError('bad control mode: %s', self.arm_settings[arm].control_mode)\n self.set_jep(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L419_C8", "label": "for arm", "type": "for", "loc": [419, 431], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L418_C4", "vector": [6, 2, 0.7417, 0.0227, 2, 0.92, 0.0, 413, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for arm in ['right_arm','left_arm']:\n q = self.get_joint_angles(arm)\n if self.arm_settings[arm] == None:\n continue\n if 'theta_gc' not in self.arm_settings[arm].control_mode:\n raise RuntimeError('bad control mode: %s', self.arm_settings[arm].control_mode)\n self.set_jep(arm, q)\n self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L420_C12", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [420, 420], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L419_C8", "vector": [14, 3, 0.733, 0.0017, 3, 0.24, 0.0, 516, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " q = self.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L421_C12", "label": "if", "type": "if", "loc": [421, 422], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L419_C8", "vector": [4, 3, 0.7356, 0.0035, 3, 0.24, 0.1667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.arm_settings[arm] == None:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L423_C12", "label": "if", "type": "if", "loc": [423, 424], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L419_C8", "vector": [4, 3, 0.7391, 0.0035, 3, 0.24, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'theta_gc' not in self.arm_settings[arm].control_mode:\n raise RuntimeError('bad control mode: %s', self.arm_settings[arm].control_mode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L425_C12", "label": "set_jep()", "type": "expression", "loc": [425, 425], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L419_C8", "vector": [8, 3, 0.7417, 0.0017, 3, 0.24, 0.5, 799, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_jep", "arg_names": [], "import_names": [], "rhs_call_name": "set_jep", "annotation": ""}, "snippet": " self.set_jep(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L426_C12", "label": "acquire()", "type": "expression", "loc": [426, 426], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L419_C8", "vector": [8, 3, 0.7435, 0.0017, 3, 0.24, 0.6667, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L427_C12", "label": "if", "type": "if", "loc": [427, 430], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L419_C8", "vector": [4, 3, 0.7478, 0.007, 3, 0.24, 0.8333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'right_arm':\n self.r_jep = q\n else:\n self.l_jep = q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L428_C16", "label": "self.r_jep =", "type": "assigned_variable", "loc": [428, 428], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L427_C12", "vector": [14, 4, 0.7469, 0.0017, 4, 0.98, 0.0, 273, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.r_jep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_jep = q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L430_C16", "label": "self.l_jep =", "type": "assigned_variable", "loc": [430, 430], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L427_C12", "vector": [14, 4, 0.7504, 0.0017, 4, 0.98, 1.0, 912, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.l_jep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l_jep = q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L431_C12", "label": "release()", "type": "expression", "loc": [431, 431], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L419_C8", "vector": [8, 3, 0.7522, 0.0017, 3, 0.24, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L433_C4", "label": "power_on", "type": "function", "loc": [433, 439], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.7609, 0.0122, 1, 0.0, 0.5, 777, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "power_on", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def power_on(self):\n self.maintain_configuration()\n self.proxy.make_operational_all()\n self.safeop_things()\n self.pwr.set_motor_power_on()\n self.step()\n self.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L434_C8", "label": "maintain_configuration()", "type": "expression", "loc": [434, 434], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L433_C4", "vector": [8, 2, 0.7574, 0.0017, 2, 0.33, 0.0, 171, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "maintain_configuration", "arg_names": [], "import_names": [], "rhs_call_name": "maintain_configuration", "annotation": ""}, "snippet": " self.maintain_configuration()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L435_C8", "label": "make_operational_all()", "type": "expression", "loc": [435, 435], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L433_C4", "vector": [8, 2, 0.7592, 0.0017, 2, 0.33, 0.2, 283, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "make_operational_all", "arg_names": [], "import_names": [], "rhs_call_name": "make_operational_all", "annotation": ""}, "snippet": " self.proxy.make_operational_all()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L436_C8", "label": "safeop_things()", "type": "expression", "loc": [436, 436], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L433_C4", "vector": [8, 2, 0.7609, 0.0017, 2, 0.33, 0.4, 898, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "safeop_things", "arg_names": [], "import_names": [], "rhs_call_name": "safeop_things", "annotation": ""}, "snippet": " self.safeop_things()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L437_C8", "label": "set_motor_power_on()", "type": "expression", "loc": [437, 437], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L433_C4", "vector": [8, 2, 0.7627, 0.0017, 2, 0.33, 0.6, 777, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_motor_power_on", "arg_names": [], "import_names": [], "rhs_call_name": "set_motor_power_on", "annotation": ""}, "snippet": " self.pwr.set_motor_power_on()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L438_C8", "label": "step()", "type": "expression", "loc": [438, 438], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L433_C4", "vector": [8, 2, 0.7644, 0.0017, 2, 0.33, 0.8, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " self.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L439_C8", "label": "step()", "type": "expression", "loc": [439, 439], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L433_C4", "vector": [8, 2, 0.7661, 0.0017, 2, 0.33, 1.0, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " self.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L441_C4", "label": "stop", "type": "function", "loc": [441, 444], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.7723, 0.007, 1, 0.0, 0.5417, 343, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "stop", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop(self, msg=None):\n self.pwr.set_motor_power_off()\n self.step()\n self.proxy.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L442_C8", "label": "set_motor_power_off()", "type": "expression", "loc": [442, 442], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L441_C4", "vector": [8, 2, 0.7714, 0.0017, 2, 0.7, 0.0, 269, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_motor_power_off", "arg_names": [], "import_names": [], "rhs_call_name": "set_motor_power_off", "annotation": ""}, "snippet": " self.pwr.set_motor_power_off()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L443_C8", "label": "step()", "type": "expression", "loc": [443, 443], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L441_C4", "vector": [8, 2, 0.7731, 0.0017, 2, 0.7, 0.5, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " self.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L444_C8", "label": "stop()", "type": "expression", "loc": [444, 444], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L441_C4", "vector": [8, 2, 0.7749, 0.0017, 2, 0.7, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " self.proxy.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L453_C4", "label": "get_wrist_force", "type": "function", "loc": [453, 462], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.7984, 0.0175, 1, 0.0, 0.5833, 854, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "get_wrist_force", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_wrist_force(self, arm):\n m = []\n lc = self.fts[arm]\n m.append(lc.get_Fx_mN()/1000.)\n m.append(lc.get_Fy_mN()/1000.)\n m.append(-lc.get_Fz_mN()/1000.) \n m = tr.Rz(math.radians(-30.0))*np.matrix(m).T\n m[1,0] = -m[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L454_C8", "label": "m =", "type": "assigned_variable", "loc": [454, 454], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L453_C4", "vector": [14, 2, 0.7923, 0.0017, 2, 0.2, 0.0, 711, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L455_C8", "label": "lc =", "type": "assigned_variable", "loc": [455, 455], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L453_C4", "vector": [14, 2, 0.7941, 0.0017, 2, 0.2, 0.125, 255, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lc = self.fts[arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L456_C8", "label": "append()", "type": "expression", "loc": [456, 456], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L453_C4", "vector": [8, 2, 0.7958, 0.0017, 2, 0.2, 0.25, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " m.append(lc.get_Fx_mN()/1000.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L457_C8", "label": "append()", "type": "expression", "loc": [457, 457], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L453_C4", "vector": [8, 2, 0.7976, 0.0017, 2, 0.2, 0.375, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " m.append(lc.get_Fy_mN()/1000.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L458_C8", "label": "append()", "type": "expression", "loc": [458, 458], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L453_C4", "vector": [8, 2, 0.7993, 0.0017, 2, 0.2, 0.5, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " m.append(-lc.get_Fz_mN()/1000.) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L459_C8", "label": "m =", "type": "assigned_variable", "loc": [459, 459], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L453_C4", "vector": [14, 2, 0.801, 0.0017, 2, 0.2, 0.625, 711, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m = tr.Rz(math.radians(-30.0))*np.matrix(m).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L460_C8", "label": "assign", "type": "assigned_variable", "loc": [460, 460], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L453_C4", "vector": [14, 2, 0.8028, 0.0017, 2, 0.2, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m[1,0] = -m[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L461_C8", "label": "assign", "type": "assigned_variable", "loc": [461, 461], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L453_C4", "vector": [14, 2, 0.8045, 0.0017, 2, 0.2, 0.875, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m[2,0] = -m[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Return_L462_C8", "label": "return", "type": "return", "loc": [462, 462], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L453_C4", "vector": [13, 2, 0.8063, 0.0017, 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 m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L464_C4", "label": "get_wrist_force_nano", "type": "function", "loc": [464, 468], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.8133, 0.0087, 1, 0.0, 0.625, 203, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "get_wrist_force_nano", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_wrist_force_nano(self):\n f = self.r_arm_ftc.read()[0:3, :]\n f = tr.Rz(math.radians(-60.)) * f\n f[1,0] = f[1,0] * -1\n return f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L465_C8", "label": "f =", "type": "assigned_variable", "loc": [465, 465], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L464_C4", "vector": [14, 2, 0.8115, 0.0017, 2, 0.08, 0.0, 899, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = self.r_arm_ftc.read()[0:3, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L466_C8", "label": "f =", "type": "assigned_variable", "loc": [466, 466], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L464_C4", "vector": [14, 2, 0.8133, 0.0017, 2, 0.08, 0.3333, 899, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = tr.Rz(math.radians(-60.)) * f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L467_C8", "label": "assign", "type": "assigned_variable", "loc": [467, 467], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L464_C4", "vector": [14, 2, 0.815, 0.0017, 2, 0.08, 0.6667, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f[1,0] = f[1,0] * -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Return_L468_C8", "label": "return", "type": "return", "loc": [468, 468], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L464_C4", "vector": [13, 2, 0.8168, 0.0017, 2, 0.08, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L477_C4", "label": "get_joint_accelerations", "type": "function", "loc": [477, 478], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.8333, 0.0035, 1, 0.0, 0.6667, 8, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_joint_accelerations", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_joint_accelerations(self, arm):\n return self.arms[arm].get_thetadotdot_rad().tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Return_L478_C8", "label": "return", "type": "return", "loc": [478, 478], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L477_C4", "vector": [13, 2, 0.8342, 0.0017, 2, 0.02, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.arms[arm].get_thetadotdot_rad().tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L484_C4", "label": "get_joint_velocities", "type": "function", "loc": [484, 485], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.8455, 0.0035, 1, 0.0, 0.7083, 27, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_joint_velocities", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_joint_velocities(self, arm):\n return self.arms[arm].get_thetadot_rad().tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Return_L485_C8", "label": "return", "type": "return", "loc": [485, 485], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L484_C4", "vector": [13, 2, 0.8464, 0.0017, 2, 0.12, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.arms[arm].get_thetadot_rad().tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L487_C4", "label": "get_joint_angles", "type": "function", "loc": [487, 491], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.8534, 0.0087, 1, 0.0, 0.75, 820, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_joint_angles", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_joint_angles(self, arm):\n ''' returns list of 7 joint angles in RADIANS.\n according to meka's coordinate frames.\n '''\n return self.arms[arm].get_theta_rad().tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L488_C8", "label": "expression", "type": "expression", "loc": [488, 490], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L487_C4", "vector": [8, 2, 0.8534, 0.0052, 2, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' returns list of 7 joint angles in RADIANS.\n according to meka's coordinate frames.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Return_L491_C8", "label": "return", "type": "return", "loc": [491, 491], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L487_C4", "vector": [13, 2, 0.8569, 0.0017, 2, 0.93, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.arms[arm].get_theta_rad().tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L493_C4", "label": "l_jep_cb", "type": "function", "loc": [493, 496], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.863, 0.007, 1, 0.0, 0.7917, 44, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "l_jep_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def l_jep_cb(self, msg):\n self.cb_lock.acquire()\n self.l_jep = msg.data\n self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L494_C8", "label": "acquire()", "type": "expression", "loc": [494, 494], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L493_C4", "vector": [8, 2, 0.8621, 0.0017, 2, 0.32, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L495_C8", "label": "self.l_jep =", "type": "assigned_variable", "loc": [495, 495], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L493_C4", "vector": [14, 2, 0.8639, 0.0017, 2, 0.32, 0.5, 912, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.l_jep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l_jep = msg.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L496_C8", "label": "release()", "type": "expression", "loc": [496, 496], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L493_C4", "vector": [8, 2, 0.8656, 0.0017, 2, 0.32, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L498_C4", "label": "r_jep_cb", "type": "function", "loc": [498, 501], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.8717, 0.007, 1, 0.0, 0.8333, 278, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "r_jep_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def r_jep_cb(self, msg):\n self.cb_lock.acquire()\n self.r_jep = msg.data\n self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L499_C8", "label": "acquire()", "type": "expression", "loc": [499, 499], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L498_C4", "vector": [8, 2, 0.8709, 0.0017, 2, 0.22, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L500_C8", "label": "self.r_jep =", "type": "assigned_variable", "loc": [500, 500], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L498_C4", "vector": [14, 2, 0.8726, 0.0017, 2, 0.22, 0.5, 273, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.r_jep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_jep = msg.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L501_C8", "label": "release()", "type": "expression", "loc": [501, 501], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L498_C4", "vector": [8, 2, 0.8743, 0.0017, 2, 0.22, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L505_C4", "label": "set_jep", "type": "function", "loc": [505, 523], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.897, 0.0332, 1, 0.0, 0.875, 799, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "set_jep", "arg_names": ["self", "arm", "q"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_jep(self, arm, q):\n if self.arm_settings[arm] == None:\n return\n if self.arm_settings[arm].control_mode != 'theta_gc' and \\\n self.arm_settings[arm].control_mode != 'wrist_theta_gc':\n raise RuntimeError('Bad control mode: %s'%(self.arm_settings[arm].control_mode))\n\n for i,qi in enumerate(q):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L506_C8", "label": "if", "type": "if", "loc": [506, 507], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L505_C4", "vector": [4, 2, 0.8839, 0.0035, 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 self.arm_settings[arm] == None:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Return_L507_C12", "label": "return", "type": "return", "loc": [507, 507], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L506_C8", "vector": [13, 3, 0.8848, 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": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L508_C8", "label": "if", "type": "if", "loc": [508, 510], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L505_C4", "vector": [4, 2, 0.8883, 0.0052, 2, 0.84, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.arm_settings[arm].control_mode != 'theta_gc' and \\\n self.arm_settings[arm].control_mode != 'wrist_theta_gc':\n raise RuntimeError('Bad control mode: %s'%(self.arm_settings[arm].control_mode))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L512_C8", "label": "for i, qi", "type": "for", "loc": [512, 516], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L505_C4", "vector": [6, 2, 0.897, 0.0087, 2, 0.84, 0.4, 636, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i, qi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,qi in enumerate(q):\n ## NOTE - meka's set_theta_deg takes angle in radians.\n #self.joint_list_dict[arm][i].set_theta_deg(qi)\n # Not anymore. (Advait Aug 27, 2009)\n self.joint_list_dict[arm][i].set_theta_rad(qi)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L516_C12", "label": "set_theta_rad()", "type": "expression", "loc": [516, 516], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L512_C8", "vector": [8, 3, 0.9005, 0.0017, 3, 0.88, 0.0, 274, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_theta_rad", "arg_names": [], "import_names": [], "rhs_call_name": "set_theta_rad", "annotation": ""}, "snippet": " self.joint_list_dict[arm][i].set_theta_rad(qi)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L518_C8", "label": "acquire()", "type": "expression", "loc": [518, 518], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L505_C4", "vector": [8, 2, 0.904, 0.0017, 2, 0.84, 0.6, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L519_C8", "label": "if", "type": "if", "loc": [519, 522], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L505_C4", "vector": [4, 2, 0.9084, 0.007, 2, 0.84, 0.8, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'right_arm':\n self.r_jep = q\n else:\n self.l_jep = q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L520_C12", "label": "self.r_jep =", "type": "assigned_variable", "loc": [520, 520], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L519_C8", "vector": [14, 3, 0.9075, 0.0017, 3, 0.91, 0.0, 273, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.r_jep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_jep = q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L522_C12", "label": "self.l_jep =", "type": "assigned_variable", "loc": [522, 522], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L519_C8", "vector": [14, 3, 0.911, 0.0017, 3, 0.91, 1.0, 912, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.l_jep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l_jep = q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L523_C8", "label": "release()", "type": "expression", "loc": [523, 523], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L505_C4", "vector": [8, 2, 0.9127, 0.0017, 2, 0.84, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L525_C4", "label": "r_alpha_cb", "type": "function", "loc": [525, 528], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.9188, 0.007, 1, 0.0, 0.9167, 13, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "r_alpha_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def r_alpha_cb(self, msg):\n self.cb_lock.acquire()\n self.arm_settings['right_arm'].set_stiffness_scale(list(msg.data))\n self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L526_C8", "label": "acquire()", "type": "expression", "loc": [526, 526], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L525_C4", "vector": [8, 2, 0.918, 0.0017, 2, 0.51, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L527_C8", "label": "set_stiffness_scale()", "type": "expression", "loc": [527, 527], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L525_C4", "vector": [8, 2, 0.9197, 0.0017, 2, 0.51, 0.5, 88, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_stiffness_scale", "arg_names": [], "import_names": [], "rhs_call_name": "set_stiffness_scale", "annotation": ""}, "snippet": " self.arm_settings['right_arm'].set_stiffness_scale(list(msg.data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L528_C8", "label": "release()", "type": "expression", "loc": [528, 528], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L525_C4", "vector": [8, 2, 0.9215, 0.0017, 2, 0.51, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L530_C4", "label": "l_alpha_cb", "type": "function", "loc": [530, 533], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.9276, 0.007, 1, 0.0, 0.9583, 476, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "l_alpha_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def l_alpha_cb(self, msg):\n self.cb_lock.acquire()\n self.arm_settings['left_arm'].set_stiffness_scale(list(msg.data))\n self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L531_C8", "label": "acquire()", "type": "expression", "loc": [531, 531], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L530_C4", "vector": [8, 2, 0.9267, 0.0017, 2, 0.82, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L532_C8", "label": "set_stiffness_scale()", "type": "expression", "loc": [532, 532], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L530_C4", "vector": [8, 2, 0.9284, 0.0017, 2, 0.82, 0.5, 88, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_stiffness_scale", "arg_names": [], "import_names": [], "rhs_call_name": "set_stiffness_scale", "annotation": ""}, "snippet": " self.arm_settings['left_arm'].set_stiffness_scale(list(msg.data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L533_C8", "label": "release()", "type": "expression", "loc": [533, 533], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L530_C4", "vector": [8, 2, 0.9302, 0.0017, 2, 0.82, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L535_C4", "label": "set_alpha", "type": "function", "loc": [535, 538], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "vector": [2, 1, 0.9363, 0.007, 1, 0.0, 1.0, 133, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "set_alpha", "arg_names": ["self", "arm", "alpha"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_alpha(self, arm, alpha):\n jcl = self.joint_list_dict[arm]\n for i,a in enumerate(alpha):\n jcl[i].set_stiffness(a)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L536_C8", "label": "jcl =", "type": "assigned_variable", "loc": [536, 536], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L535_C4", "vector": [14, 2, 0.9354, 0.0017, 2, 0.56, 0.0, 518, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jcl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jcl = self.joint_list_dict[arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L537_C8", "label": "for i, a", "type": "for", "loc": [537, 538], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L535_C4", "vector": [6, 2, 0.938, 0.0035, 2, 0.56, 1.0, 995, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i, a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,a in enumerate(alpha):\n jcl[i].set_stiffness(a)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L538_C12", "label": "set_stiffness()", "type": "expression", "loc": [538, 538], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L537_C8", "vector": [8, 3, 0.9389, 0.0017, 3, 0.42, 0.0, 418, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_stiffness", "arg_names": [], "import_names": [], "rhs_call_name": "set_stiffness", "annotation": ""}, "snippet": " jcl[i].set_stiffness(a)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L542_C0", "label": "if", "type": "if", "loc": [542, 568], "level": 0, "parent": null, "vector": [4, 0, 0.9686, 0.0471, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n try:\n settings_r = MekaArmSettings(stiffness_list=[0.1939,0.6713,0.748,0.7272,0.75])\n #settings_r = None\n settings_l = MekaArmSettings(stiffness_list=[0.1939,0.6713,0.748,0.7272,0.75])\n #settings_l = None\n cody_arms = MekaArmServer(settings_r, settings_l)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4", "label": "try", "type": "try", "loc": [543, 568], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L542_C0", "vector": [7, 1, 0.9695, 0.0454, 1, 0.2, 0.0, 0, 0, 2, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n settings_r = MekaArmSettings(stiffness_list=[0.1939,0.6713,0.748,0.7272,0.75])\n #settings_r = None\n settings_l = MekaArmSettings(stiffness_list=[0.1939,0.6713,0.748,0.7272,0.75])\n #settings_l = None\n cody_arms = MekaArmServer(settings_r, settings_l)\n\n# print 'hit a key to power up the arms.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L544_C8", "label": "settings_r = MekaArmSettings()", "type": "assigned_variable", "loc": [544, 544], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4", "vector": [14, 2, 0.9494, 0.0017, 2, 0.55, 0.0, 801, 3, 1, 0, 0, 503, 10, 1], "semantic": {"name": "settings_r", "arg_names": [], "import_names": [], "rhs_call_name": "MekaArmSettings", "annotation": ""}, "snippet": " settings_r = MekaArmSettings(stiffness_list=[0.1939,0.6713,0.748,0.7272,0.75])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L546_C8", "label": "settings_l = MekaArmSettings()", "type": "assigned_variable", "loc": [546, 546], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4", "vector": [14, 2, 0.9529, 0.0017, 2, 0.55, 0.2, 755, 3, 1, 0, 0, 503, 10, 1], "semantic": {"name": "settings_l", "arg_names": [], "import_names": [], "rhs_call_name": "MekaArmSettings", "annotation": ""}, "snippet": " settings_l = MekaArmSettings(stiffness_list=[0.1939,0.6713,0.748,0.7272,0.75])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L548_C8", "label": "cody_arms = MekaArmServer()", "type": "assigned_variable", "loc": [548, 548], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4", "vector": [14, 2, 0.9564, 0.0017, 2, 0.55, 0.4, 723, 3, 2, 0, 0, 388, 10, 1], "semantic": {"name": "cody_arms", "arg_names": [], "import_names": [], "rhs_call_name": "MekaArmServer", "annotation": ""}, "snippet": " cody_arms = MekaArmServer(settings_r, settings_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L552_C8", "label": "power_on()", "type": "expression", "loc": [552, 552], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4", "vector": [8, 2, 0.9634, 0.0017, 2, 0.55, 0.6, 777, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "power_on", "arg_names": [], "import_names": [], "rhs_call_name": "power_on", "annotation": ""}, "snippet": " cody_arms.power_on()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:While_L554_C8", "label": "while", "type": "while", "loc": [554, 556], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4", "vector": [5, 2, 0.9686, 0.0052, 2, 0.55, 0.8, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n cody_arms.step_ros()\n rospy.sleep(0.005)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L555_C12", "label": "step_ros()", "type": "expression", "loc": [555, 555], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:While_L554_C8", "vector": [8, 3, 0.9686, 0.0017, 3, 0.11, 0.0, 188, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step_ros", "arg_names": [], "import_names": [], "rhs_call_name": "step_ros", "annotation": ""}, "snippet": " cody_arms.step_ros()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L556_C12", "label": "sleep()", "type": "expression", "loc": [556, 556], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:While_L554_C8", "vector": [8, 3, 0.9703, 0.0017, 3, 0.11, 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.005)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L557_C8", "label": "stop()", "type": "expression", "loc": [557, 557], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4", "vector": [8, 2, 0.9721, 0.0017, 2, 0.55, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " cody_arms.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L560_C8", "label": "print()", "type": "expression", "loc": [560, 560], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4", "vector": [8, 2, 0.9773, 0.0017, 2, 0.55, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('############################################################')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L561_C8", "label": "print()", "type": "expression", "loc": [561, 561], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4", "vector": [8, 2, 0.9791, 0.0017, 2, 0.55, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('In all likelihood the Meka server is not running.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L562_C8", "label": "print()", "type": "expression", "loc": [562, 562], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4", "vector": [8, 2, 0.9808, 0.0017, 2, 0.55, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('############################################################')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L566_C8", "label": "if", "type": "if", "loc": [566, 567], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4", "vector": [4, 2, 0.9887, 0.0035, 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 'cody_arms' in locals():\n cody_arms.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L567_C12", "label": "stop()", "type": "expression", "loc": [567, 567], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L566_C8", "vector": [8, 3, 0.9895, 0.0017, 3, 0.24, 0.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " cody_arms.stop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Return_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Return_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L174_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L175_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L174_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L178_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L178_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L179_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L179_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L180_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L174_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L183_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L174_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L185_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L185_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L186_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L185_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L187_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L187_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L188_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L187_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L189_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L185_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L190_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L190_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L191_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L190_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L192_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L192_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L193_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L192_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L194_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L192_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L195_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L190_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L197_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L190_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L198_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L190_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L199_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L190_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L200_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L190_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L202_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L202_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L203_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L202_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L204_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L204_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L205_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L204_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L206_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L204_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L207_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L202_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L210_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L220_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L221_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L222_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L223_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L228_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L229_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L235_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L238_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L235_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L240_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L244_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L247_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L244_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L249_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L253_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L254_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L253_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L257_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L257_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L258_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L257_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L259_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L280_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L285_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L287_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L288_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L289_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L292_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L293_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L294_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L298_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L298_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L299_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L298_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L303_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L303_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L304_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L298_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L305_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L298_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L306_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L310_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L312_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L314_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L316_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L317_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L319_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L320_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L322_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L324_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L326_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L328_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L328_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L329_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L331_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L332_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L334_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L334_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L336_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L337_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L340_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L341_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L342_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L343_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L344_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L346_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L347_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L348_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L349_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L351_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L352_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L354_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L355_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L356_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L357_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L359_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L360_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L361_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L362_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L363_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L364_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L366_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L367_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L368_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L369_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L373_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L374_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L376_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L377_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L380_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L382_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L383_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L385_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L386_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L387_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L388_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L391_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L392_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L393_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L395_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L396_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L397_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L399_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L401_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L401_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Return_L402_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L409_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L409_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L410_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L412_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L412_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L413_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L412_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L414_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L412_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L415_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L412_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L416_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L418_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L418_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L419_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L419_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L420_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L419_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L421_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L419_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L423_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L419_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L425_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L419_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L426_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L419_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L427_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L427_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L428_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L427_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L430_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L419_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L431_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L433_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L434_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L435_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L436_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L437_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L438_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L439_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L441_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L441_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L442_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L441_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L443_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L441_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L444_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L453_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L454_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L455_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L456_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L457_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L458_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L459_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L460_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L461_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Return_L462_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L464_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L464_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L465_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L464_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L466_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L464_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L467_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L464_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Return_L468_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L477_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L477_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Return_L478_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L484_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L484_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Return_L485_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L487_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L487_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L488_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L487_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Return_L491_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L493_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L493_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L494_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L493_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L495_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L493_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L496_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L498_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L498_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L499_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L498_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L500_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L498_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L501_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L505_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L505_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L506_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L506_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Return_L507_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L505_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L508_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L505_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L512_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L512_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L516_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L505_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L518_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L505_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L519_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L520_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L522_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L505_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L523_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L525_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L525_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L526_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L525_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L527_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L525_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L528_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L530_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L530_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L531_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L530_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L532_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L530_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L533_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L535_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L535_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L536_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:FunctionDef_L535_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L537_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:For_L537_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L538_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L542_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L544_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L546_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Assign_L548_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L552_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:While_L554_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:While_L554_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L555_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:While_L554_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L556_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L557_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L560_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L561_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L562_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:Try_L543_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L566_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99744:If_L566_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99744:Expr_L567_C12"}]
# # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Author: Advait Jain import math, numpy as np import arm_client as ac import arms as ar import roslib; roslib.load_manifest('epc_core') import rospy import tf.broadcaster as tfb import hrl_lib.transforms as tr from hrl_msgs.msg import FloatArray from roslib.msg import Header from visualization_msgs.msg import Marker def publish_cartesian_markers(arm, time_stamp, cep, rot, c1, c2, marker_id): marker = Marker() marker.header.frame_id = ar.link_tf_name(arm, 0) marker.header.stamp = time_stamp marker.ns = arm marker.type = Marker.ARROW marker.action = Marker.ADD marker.pose.position.x = cep[0,0] marker.pose.position.y = cep[1,0] marker.pose.position.z = cep[2,0] marker.scale.x = 0.1 marker.scale.y = 0.2 marker.scale.z = 0.2 marker.lifetime = rospy.Duration() marker.id = marker_id*100 + 0 #rot1 = tr.Ry(math.radians(90.)) * rot.T rot1 = rot * tr.rotY(math.pi/2) quat = tr.matrix_to_quaternion(rot1) marker.pose.orientation.x = quat[0] marker.pose.orientation.y = quat[1] marker.pose.orientation.z = quat[2] marker.pose.orientation.w = quat[3] marker.color.r = c1[0] marker.color.g = c1[1] marker.color.b = c1[2] marker.color.a = 1. marker_pub.publish(marker) marker.id = marker_id*100 + 1 if arm == 'left_arm': #rot2 = tr.Rz(math.radians(90.)) * rot.T rot2 = rot * tr.rotZ(-math.pi/2) else: #rot2 = tr.Rz(math.radians(-90.)) * rot.T rot2 = rot * tr.rotZ(math.pi/2) quat = tr.matrix_to_quaternion(rot2) marker.pose.orientation.x = quat[0] marker.pose.orientation.y = quat[1] marker.pose.orientation.z = quat[2] marker.pose.orientation.w = quat[3] marker.color.r = c2[0] marker.color.g = c2[1] marker.color.b = c2[2] marker.color.a = 1. marker_pub.publish(marker) def publish_sphere_marker(color, size, frameid, time_stamp, ns, marker_id): marker = Marker() marker.header.frame_id = frameid marker.header.stamp = time_stamp marker.ns = ns marker.type = Marker.SPHERE marker.action = Marker.ADD marker.pose.position.x = 0. marker.pose.position.y = 0. marker.pose.position.z = 0. marker.scale.x = size marker.scale.y = size marker.scale.z = size marker.lifetime = rospy.Duration() marker.id = marker_id marker.pose.orientation.x = 0 marker.pose.orientation.y = 0 marker.pose.orientation.z = 0 marker.pose.orientation.w = 1 marker.color.r = color[0] marker.color.g = color[1] marker.color.b = color[2] marker.color.a = 1. marker_pub.publish(marker) if __name__ == '__main__': arms = ar.M3HrlRobot() arm_client = ac.MekaArmClient(arms) force_r_pub = rospy.Publisher('/r_arm/force_base', FloatArray) force_l_pub = rospy.Publisher('/l_arm/force_base', FloatArray) marker_pub = rospy.Publisher('/cody_arms/viz_marker', Marker) rospy.logout('Sleeping ...') rospy.sleep(1.0) rospy.logout('... begin') r_arm = 'right_arm' l_arm = 'left_arm' transform_bcast = tfb.TransformBroadcaster() torso_link_name = ar.link_tf_name(r_arm, 0) while not rospy.is_shutdown(): rospy.sleep(0.1) f_r = arm_client.get_wrist_force(r_arm, base_frame=True) f_l = arm_client.get_wrist_force(l_arm, base_frame=True) time_stamp = rospy.Time.now() h = Header() h.stamp = time_stamp force_r_pub.publish(FloatArray(h, f_r)) force_l_pub.publish(FloatArray(h, f_l)) publish_sphere_marker((0.5,0.5,0.5), 0.08, torso_link_name, time_stamp, 'both_arms', 0) for arm in [r_arm, l_arm]: q = arm_client.get_joint_angles(arm) links = [2, 3, 7] for i in links: p, rot = arms.FK_all(arm, q, i) qaut = tr.matrix_to_quaternion(rot) frameid = ar.link_tf_name(arm, i) transform_bcast.sendTransform(p.A1.tolist(), qaut, time_stamp, frameid, torso_link_name) publish_sphere_marker((0.5,0.1,0.5), 0.05, frameid, time_stamp, arm, i) c1 = (0.5, 0.1, 0.5) c2 = (0.5, 0.5, 0.1) p, rot = arms.FK_all(arm, q) publish_cartesian_markers(arm, time_stamp, p, rot, c1, c2, marker_id=76) c1 = (0.2, 0.2, 0.2) c2 = (0.6, 0.6, 0.6) jep = arm_client.get_jep(arm) jep = arms.clamp_to_physical_joint_limits(arm, jep) cep, rot = arms.FK_all(arm, jep) publish_cartesian_markers(arm, time_stamp, cep, rot, c1, c2, marker_id = 77)
ajibawa-2023/Python-Code-Large/train/row_99745
117
183
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Import_L31_C0", "label": "math import math, np", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.1694, 0.0055, 0, 0.66, 0.0, 526, 0, 2, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math", "np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math, numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Import_L33_C0", "label": "arm_client import ac", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.1803, 0.0055, 0, 0.66, 0.0769, 435, 0, 1, 0, 0, 435, 0, 0], "semantic": {"name": "arm_client", "arg_names": [], "import_names": ["ac"], "rhs_call_name": "", "annotation": ""}, "snippet": "import arm_client as ac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Import_L34_C0", "label": "arms import ar", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.1858, 0.0055, 0, 0.66, 0.1538, 375, 0, 1, 0, 0, 375, 0, 0], "semantic": {"name": "arms", "arg_names": [], "import_names": ["ar"], "rhs_call_name": "", "annotation": ""}, "snippet": "import arms as ar"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Import_L35_C0", "label": "roslib import roslib", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.1913, 0.0055, 0, 0.66, 0.2308, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('epc_core')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L35_C15", "label": "load_manifest()", "type": "expression", "loc": [35, 35], "level": 0, "parent": null, "vector": [8, 0, 0.1913, 0.0055, 0, 0.66, 0.3077, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('epc_core')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Import_L36_C0", "label": "rospy import rospy", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.1967, 0.0055, 0, 0.66, 0.3846, 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_99745:Import_L38_C0", "label": "tf.broadcaster import tfb", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.2077, 0.0055, 0, 0.66, 0.4615, 852, 0, 1, 0, 0, 852, 0, 0], "semantic": {"name": "tf.broadcaster", "arg_names": [], "import_names": ["tfb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.broadcaster as tfb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Import_L39_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.2131, 0.0055, 0, 0.66, 0.5385, 82, 0, 1, 0, 0, 82, 0, 0], "semantic": {"name": "hrl_lib.transforms", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:ImportFrom_L41_C0", "label": "from hrl_msgs.msg import FloatArray", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.224, 0.0055, 0, 0.66, 0.6154, 513, 0, 1, 0, 0, 513, 0, 0], "semantic": {"name": "hrl_msgs.msg", "arg_names": [], "import_names": ["FloatArray"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_msgs.msg import FloatArray"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:ImportFrom_L42_C0", "label": "from roslib.msg import Header", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.2295, 0.0055, 0, 0.66, 0.6923, 276, 0, 1, 0, 0, 276, 0, 0], "semantic": {"name": "roslib.msg", "arg_names": [], "import_names": ["Header"], "rhs_call_name": "", "annotation": ""}, "snippet": "from roslib.msg import Header"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:ImportFrom_L43_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.235, 0.0055, 0, 0.66, 0.7692, 124, 0, 1, 0, 0, 124, 0, 0], "semantic": {"name": "visualization_msgs.msg", "arg_names": [], "import_names": ["Marker"], "rhs_call_name": "", "annotation": ""}, "snippet": "from visualization_msgs.msg import Marker"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "label": "publish_cartesian_markers", "type": "function", "loc": [45, 93], "level": 0, "parent": null, "vector": [2, 0, 0.377, 0.2678, 0, 0.66, 0.8462, 334, 0, 7, 0, 0, 0, 0, 10], "semantic": {"name": "publish_cartesian_markers", "arg_names": ["arm", "time_stamp", "cep", "rot", "c1", "c2", "marker_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def publish_cartesian_markers(arm, time_stamp, cep, rot, c1, c2, marker_id):\n marker = Marker()\n marker.header.frame_id = ar.link_tf_name(arm, 0)\n marker.header.stamp = time_stamp\n marker.ns = arm\n marker.type = Marker.ARROW\n marker.action = Marker.ADD\n marker.pose.position.x = cep[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L46_C4", "label": "marker = Marker()", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.2514, 0.0055, 1, 0.55, 0.0, 864, 3, 0, 0, 0, 923, 10, 1], "semantic": {"name": "marker", "arg_names": [], "import_names": [], "rhs_call_name": "Marker", "annotation": ""}, "snippet": " marker = Marker()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L47_C4", "label": "marker.header.frame_id = link_tf_name()", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.2568, 0.0055, 1, 0.55, 0.0278, 22, 3, 2, 0, 0, 958, 10, 1], "semantic": {"name": "marker.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "link_tf_name", "annotation": ""}, "snippet": " marker.header.frame_id = ar.link_tf_name(arm, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L48_C4", "label": "marker.header.stamp =", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.2623, 0.0055, 1, 0.55, 0.0556, 625, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.header.stamp = time_stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L49_C4", "label": "marker.ns =", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.2678, 0.0055, 1, 0.55, 0.0833, 748, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.ns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.ns = arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L50_C4", "label": "marker.type =", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.2732, 0.0055, 1, 0.55, 0.1111, 726, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.type = Marker.ARROW"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L51_C4", "label": "marker.action =", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.2787, 0.0055, 1, 0.55, 0.1389, 211, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.action = Marker.ADD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L52_C4", "label": "marker.pose.position.x =", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.2842, 0.0055, 1, 0.55, 0.1667, 294, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.position.x = cep[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L53_C4", "label": "marker.pose.position.y =", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.2896, 0.0055, 1, 0.55, 0.1944, 911, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.position.y = cep[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L54_C4", "label": "marker.pose.position.z =", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.2951, 0.0055, 1, 0.55, 0.2222, 473, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.position.z = cep[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L55_C4", "label": "marker.scale.x =", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.3005, 0.0055, 1, 0.55, 0.25, 887, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "marker.scale.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.x = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L56_C4", "label": "marker.scale.y =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.306, 0.0055, 1, 0.55, 0.2778, 730, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "marker.scale.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.y = 0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L57_C4", "label": "marker.scale.z =", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.3115, 0.0055, 1, 0.55, 0.3056, 969, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "marker.scale.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.z = 0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L58_C4", "label": "marker.lifetime = Duration()", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.3169, 0.0055, 1, 0.55, 0.3333, 788, 3, 0, 0, 0, 972, 10, 1], "semantic": {"name": "marker.lifetime", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " marker.lifetime = rospy.Duration()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L60_C4", "label": "marker.id =", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.3279, 0.0055, 1, 0.55, 0.3611, 570, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.id = marker_id*100 + 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L62_C4", "label": "rot1 =", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.3388, 0.0055, 1, 0.55, 0.3889, 856, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rot1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot1 = rot * tr.rotY(math.pi/2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L63_C4", "label": "quat = matrix_to_quaternion()", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.3443, 0.0055, 1, 0.55, 0.4167, 367, 3, 1, 0, 0, 615, 10, 1], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_to_quaternion", "annotation": ""}, "snippet": " quat = tr.matrix_to_quaternion(rot1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L64_C4", "label": "marker.pose.orientation.x =", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.3497, 0.0055, 1, 0.55, 0.4444, 831, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.x = quat[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L65_C4", "label": "marker.pose.orientation.y =", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.3552, 0.0055, 1, 0.55, 0.4722, 626, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.y = quat[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L66_C4", "label": "marker.pose.orientation.z =", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.3607, 0.0055, 1, 0.55, 0.5, 538, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.z = quat[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L67_C4", "label": "marker.pose.orientation.w =", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.3661, 0.0055, 1, 0.55, 0.5278, 522, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.w = quat[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L69_C4", "label": "marker.color.r =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.377, 0.0055, 1, 0.55, 0.5556, 486, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.color.r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.r = c1[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L70_C4", "label": "marker.color.g =", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.3825, 0.0055, 1, 0.55, 0.5833, 536, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.color.g", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.g = c1[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L71_C4", "label": "marker.color.b =", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.388, 0.0055, 1, 0.55, 0.6111, 744, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.color.b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.b = c1[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L72_C4", "label": "marker.color.a =", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.3934, 0.0055, 1, 0.55, 0.6389, 240, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "marker.color.a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.a = 1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L73_C4", "label": "publish()", "type": "expression", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [8, 1, 0.3989, 0.0055, 1, 0.55, 0.6667, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " marker_pub.publish(marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L75_C4", "label": "marker.id =", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.4098, 0.0055, 1, 0.55, 0.6944, 570, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.id = marker_id*100 + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L76_C4", "label": "if", "type": "if", "loc": [76, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [4, 1, 0.429, 0.0328, 1, 0.55, 0.7222, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'left_arm':\n #rot2 = tr.Rz(math.radians(90.)) * rot.T\n rot2 = rot * tr.rotZ(-math.pi/2)\n else:\n #rot2 = tr.Rz(math.radians(-90.)) * rot.T\n rot2 = rot * tr.rotZ(math.pi/2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L78_C8", "label": "rot2 =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L76_C4", "vector": [14, 2, 0.4262, 0.0055, 2, 0.21, 0.0, 447, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rot2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot2 = rot * tr.rotZ(-math.pi/2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L81_C8", "label": "rot2 =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L76_C4", "vector": [14, 2, 0.4426, 0.0055, 2, 0.21, 1.0, 447, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rot2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot2 = rot * tr.rotZ(math.pi/2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L83_C4", "label": "quat = matrix_to_quaternion()", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.4536, 0.0055, 1, 0.55, 0.75, 367, 3, 1, 0, 0, 615, 10, 1], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_to_quaternion", "annotation": ""}, "snippet": " quat = tr.matrix_to_quaternion(rot2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L84_C4", "label": "marker.pose.orientation.x =", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.459, 0.0055, 1, 0.55, 0.7778, 831, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.x = quat[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L85_C4", "label": "marker.pose.orientation.y =", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.4645, 0.0055, 1, 0.55, 0.8056, 626, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.y = quat[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L86_C4", "label": "marker.pose.orientation.z =", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.4699, 0.0055, 1, 0.55, 0.8333, 538, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.z = quat[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L87_C4", "label": "marker.pose.orientation.w =", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.4754, 0.0055, 1, 0.55, 0.8611, 522, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.w = quat[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L89_C4", "label": "marker.color.r =", "type": "assigned_variable", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.4863, 0.0055, 1, 0.55, 0.8889, 486, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.color.r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.r = c2[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L90_C4", "label": "marker.color.g =", "type": "assigned_variable", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.4918, 0.0055, 1, 0.55, 0.9167, 536, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.color.g", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.g = c2[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L91_C4", "label": "marker.color.b =", "type": "assigned_variable", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.4973, 0.0055, 1, 0.55, 0.9444, 744, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.color.b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.b = c2[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L92_C4", "label": "marker.color.a =", "type": "assigned_variable", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [14, 1, 0.5027, 0.0055, 1, 0.55, 0.9722, 240, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "marker.color.a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.a = 1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L93_C4", "label": "publish()", "type": "expression", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "vector": [8, 1, 0.5082, 0.0055, 1, 0.55, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " marker_pub.publish(marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "label": "publish_sphere_marker", "type": "function", "loc": [96, 122], "level": 0, "parent": null, "vector": [2, 0, 0.5956, 0.1475, 0, 0.66, 0.9231, 816, 0, 6, 0, 0, 0, 0, 3], "semantic": {"name": "publish_sphere_marker", "arg_names": ["color", "size", "frameid", "time_stamp", "ns", "marker_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def publish_sphere_marker(color, size, frameid, time_stamp, ns,\n marker_id):\n marker = Marker()\n marker.header.frame_id = frameid\n marker.header.stamp = time_stamp\n marker.ns = ns\n marker.type = Marker.SPHERE\n marker.action = Marker.ADD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L98_C4", "label": "marker = Marker()", "type": "assigned_variable", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.5355, 0.0055, 1, 0.79, 0.0, 864, 3, 0, 0, 0, 923, 10, 1], "semantic": {"name": "marker", "arg_names": [], "import_names": [], "rhs_call_name": "Marker", "annotation": ""}, "snippet": " marker = Marker()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L99_C4", "label": "marker.header.frame_id =", "type": "assigned_variable", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.541, 0.0055, 1, 0.79, 0.0455, 22, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.header.frame_id = frameid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L100_C4", "label": "marker.header.stamp =", "type": "assigned_variable", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.5464, 0.0055, 1, 0.79, 0.0909, 625, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.header.stamp = time_stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L101_C4", "label": "marker.ns =", "type": "assigned_variable", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.5519, 0.0055, 1, 0.79, 0.1364, 748, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.ns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.ns = ns"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L102_C4", "label": "marker.type =", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.5574, 0.0055, 1, 0.79, 0.1818, 726, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.type = Marker.SPHERE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L103_C4", "label": "marker.action =", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.5628, 0.0055, 1, 0.79, 0.2273, 211, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.action = Marker.ADD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L104_C4", "label": "marker.pose.position.x =", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.5683, 0.0055, 1, 0.79, 0.2727, 294, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "marker.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.position.x = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L105_C4", "label": "marker.pose.position.y =", "type": "assigned_variable", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.5738, 0.0055, 1, 0.79, 0.3182, 911, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "marker.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.position.y = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L106_C4", "label": "marker.pose.position.z =", "type": "assigned_variable", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.5792, 0.0055, 1, 0.79, 0.3636, 473, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "marker.pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.position.z = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L107_C4", "label": "marker.scale.x =", "type": "assigned_variable", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.5847, 0.0055, 1, 0.79, 0.4091, 887, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.scale.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.x = size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L108_C4", "label": "marker.scale.y =", "type": "assigned_variable", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.5902, 0.0055, 1, 0.79, 0.4545, 730, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.scale.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.y = size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L109_C4", "label": "marker.scale.z =", "type": "assigned_variable", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.5956, 0.0055, 1, 0.79, 0.5, 969, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.scale.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.z = size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L110_C4", "label": "marker.lifetime = Duration()", "type": "assigned_variable", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.6011, 0.0055, 1, 0.79, 0.5455, 788, 3, 0, 0, 0, 972, 10, 1], "semantic": {"name": "marker.lifetime", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " marker.lifetime = rospy.Duration()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L112_C4", "label": "marker.id =", "type": "assigned_variable", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.612, 0.0055, 1, 0.79, 0.5909, 570, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.id = marker_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L113_C4", "label": "marker.pose.orientation.x =", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.6175, 0.0055, 1, 0.79, 0.6364, 831, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "marker.pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.x = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L114_C4", "label": "marker.pose.orientation.y =", "type": "assigned_variable", "loc": [114, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.623, 0.0055, 1, 0.79, 0.6818, 626, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "marker.pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.y = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L115_C4", "label": "marker.pose.orientation.z =", "type": "assigned_variable", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.6284, 0.0055, 1, 0.79, 0.7273, 538, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "marker.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.z = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L116_C4", "label": "marker.pose.orientation.w =", "type": "assigned_variable", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.6339, 0.0055, 1, 0.79, 0.7727, 522, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "marker.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.w = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L118_C4", "label": "marker.color.r =", "type": "assigned_variable", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.6448, 0.0055, 1, 0.79, 0.8182, 486, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.color.r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.r = color[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L119_C4", "label": "marker.color.g =", "type": "assigned_variable", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.6503, 0.0055, 1, 0.79, 0.8636, 536, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.color.g", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.g = color[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L120_C4", "label": "marker.color.b =", "type": "assigned_variable", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.6557, 0.0055, 1, 0.79, 0.9091, 744, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.color.b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.b = color[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L121_C4", "label": "marker.color.a =", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [14, 1, 0.6612, 0.0055, 1, 0.79, 0.9545, 240, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "marker.color.a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.a = 1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L122_C4", "label": "publish()", "type": "expression", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "vector": [8, 1, 0.6667, 0.0055, 1, 0.79, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " marker_pub.publish(marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "label": "if", "type": "if", "loc": [125, 179], "level": 0, "parent": null, "vector": [4, 0, 0.8306, 0.3005, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 34], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n arms = ar.M3HrlRobot()\n arm_client = ac.MekaArmClient(arms)\n\n force_r_pub = rospy.Publisher('/r_arm/force_base', FloatArray)\n force_l_pub = rospy.Publisher('/l_arm/force_base', FloatArray)\n marker_pub = rospy.Publisher('/cody_arms/viz_marker', Marker)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L126_C4", "label": "arms = M3HrlRobot()", "type": "assigned_variable", "loc": [126, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "vector": [14, 1, 0.6885, 0.0055, 1, 0.39, 0.0, 375, 3, 0, 0, 0, 305, 10, 1], "semantic": {"name": "arms", "arg_names": [], "import_names": [], "rhs_call_name": "M3HrlRobot", "annotation": ""}, "snippet": " arms = ar.M3HrlRobot()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L127_C4", "label": "arm_client = MekaArmClient()", "type": "assigned_variable", "loc": [127, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "vector": [14, 1, 0.694, 0.0055, 1, 0.39, 0.0833, 435, 3, 1, 0, 0, 267, 10, 1], "semantic": {"name": "arm_client", "arg_names": [], "import_names": [], "rhs_call_name": "MekaArmClient", "annotation": ""}, "snippet": " arm_client = ac.MekaArmClient(arms)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L129_C4", "label": "force_r_pub = Publisher()", "type": "assigned_variable", "loc": [129, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "vector": [14, 1, 0.7049, 0.0055, 1, 0.39, 0.1667, 156, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "force_r_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " force_r_pub = rospy.Publisher('/r_arm/force_base', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L130_C4", "label": "force_l_pub = Publisher()", "type": "assigned_variable", "loc": [130, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "vector": [14, 1, 0.7104, 0.0055, 1, 0.39, 0.25, 289, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "force_l_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " force_l_pub = rospy.Publisher('/l_arm/force_base', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L131_C4", "label": "marker_pub = Publisher()", "type": "assigned_variable", "loc": [131, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "vector": [14, 1, 0.7158, 0.0055, 1, 0.39, 0.3333, 918, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "marker_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " marker_pub = rospy.Publisher('/cody_arms/viz_marker', Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L133_C4", "label": "logout()", "type": "expression", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "vector": [8, 1, 0.7268, 0.0055, 1, 0.39, 0.4167, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('Sleeping ...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L134_C4", "label": "sleep()", "type": "expression", "loc": [134, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "vector": [8, 1, 0.7322, 0.0055, 1, 0.39, 0.5, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(1.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L135_C4", "label": "logout()", "type": "expression", "loc": [135, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "vector": [8, 1, 0.7377, 0.0055, 1, 0.39, 0.5833, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('... begin')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L137_C4", "label": "r_arm =", "type": "assigned_variable", "loc": [137, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "vector": [14, 1, 0.7486, 0.0055, 1, 0.39, 0.6667, 315, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "r_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_arm = 'right_arm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L138_C4", "label": "l_arm =", "type": "assigned_variable", "loc": [138, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "vector": [14, 1, 0.7541, 0.0055, 1, 0.39, 0.75, 657, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "l_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l_arm = 'left_arm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L140_C4", "label": "transform_bcast = TransformBroadcaster()", "type": "assigned_variable", "loc": [140, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "vector": [14, 1, 0.765, 0.0055, 1, 0.39, 0.8333, 70, 3, 0, 0, 0, 986, 10, 1], "semantic": {"name": "transform_bcast", "arg_names": [], "import_names": [], "rhs_call_name": "TransformBroadcaster", "annotation": ""}, "snippet": " transform_bcast = tfb.TransformBroadcaster()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L141_C4", "label": "torso_link_name = link_tf_name()", "type": "assigned_variable", "loc": [141, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "vector": [14, 1, 0.7705, 0.0055, 1, 0.39, 0.9167, 169, 3, 2, 0, 0, 958, 10, 1], "semantic": {"name": "torso_link_name", "arg_names": [], "import_names": [], "rhs_call_name": "link_tf_name", "annotation": ""}, "snippet": " torso_link_name = ar.link_tf_name(r_arm, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4", "label": "while", "type": "while", "loc": [142, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "vector": [5, 1, 0.877, 0.2077, 1, 0.39, 1.0, 0, 0, 0, 0, 0, 0, 0, 24], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n rospy.sleep(0.1)\n f_r = arm_client.get_wrist_force(r_arm, base_frame=True)\n f_l = arm_client.get_wrist_force(l_arm, base_frame=True)\n time_stamp = rospy.Time.now()\n h = Header()\n h.stamp = time_stamp\n force_r_pub.publish(FloatArray(h, f_r))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L143_C8", "label": "sleep()", "type": "expression", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4", "vector": [8, 2, 0.7814, 0.0055, 2, 0.64, 0.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.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L144_C8", "label": "f_r = get_wrist_force()", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4", "vector": [14, 2, 0.7869, 0.0055, 2, 0.64, 0.1111, 885, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "f_r", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " f_r = arm_client.get_wrist_force(r_arm, base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L145_C8", "label": "f_l = get_wrist_force()", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4", "vector": [14, 2, 0.7923, 0.0055, 2, 0.64, 0.2222, 265, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "f_l", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " f_l = arm_client.get_wrist_force(l_arm, base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L146_C8", "label": "time_stamp = now()", "type": "assigned_variable", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4", "vector": [14, 2, 0.7978, 0.0055, 2, 0.64, 0.3333, 156, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "time_stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " time_stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L147_C8", "label": "h = Header()", "type": "assigned_variable", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4", "vector": [14, 2, 0.8033, 0.0055, 2, 0.64, 0.4444, 686, 3, 0, 0, 0, 976, 10, 1], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "Header", "annotation": ""}, "snippet": " h = Header()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L148_C8", "label": "h.stamp =", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4", "vector": [14, 2, 0.8087, 0.0055, 2, 0.64, 0.5556, 57, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "h.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h.stamp = time_stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L149_C8", "label": "publish()", "type": "expression", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4", "vector": [8, 2, 0.8142, 0.0055, 2, 0.64, 0.6667, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " force_r_pub.publish(FloatArray(h, f_r))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L150_C8", "label": "publish()", "type": "expression", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4", "vector": [8, 2, 0.8197, 0.0055, 2, 0.64, 0.7778, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " force_l_pub.publish(FloatArray(h, f_l))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L152_C8", "label": "publish_sphere_marker()", "type": "expression", "loc": [152, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4", "vector": [8, 2, 0.8333, 0.0109, 2, 0.64, 0.8889, 816, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "publish_sphere_marker", "arg_names": [], "import_names": [], "rhs_call_name": "publish_sphere_marker", "annotation": ""}, "snippet": " publish_sphere_marker((0.5,0.5,0.5), 0.08, torso_link_name,\n time_stamp, 'both_arms', 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "label": "for arm", "type": "for", "loc": [155, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4", "vector": [6, 2, 0.9126, 0.1366, 2, 0.64, 1.0, 413, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for arm in [r_arm, l_arm]:\n q = arm_client.get_joint_angles(arm)\n links = [2, 3, 7]\n for i in links:\n p, rot = arms.FK_all(arm, q, i)\n qaut = tr.matrix_to_quaternion(rot)\n frameid = ar.link_tf_name(arm, i)\n transform_bcast.sendTransform(p.A1.tolist(), qaut, time_stamp,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L156_C12", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [156, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "vector": [14, 3, 0.8525, 0.0055, 3, 0.99, 0.0, 516, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " q = arm_client.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L157_C12", "label": "links =", "type": "assigned_variable", "loc": [157, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "vector": [14, 3, 0.8579, 0.0055, 3, 0.99, 0.0833, 412, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "links", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " links = [2, 3, 7]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L158_C12", "label": "for i", "type": "for", "loc": [158, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "vector": [6, 3, 0.8825, 0.0437, 3, 0.99, 0.1667, 826, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in links:\n p, rot = arms.FK_all(arm, q, i)\n qaut = tr.matrix_to_quaternion(rot)\n frameid = ar.link_tf_name(arm, i)\n transform_bcast.sendTransform(p.A1.tolist(), qaut, time_stamp,\n frameid, torso_link_name)\n publish_sphere_marker((0.5,0.1,0.5), 0.05, frameid,\n time_stamp, arm, i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L159_C16", "label": "p, rot = FK_all()", "type": "assigned_variable", "loc": [159, 159], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L158_C12", "vector": [14, 4, 0.8689, 0.0055, 4, 0.13, 0.0, 466, 3, 3, 0, 0, 415, 10, 1], "semantic": {"name": "p, rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK_all", "annotation": ""}, "snippet": " p, rot = arms.FK_all(arm, q, i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L160_C16", "label": "qaut = matrix_to_quaternion()", "type": "assigned_variable", "loc": [160, 160], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L158_C12", "vector": [14, 4, 0.8743, 0.0055, 4, 0.13, 0.25, 99, 3, 1, 0, 0, 615, 10, 1], "semantic": {"name": "qaut", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_to_quaternion", "annotation": ""}, "snippet": " qaut = tr.matrix_to_quaternion(rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L161_C16", "label": "frameid = link_tf_name()", "type": "assigned_variable", "loc": [161, 161], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L158_C12", "vector": [14, 4, 0.8798, 0.0055, 4, 0.13, 0.5, 310, 3, 2, 0, 0, 958, 10, 1], "semantic": {"name": "frameid", "arg_names": [], "import_names": [], "rhs_call_name": "link_tf_name", "annotation": ""}, "snippet": " frameid = ar.link_tf_name(arm, i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L162_C16", "label": "sendTransform()", "type": "expression", "loc": [162, 163], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L158_C12", "vector": [8, 4, 0.888, 0.0109, 4, 0.13, 0.75, 373, 3, 5, 0, 0, 0, 0, 2], "semantic": {"name": "sendTransform", "arg_names": [], "import_names": [], "rhs_call_name": "sendTransform", "annotation": ""}, "snippet": " transform_bcast.sendTransform(p.A1.tolist(), qaut, time_stamp,\n frameid, torso_link_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L164_C16", "label": "publish_sphere_marker()", "type": "expression", "loc": [164, 165], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L158_C12", "vector": [8, 4, 0.8989, 0.0109, 4, 0.13, 1.0, 816, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "publish_sphere_marker", "arg_names": [], "import_names": [], "rhs_call_name": "publish_sphere_marker", "annotation": ""}, "snippet": " publish_sphere_marker((0.5,0.1,0.5), 0.05, frameid,\n time_stamp, arm, i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L167_C12", "label": "c1 =", "type": "assigned_variable", "loc": [167, 167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "vector": [14, 3, 0.9126, 0.0055, 3, 0.99, 0.25, 452, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "c1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c1 = (0.5, 0.1, 0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L168_C12", "label": "c2 =", "type": "assigned_variable", "loc": [168, 168], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "vector": [14, 3, 0.918, 0.0055, 3, 0.99, 0.3333, 600, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "c2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c2 = (0.5, 0.5, 0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L169_C12", "label": "p, rot = FK_all()", "type": "assigned_variable", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "vector": [14, 3, 0.9235, 0.0055, 3, 0.99, 0.4167, 466, 3, 2, 0, 0, 415, 10, 1], "semantic": {"name": "p, rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK_all", "annotation": ""}, "snippet": " p, rot = arms.FK_all(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L170_C12", "label": "publish_cartesian_markers()", "type": "expression", "loc": [170, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "vector": [8, 3, 0.9317, 0.0109, 3, 0.99, 0.5, 334, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "publish_cartesian_markers", "arg_names": [], "import_names": [], "rhs_call_name": "publish_cartesian_markers", "annotation": ""}, "snippet": " publish_cartesian_markers(arm, time_stamp, p, rot, c1, c2,\n marker_id=76)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L173_C12", "label": "c1 =", "type": "assigned_variable", "loc": [173, 173], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "vector": [14, 3, 0.9454, 0.0055, 3, 0.99, 0.5833, 452, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "c1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c1 = (0.2, 0.2, 0.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L174_C12", "label": "c2 =", "type": "assigned_variable", "loc": [174, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "vector": [14, 3, 0.9508, 0.0055, 3, 0.99, 0.6667, 600, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "c2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c2 = (0.6, 0.6, 0.6)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L175_C12", "label": "jep = get_jep()", "type": "assigned_variable", "loc": [175, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "vector": [14, 3, 0.9563, 0.0055, 3, 0.99, 0.75, 838, 3, 1, 0, 0, 898, 10, 1], "semantic": {"name": "jep", "arg_names": [], "import_names": [], "rhs_call_name": "get_jep", "annotation": ""}, "snippet": " jep = arm_client.get_jep(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L176_C12", "label": "jep = clamp_to_physical_joint_limits()", "type": "assigned_variable", "loc": [176, 176], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "vector": [14, 3, 0.9617, 0.0055, 3, 0.99, 0.8333, 838, 3, 2, 0, 0, 68, 10, 1], "semantic": {"name": "jep", "arg_names": [], "import_names": [], "rhs_call_name": "clamp_to_physical_joint_limits", "annotation": ""}, "snippet": " jep = arms.clamp_to_physical_joint_limits(arm, jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L177_C12", "label": "cep, rot = FK_all()", "type": "assigned_variable", "loc": [177, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "vector": [14, 3, 0.9672, 0.0055, 3, 0.99, 0.9167, 971, 3, 2, 0, 0, 415, 10, 1], "semantic": {"name": "cep, rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK_all", "annotation": ""}, "snippet": " cep, rot = arms.FK_all(arm, jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L178_C12", "label": "publish_cartesian_markers()", "type": "expression", "loc": [178, 179], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "vector": [8, 3, 0.9754, 0.0109, 3, 0.99, 1.0, 334, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "publish_cartesian_markers", "arg_names": [], "import_names": [], "rhs_call_name": "publish_cartesian_markers", "annotation": ""}, "snippet": " publish_cartesian_markers(arm, time_stamp, cep, rot, c1, c2,\n marker_id = 77)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:While_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L158_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L159_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L158_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L160_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L158_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L161_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L158_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L162_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L158_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L164_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L167_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L168_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L170_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L173_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L174_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L175_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L176_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Assign_L177_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99745:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99745:Expr_L178_C12"}]
# # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Author: Advait Jain import math import numpy as np import copy import sys, time, os import PyKDL as kdl import create_IK_guess_dict as cgd import roslib; roslib.load_manifest('epc_core') import hrl_lib.transforms as tr import hrl_lib.util as ut import hrl_lib.kdl_utils as ku #-------------- TF stuff --------------- def link_tf_name(arm, link_number): if arm == 'right_arm': nm = 'r_arm' else: nm = 'l_arm' if link_number == 0: nm = 'torso_link' elif link_number == 7: nm = nm + '_ee' else: nm = nm + '_' + str(link_number) return nm class M3HrlRobot(): def __init__(self, end_effector_length): # create joint limit dicts self.joint_lim_dict = {} self.joint_lim_dict['right_arm'] = {'max': np.radians([ 120.00, 122.15, 77.5, 144., 122., 45., 45.]), 'min': np.radians([ -47.61, -20., -77.5, 0., -80., -45., -45.])} self.joint_lim_dict['left_arm'] = {'max': np.radians([ 120.00, 20., 77.5, 144., 80., 45., 45.]), 'min': np.radians([ -47.61, -122.15, -77.5, 0., -122., -45., -45.])} end_effector_length += 0.0135 + 0.04318 # add wrist linkange and FT sensor lengths self.setup_kdl_mekabot(end_effector_length) q_guess_pkl_l = os.environ['HOME']+'/svn/gt-ros-pkg/hrl/equilibrium_point_control/epc_core/src/cody_arms/q_guess_left_dict.pkl' q_guess_pkl_r = os.environ['HOME']+'/svn/gt-ros-pkg/hrl/equilibrium_point_control/epc_core/src/cody_arms/q_guess_right_dict.pkl' self.q_guess_dict_left = ut.load_pickle(q_guess_pkl_l) self.q_guess_dict_right = ut.load_pickle(q_guess_pkl_r) # KDL joint array to meka joint list. (7->7) # arm - 'left_arm' or 'right_arm' def kdl_angles_to_meka(self, arm, q_jnt_arr): if q_jnt_arr == None: return None q_rad = [0. for i in range(7)] q_rad[0] = -q_jnt_arr[0] q_rad[1] = -q_jnt_arr[1] q_rad[2] = -q_jnt_arr[2] q_rad[3] = -q_jnt_arr[3] q_rad[4] = -q_jnt_arr[4] q_rad[5] = -q_jnt_arr[5] q_rad[6] = -q_jnt_arr[6] return q_rad # meka joint list to KDL joint array (7->7) # arm - 'left_arm' or 'right_arm' def meka_angles_to_kdl(self,arm,q_list): if q_list == None: return None n_joints = len(q_list) q = kdl.JntArray(n_joints) q[0] = -q_list[0] q[1] = -q_list[1] q[2] = -q_list[2] if n_joints > 3: q[3] = -q_list[3] if n_joints == 7: q[4] = -q_list[4] q[5] = -q_list[5] q[6] = -q_list[6] return q def create_right_chain(self, end_effector_length): ch = kdl.Chain() ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,-0.18493,0.)))) ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.,-0.03175,0.)))) ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotZ),kdl.Frame(kdl.Vector(0.00635,0.,-0.27795)))) ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,-0.27853)))) ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotZ),kdl.Frame(kdl.Vector(0.,0.,0.)))) ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,0.)))) ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.,0.,-end_effector_length)))) return ch def create_left_chain(self, end_effector_length): ch = kdl.Chain() ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.18493,0.)))) ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.,0.03175,0.)))) ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotZ),kdl.Frame(kdl.Vector(0.00635,0.,-0.27795)))) ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,-0.27853)))) ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotZ),kdl.Frame(kdl.Vector(0.,0.,0.)))) ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,0.)))) ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.,0.,-end_effector_length)))) return ch def create_solvers(self, ch): fk = kdl.ChainFkSolverPos_recursive(ch) ik_v = kdl.ChainIkSolverVel_pinv(ch) ik_p = kdl.ChainIkSolverPos_NR(ch, fk, ik_v) jac = kdl.ChainJntToJacSolver(ch) return fk, ik_v, ik_p, jac def setup_kdl_mekabot(self, end_effector_length): #right arm ch = self.create_right_chain(end_effector_length) fk, ik_v, ik_p, jac = self.create_solvers(ch) kdl_rightarm = {} kdl_rightarm['chain'] = ch kdl_rightarm['nJnts'] = ch.getNrOfJoints() kdl_rightarm['fk_p'] = fk kdl_rightarm['ik_v'] = ik_v kdl_rightarm['ik_p'] = ik_p kdl_rightarm['jacobian_solver'] = jac #left arm kdl_leftarm = {} ch = self.create_left_chain(end_effector_length) fk, ik_v, ik_p, jac = self.create_solvers(ch) kdl_leftarm['chain'] = ch kdl_leftarm['nJnts'] = ch.getNrOfJoints() kdl_leftarm['fk_p'] = fk kdl_leftarm['ik_v'] = ik_v kdl_leftarm['ik_p'] = ik_p kdl_leftarm['jacobian_solver'] = jac #Add both chains to dictionary self.cody_kdl = {'right_arm':kdl_rightarm,'left_arm':kdl_leftarm} def FK_kdl(self, arm, q, link_number): fk_solver = self.cody_kdl[arm]['fk_p'] endeffec_frame = kdl.Frame() kinematics_status = fk_solver.JntToCart(q, endeffec_frame, link_number) if kinematics_status >= 0: # print 'End effector transformation matrix:', endeffec_frame return endeffec_frame else: print 'Could not compute forward kinematics.' return None def Jac_kdl(self,arm,q): ''' returns the Jacobian, given the joint angles ''' J_kdl = kdl.Jacobian(7) self.cody_kdl[arm]['jacobian_solver'].JntToJac(q,J_kdl) kdl_jac = np.matrix([ [J_kdl[0,0],J_kdl[0,1],J_kdl[0,2],J_kdl[0,3],J_kdl[0,4],J_kdl[0,5],J_kdl[0,6]], [J_kdl[1,0],J_kdl[1,1],J_kdl[1,2],J_kdl[1,3],J_kdl[1,4],J_kdl[1,5],J_kdl[1,6]], [J_kdl[2,0],J_kdl[2,1],J_kdl[2,2],J_kdl[2,3],J_kdl[2,4],J_kdl[2,5],J_kdl[2,6]], [J_kdl[3,0],J_kdl[3,1],J_kdl[3,2],J_kdl[3,3],J_kdl[3,4],J_kdl[3,5],J_kdl[3,6]], [J_kdl[4,0],J_kdl[4,1],J_kdl[4,2],J_kdl[4,3],J_kdl[4,4],J_kdl[4,5],J_kdl[4,6]], [J_kdl[5,0],J_kdl[5,1],J_kdl[5,2],J_kdl[5,3],J_kdl[5,4],J_kdl[5,5],J_kdl[5,6]], ]) return kdl_jac def IK_kdl(self,arm,frame, q_init): ''' IK, returns jointArray (None if impossible) frame - desired frame of the end effector q_init - initial guess for the joint angles. (JntArray) ''' nJnts = self.cody_kdl[arm]['nJnts'] ik_solver = self.cody_kdl[arm]['ik_p'] q = kdl.JntArray(nJnts) if ik_solver.CartToJnt(q_init,frame,q)>=0: for i in range(nJnts): q[i] = tr.angle_within_mod180(q[i]) return q else: if arm == 'right_arm': ik_solver = self.cody_kdl[arm]['ik_p_nolim'] if ik_solver.CartToJnt(q_init,frame,q)>=0: for i in range(nJnts): q[i] = tr.angle_within_mod180(q[i]) return q print 'Error: could not calculate inverse kinematics' return None def FK_rot(self, arm, q, link_number = 7): pos, rot = self.FK_all(arm, q, link_number) return rot # @param arm - 'left_arm' or 'right_arm' # @param q - list of 7 joint angles (RADIANs) # @param link_number - perform FK up to this link. (1-7) # @return 3x1 numpy matrix def FK(self, arm, q, link_number = 7): pos, rot = self.FK_all(arm, q, link_number) return pos def FK_all(self, arm, q, link_number = 7): q = self.meka_angles_to_kdl(arm, q) frame = self.FK_kdl(arm, q, link_number) pos = frame.p pos = ku.kdl_vec_to_np(pos) m = frame.M rot = ku.kdl_rot_to_np(m) return pos, rot def Jac(self,arm,q): ''' q - list of 7 joint angles (meka axes) in RADIANS. arm - 'right_arm' or 'left_arm' returns 6x7 numpy matrix. ''' jntarr = self.meka_angles_to_kdl(arm,q) kdl_jac = self.Jac_kdl(arm,jntarr) meka_jac = -kdl_jac # the kdl jacobian is the negative of meka jacobian (see kdl_angles_to_meka) return meka_jac ## compute Jacobian at point pos. # p is in the torso_lift_link coord frame. def Jacobian(self, arm, q, pos): chain = self.cody_kdl[arm]['chain'] v_list = [] w_list = [] for i in range(7): p, rot = self.FK_all(arm, q, i) r = pos - p z_idx = chain.getSegment(i).getJoint().getType() - 1 z = rot[:, z_idx] v_list.append(np.matrix(np.cross(z.A1, r.A1)).T) w_list.append(z) J = np.row_stack((np.column_stack(v_list), np.column_stack(w_list))) #J = -J # the kdl jacobian is the negative of meka jacobian (see kdl_angles_to_meka) J = self.Jac(arm, q) return J ## # Inverse Kinematics using KDL. # @param p - 3X1 numpy matrix. # @param rot - 3X3 numpy matrix. It transforms a vector in the # end effector frame to the torso frame. (or it is the orientation # of the end effector wrt the torso) # @return list of 7 joint angles, or None if IK soln not found. def IK(self,arm,p,rot,q_guess=None): p_kdl = ku.np_vec_to_kdl(p) rot_kdl = ku.np_rot_to_kdl(rot) fr = kdl.Frame(rot_kdl,p_kdl) if q_guess == None: if arm == 'left_arm': q_guess = cgd.find_good_config(p,self.q_guess_dict_left) elif arm == 'right_arm': q_guess = cgd.find_good_config(p,self.q_guess_dict_right) q_guess = self.meka_angles_to_kdl(arm,q_guess) q_res = self.IK_kdl(arm,fr,q_guess) q_res = self.kdl_angles_to_meka(arm,q_res) if self.within_joint_limits(arm,q_res): if arm == 'right_arm': if q_res[1]<0.: q_res[1] = math.radians(10.) qg = self.meka_angles_to_kdl(arm,q_res) q_res = self.IK_kdl(arm,fr,qg) q_res = self.kdl_angles_to_meka(arm,q_res) if self.within_joint_limits(arm,q_res): return q_res else: return None else: return q_res else: return None ## clamp joint angles to their physical limits. # @param arm - 'left_arm' or 'right_arm' # @param q - list of 7 joint angles. # The joint limits for IK are larger that the physical limits. def clamp_to_joint_limits(self, arm, q, delta_list=[0.,0.,0.,0.,0.,0.,0.]): d = self.joint_lim_dict[arm] max_arr = d['max'] min_arr = d['min'] q_arr = np.array(q) d_arr = np.array(delta_list) return np.clip(q_arr, min_arr-d_arr, max_arr+d_arr) def within_joint_limits(self, arm, q, delta_list=[0.,0.,0.,0.,0.,0.,0.]): d = self.joint_lim_dict[arm] max_arr = d['max'] min_arr = d['min'] q_arr = np.array(q) d_arr = np.array(delta_list) return np.all((q_arr <= max_arr+d_arr, q_arr >= min_arr-d_arr))
ajibawa-2023/Python-Code-Large/train/row_99746
207
332
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Import_L31_C0", "label": "math import math", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.0934, 0.003, 0, 0.66, 0.0, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Import_L32_C0", "label": "numpy import np", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.0964, 0.003, 0, 0.66, 0.0833, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Import_L33_C0", "label": "copy import copy", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.0994, 0.003, 0, 0.66, 0.1667, 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_99746:Import_L34_C0", "label": "sys import sys, time, os", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.1024, 0.003, 0, 0.66, 0.25, 509, 0, 3, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "time", "os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, time, os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Import_L36_C0", "label": "PyKDL import kdl", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.1084, 0.003, 0, 0.66, 0.3333, 198, 0, 1, 0, 0, 198, 0, 0], "semantic": {"name": "PyKDL", "arg_names": [], "import_names": ["kdl"], "rhs_call_name": "", "annotation": ""}, "snippet": "import PyKDL as kdl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Import_L37_C0", "label": "create_IK_guess_dict import cgd", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.1114, 0.003, 0, 0.66, 0.4167, 34, 0, 1, 0, 0, 34, 0, 0], "semantic": {"name": "create_IK_guess_dict", "arg_names": [], "import_names": ["cgd"], "rhs_call_name": "", "annotation": ""}, "snippet": "import create_IK_guess_dict as cgd"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Import_L39_C0", "label": "roslib import roslib", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.1175, 0.003, 0, 0.66, 0.5, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('epc_core')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L39_C15", "label": "load_manifest()", "type": "expression", "loc": [39, 39], "level": 0, "parent": null, "vector": [8, 0, 0.1175, 0.003, 0, 0.66, 0.5833, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('epc_core')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Import_L41_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.1235, 0.003, 0, 0.66, 0.6667, 82, 0, 1, 0, 0, 82, 0, 0], "semantic": {"name": "hrl_lib.transforms", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Import_L42_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.1265, 0.003, 0, 0.66, 0.75, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Import_L43_C0", "label": "hrl_lib.kdl_utils import ku", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.1295, 0.003, 0, 0.66, 0.8333, 33, 0, 1, 0, 0, 33, 0, 0], "semantic": {"name": "hrl_lib.kdl_utils", "arg_names": [], "import_names": ["ku"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.kdl_utils as ku"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L46_C0", "label": "link_tf_name", "type": "function", "loc": [46, 58], "level": 0, "parent": null, "vector": [2, 0, 0.1566, 0.0392, 0, 0.66, 0.9167, 958, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "link_tf_name", "arg_names": ["arm", "link_number"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def link_tf_name(arm, link_number):\n if arm == 'right_arm':\n nm = 'r_arm'\n else:\n nm = 'l_arm'\n\n if link_number == 0:\n nm = 'torso_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L47_C4", "label": "if", "type": "if", "loc": [47, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L46_C0", "vector": [4, 1, 0.1461, 0.012, 1, 0.16, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'right_arm':\n nm = 'r_arm'\n else:\n nm = 'l_arm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L48_C8", "label": "nm =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L47_C4", "vector": [14, 2, 0.1446, 0.003, 2, 0.27, 0.0, 931, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nm = 'r_arm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L50_C8", "label": "nm =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L47_C4", "vector": [14, 2, 0.1506, 0.003, 2, 0.27, 1.0, 931, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nm = 'l_arm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L52_C4", "label": "if", "type": "if", "loc": [52, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L46_C0", "vector": [4, 1, 0.1642, 0.0181, 1, 0.16, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if link_number == 0:\n nm = 'torso_link'\n elif link_number == 7:\n nm = nm + '_ee'\n else:\n nm = nm + '_' + str(link_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L53_C8", "label": "nm =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L52_C4", "vector": [14, 2, 0.1596, 0.003, 2, 0.38, 0.0, 931, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nm = 'torso_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L54_C4", "label": "if", "type": "if", "loc": [54, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L52_C4", "vector": [4, 2, 0.1672, 0.012, 2, 0.38, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif link_number == 7:\n nm = nm + '_ee'\n else:\n nm = nm + '_' + str(link_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L55_C8", "label": "nm =", "type": "assigned_variable", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L54_C4", "vector": [14, 3, 0.1657, 0.003, 3, 0.04, 0.0, 931, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nm = nm + '_ee'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L57_C8", "label": "nm =", "type": "assigned_variable", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L54_C4", "vector": [14, 3, 0.1717, 0.003, 3, 0.04, 1.0, 931, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nm = nm + '_' + str(link_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L58_C4", "label": "return", "type": "return", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L46_C0", "vector": [13, 1, 0.1747, 0.003, 1, 0.16, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return nm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "label": "M3HrlRobot", "type": "class", "loc": [61, 328], "level": 0, "parent": null, "vector": [3, 0, 0.5858, 0.8072, 0, 0.66, 1.0, 305, 0, 18, 0, 0, 0, 0, 99], "semantic": {"name": "M3HrlRobot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class M3HrlRobot():\n def __init__(self, end_effector_length):\n # create joint limit dicts\n self.joint_lim_dict = {}\n self.joint_lim_dict['right_arm'] = {'max': np.radians([ 120.00, 122.15, 77.5, 144., 122., 45., 45.]),\n 'min': np.radians([ -47.61, -20., -77.5, 0., -80., -45., -45.])}\n\n self.joint_lim_dict['left_arm'] = {'max': np.radians([ 120.00, 20., 77.5, 144., 80., 45., 45.]),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L62_C4", "label": "__init__", "type": "function", "loc": [62, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "vector": [2, 1, 0.2093, 0.0482, 1, 0.6, 0.0, 555, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "__init__", "arg_names": ["self", "end_effector_length"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, end_effector_length):\n # create joint limit dicts\n self.joint_lim_dict = {}\n self.joint_lim_dict['right_arm'] = {'max': np.radians([ 120.00, 122.15, 77.5, 144., 122., 45., 45.]),\n 'min': np.radians([ -47.61, -20., -77.5, 0., -80., -45., -45.])}\n\n self.joint_lim_dict['left_arm'] = {'max': np.radians([ 120.00, 20., 77.5, 144., 80., 45., 45.]),\n 'min': np.radians([ -47.61, -122.15, -77.5, 0., -122., -45., -45.])}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L64_C8", "label": "self.joint_lim_dict =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L62_C4", "vector": [14, 2, 0.1928, 0.003, 2, 0.06, 0.0, 766, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.joint_lim_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_lim_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L65_C8", "label": "assign", "type": "assigned_variable", "loc": [65, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L62_C4", "vector": [14, 2, 0.1973, 0.006, 2, 0.06, 0.1429, 0, 0, 0, 0, 0, 0, 6, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_lim_dict['right_arm'] = {'max': np.radians([ 120.00, 122.15, 77.5, 144., 122., 45., 45.]),\n 'min': np.radians([ -47.61, -20., -77.5, 0., -80., -45., -45.])}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L68_C8", "label": "assign", "type": "assigned_variable", "loc": [68, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L62_C4", "vector": [14, 2, 0.2063, 0.006, 2, 0.06, 0.2857, 0, 0, 0, 0, 0, 0, 6, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_lim_dict['left_arm'] = {'max': np.radians([ 120.00, 20., 77.5, 144., 80., 45., 45.]),\n 'min': np.radians([ -47.61, -122.15, -77.5, 0., -122., -45., -45.])}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L72_C8", "label": "setup_kdl_mekabot()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L62_C4", "vector": [8, 2, 0.2169, 0.003, 2, 0.06, 0.4286, 972, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setup_kdl_mekabot", "arg_names": [], "import_names": [], "rhs_call_name": "setup_kdl_mekabot", "annotation": ""}, "snippet": " self.setup_kdl_mekabot(end_effector_length)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L73_C8", "label": "q_guess_pkl_l =", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L62_C4", "vector": [14, 2, 0.2199, 0.003, 2, 0.06, 0.5714, 193, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q_guess_pkl_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_guess_pkl_l = os.environ['HOME']+'/svn/gt-ros-pkg/hrl/equilibrium_point_control/epc_core/src/cody_arms/q_guess_left_dict.pkl'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L74_C8", "label": "q_guess_pkl_r =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L62_C4", "vector": [14, 2, 0.2229, 0.003, 2, 0.06, 0.7143, 779, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q_guess_pkl_r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_guess_pkl_r = os.environ['HOME']+'/svn/gt-ros-pkg/hrl/equilibrium_point_control/epc_core/src/cody_arms/q_guess_right_dict.pkl'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L76_C8", "label": "self.q_guess_dict_left = load_pickle()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L62_C4", "vector": [14, 2, 0.2289, 0.003, 2, 0.06, 0.8571, 291, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "self.q_guess_dict_left", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " self.q_guess_dict_left = ut.load_pickle(q_guess_pkl_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L77_C8", "label": "self.q_guess_dict_right = load_pickle()", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L62_C4", "vector": [14, 2, 0.2319, 0.003, 2, 0.06, 1.0, 393, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "self.q_guess_dict_right", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " self.q_guess_dict_right = ut.load_pickle(q_guess_pkl_r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4", "label": "kdl_angles_to_meka", "type": "function", "loc": [81, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "vector": [2, 1, 0.262, 0.0392, 1, 0.6, 0.0588, 808, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "kdl_angles_to_meka", "arg_names": ["self", "arm", "q_jnt_arr"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def kdl_angles_to_meka(self, arm, q_jnt_arr):\n if q_jnt_arr == None:\n return None\n\n q_rad = [0. for i in range(7)]\n q_rad[0] = -q_jnt_arr[0]\n q_rad[1] = -q_jnt_arr[1]\n q_rad[2] = -q_jnt_arr[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L82_C8", "label": "if", "type": "if", "loc": [82, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4", "vector": [4, 2, 0.2485, 0.006, 2, 0.98, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if q_jnt_arr == None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L83_C12", "label": "return", "type": "return", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L82_C8", "vector": [13, 3, 0.25, 0.003, 3, 0.55, 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_99746:Assign_L85_C8", "label": "q_rad =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4", "vector": [14, 2, 0.256, 0.003, 2, 0.98, 0.1111, 498, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "q_rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_rad = [0. for i in range(7)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L86_C8", "label": "assign", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4", "vector": [14, 2, 0.259, 0.003, 2, 0.98, 0.2222, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_rad[0] = -q_jnt_arr[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L87_C8", "label": "assign", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4", "vector": [14, 2, 0.262, 0.003, 2, 0.98, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_rad[1] = -q_jnt_arr[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L88_C8", "label": "assign", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4", "vector": [14, 2, 0.2651, 0.003, 2, 0.98, 0.4444, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_rad[2] = -q_jnt_arr[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L89_C8", "label": "assign", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4", "vector": [14, 2, 0.2681, 0.003, 2, 0.98, 0.5556, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_rad[3] = -q_jnt_arr[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L90_C8", "label": "assign", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4", "vector": [14, 2, 0.2711, 0.003, 2, 0.98, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_rad[4] = -q_jnt_arr[4]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L91_C8", "label": "assign", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4", "vector": [14, 2, 0.2741, 0.003, 2, 0.98, 0.7778, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_rad[5] = -q_jnt_arr[5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L92_C8", "label": "assign", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4", "vector": [14, 2, 0.2771, 0.003, 2, 0.98, 0.8889, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_rad[6] = -q_jnt_arr[6]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L93_C8", "label": "return", "type": "return", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4", "vector": [13, 2, 0.2801, 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 q_rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L97_C4", "label": "meka_angles_to_kdl", "type": "function", "loc": [97, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "vector": [2, 1, 0.3148, 0.0482, 1, 0.6, 0.1176, 278, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "meka_angles_to_kdl", "arg_names": ["self", "arm", "q_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def meka_angles_to_kdl(self,arm,q_list):\n if q_list == None:\n return None\n\n n_joints = len(q_list)\n q = kdl.JntArray(n_joints)\n q[0] = -q_list[0]\n q[1] = -q_list[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L98_C8", "label": "if", "type": "if", "loc": [98, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L97_C4", "vector": [4, 2, 0.2967, 0.006, 2, 0.69, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if q_list == None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L99_C12", "label": "return", "type": "return", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L98_C8", "vector": [13, 3, 0.2982, 0.003, 3, 0.61, 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_99746:Assign_L101_C8", "label": "n_joints = len()", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L97_C4", "vector": [14, 2, 0.3042, 0.003, 2, 0.69, 0.125, 918, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_joints", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_joints = len(q_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L102_C8", "label": "q = JntArray()", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L97_C4", "vector": [14, 2, 0.3072, 0.003, 2, 0.69, 0.25, 516, 3, 1, 0, 0, 115, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "JntArray", "annotation": ""}, "snippet": " q = kdl.JntArray(n_joints)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L103_C8", "label": "assign", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L97_C4", "vector": [14, 2, 0.3102, 0.003, 2, 0.69, 0.375, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q[0] = -q_list[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L104_C8", "label": "assign", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L97_C4", "vector": [14, 2, 0.3133, 0.003, 2, 0.69, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q[1] = -q_list[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L105_C8", "label": "assign", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L97_C4", "vector": [14, 2, 0.3163, 0.003, 2, 0.69, 0.625, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q[2] = -q_list[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L106_C8", "label": "if", "type": "if", "loc": [106, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L97_C4", "vector": [4, 2, 0.3208, 0.006, 2, 0.69, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_joints > 3:\n q[3] = -q_list[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L107_C12", "label": "assign", "type": "assigned_variable", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L106_C8", "vector": [14, 3, 0.3223, 0.003, 3, 0.63, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q[3] = -q_list[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L108_C8", "label": "if", "type": "if", "loc": [108, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L97_C4", "vector": [4, 2, 0.3298, 0.012, 2, 0.69, 0.875, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_joints == 7:\n q[4] = -q_list[4]\n q[5] = -q_list[5]\n q[6] = -q_list[6]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L109_C12", "label": "assign", "type": "assigned_variable", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L108_C8", "vector": [14, 3, 0.3283, 0.003, 3, 0.98, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q[4] = -q_list[4]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L110_C12", "label": "assign", "type": "assigned_variable", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L108_C8", "vector": [14, 3, 0.3313, 0.003, 3, 0.98, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q[5] = -q_list[5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L111_C12", "label": "assign", "type": "assigned_variable", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L108_C8", "vector": [14, 3, 0.3343, 0.003, 3, 0.98, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q[6] = -q_list[6]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L112_C8", "label": "return", "type": "return", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L97_C4", "vector": [13, 2, 0.3373, 0.003, 2, 0.69, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L114_C4", "label": "create_right_chain", "type": "function", "loc": [114, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "vector": [2, 1, 0.3569, 0.0301, 1, 0.6, 0.1765, 956, 0, 2, 1, 0, 0, 0, 36], "semantic": {"name": "create_right_chain", "arg_names": ["self", "end_effector_length"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_right_chain(self, end_effector_length):\n ch = kdl.Chain()\n ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,-0.18493,0.))))\n ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.,-0.03175,0.))))\n ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotZ),kdl.Frame(kdl.Vector(0.00635,0.,-0.27795))))\n ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,-0.27853))))\n ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotZ),kdl.Frame(kdl.Vector(0.,0.,0.))))\n ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L115_C8", "label": "ch = Chain()", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L114_C4", "vector": [14, 2, 0.3464, 0.003, 2, 0.28, 0.0, 263, 3, 0, 0, 0, 629, 10, 1], "semantic": {"name": "ch", "arg_names": [], "import_names": [], "rhs_call_name": "Chain", "annotation": ""}, "snippet": " ch = kdl.Chain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L116_C8", "label": "addSegment()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L114_C4", "vector": [8, 2, 0.3494, 0.003, 2, 0.28, 0.125, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,-0.18493,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L117_C8", "label": "addSegment()", "type": "expression", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L114_C4", "vector": [8, 2, 0.3524, 0.003, 2, 0.28, 0.25, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.,-0.03175,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L118_C8", "label": "addSegment()", "type": "expression", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L114_C4", "vector": [8, 2, 0.3554, 0.003, 2, 0.28, 0.375, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotZ),kdl.Frame(kdl.Vector(0.00635,0.,-0.27795))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L119_C8", "label": "addSegment()", "type": "expression", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L114_C4", "vector": [8, 2, 0.3584, 0.003, 2, 0.28, 0.5, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,-0.27853))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L120_C8", "label": "addSegment()", "type": "expression", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L114_C4", "vector": [8, 2, 0.3614, 0.003, 2, 0.28, 0.625, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotZ),kdl.Frame(kdl.Vector(0.,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L121_C8", "label": "addSegment()", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L114_C4", "vector": [8, 2, 0.3645, 0.003, 2, 0.28, 0.75, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L122_C8", "label": "addSegment()", "type": "expression", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L114_C4", "vector": [8, 2, 0.3675, 0.003, 2, 0.28, 0.875, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.,0.,-end_effector_length))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L123_C8", "label": "return", "type": "return", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L114_C4", "vector": [13, 2, 0.3705, 0.003, 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 ch"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L125_C4", "label": "create_left_chain", "type": "function", "loc": [125, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "vector": [2, 1, 0.3901, 0.0301, 1, 0.6, 0.2353, 985, 0, 2, 1, 0, 0, 0, 36], "semantic": {"name": "create_left_chain", "arg_names": ["self", "end_effector_length"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_left_chain(self, end_effector_length):\n ch = kdl.Chain()\n ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.18493,0.))))\n ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.,0.03175,0.))))\n ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotZ),kdl.Frame(kdl.Vector(0.00635,0.,-0.27795))))\n ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,-0.27853))))\n ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotZ),kdl.Frame(kdl.Vector(0.,0.,0.))))\n ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L126_C8", "label": "ch = Chain()", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L125_C4", "vector": [14, 2, 0.3795, 0.003, 2, 0.79, 0.0, 263, 3, 0, 0, 0, 629, 10, 1], "semantic": {"name": "ch", "arg_names": [], "import_names": [], "rhs_call_name": "Chain", "annotation": ""}, "snippet": " ch = kdl.Chain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L127_C8", "label": "addSegment()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L125_C4", "vector": [8, 2, 0.3825, 0.003, 2, 0.79, 0.125, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.18493,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L128_C8", "label": "addSegment()", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L125_C4", "vector": [8, 2, 0.3855, 0.003, 2, 0.79, 0.25, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.,0.03175,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L129_C8", "label": "addSegment()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L125_C4", "vector": [8, 2, 0.3886, 0.003, 2, 0.79, 0.375, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotZ),kdl.Frame(kdl.Vector(0.00635,0.,-0.27795))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L130_C8", "label": "addSegment()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L125_C4", "vector": [8, 2, 0.3916, 0.003, 2, 0.79, 0.5, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,-0.27853))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L131_C8", "label": "addSegment()", "type": "expression", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L125_C4", "vector": [8, 2, 0.3946, 0.003, 2, 0.79, 0.625, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotZ),kdl.Frame(kdl.Vector(0.,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L132_C8", "label": "addSegment()", "type": "expression", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L125_C4", "vector": [8, 2, 0.3976, 0.003, 2, 0.79, 0.75, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L133_C8", "label": "addSegment()", "type": "expression", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L125_C4", "vector": [8, 2, 0.4006, 0.003, 2, 0.79, 0.875, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.,0.,-end_effector_length))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L134_C8", "label": "return", "type": "return", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L125_C4", "vector": [13, 2, 0.4036, 0.003, 2, 0.79, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ch"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L136_C4", "label": "create_solvers", "type": "function", "loc": [136, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "vector": [2, 1, 0.4172, 0.0181, 1, 0.6, 0.2941, 845, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "create_solvers", "arg_names": ["self", "ch"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_solvers(self, ch):\n fk = kdl.ChainFkSolverPos_recursive(ch)\n ik_v = kdl.ChainIkSolverVel_pinv(ch)\n ik_p = kdl.ChainIkSolverPos_NR(ch, fk, ik_v)\n jac = kdl.ChainJntToJacSolver(ch)\n return fk, ik_v, ik_p, jac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L137_C9", "label": "fk = ChainFkSolverPos_recursive()", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L136_C4", "vector": [14, 2, 0.4127, 0.003, 2, 0.56, 0.0, 714, 3, 1, 0, 0, 489, 10, 1], "semantic": {"name": "fk", "arg_names": [], "import_names": [], "rhs_call_name": "ChainFkSolverPos_recursive", "annotation": ""}, "snippet": " fk = kdl.ChainFkSolverPos_recursive(ch)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L138_C9", "label": "ik_v = ChainIkSolverVel_pinv()", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L136_C4", "vector": [14, 2, 0.4157, 0.003, 2, 0.56, 0.25, 976, 3, 1, 0, 0, 507, 10, 1], "semantic": {"name": "ik_v", "arg_names": [], "import_names": [], "rhs_call_name": "ChainIkSolverVel_pinv", "annotation": ""}, "snippet": " ik_v = kdl.ChainIkSolverVel_pinv(ch)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L139_C9", "label": "ik_p = ChainIkSolverPos_NR()", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L136_C4", "vector": [14, 2, 0.4187, 0.003, 2, 0.56, 0.5, 796, 3, 3, 0, 0, 440, 10, 1], "semantic": {"name": "ik_p", "arg_names": [], "import_names": [], "rhs_call_name": "ChainIkSolverPos_NR", "annotation": ""}, "snippet": " ik_p = kdl.ChainIkSolverPos_NR(ch, fk, ik_v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L140_C9", "label": "jac = ChainJntToJacSolver()", "type": "assigned_variable", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L136_C4", "vector": [14, 2, 0.4217, 0.003, 2, 0.56, 0.75, 812, 3, 1, 0, 0, 672, 10, 1], "semantic": {"name": "jac", "arg_names": [], "import_names": [], "rhs_call_name": "ChainJntToJacSolver", "annotation": ""}, "snippet": " jac = kdl.ChainJntToJacSolver(ch)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L141_C9", "label": "return", "type": "return", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L136_C4", "vector": [13, 2, 0.4247, 0.003, 2, 0.56, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return fk, ik_v, ik_p, jac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "label": "setup_kdl_mekabot", "type": "function", "loc": [143, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "vector": [2, 1, 0.4699, 0.0813, 1, 0.6, 0.3529, 972, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "setup_kdl_mekabot", "arg_names": ["self", "end_effector_length"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setup_kdl_mekabot(self, end_effector_length):\n #right arm\n ch = self.create_right_chain(end_effector_length)\n fk, ik_v, ik_p, jac = self.create_solvers(ch)\n\n kdl_rightarm = {}\n kdl_rightarm['chain'] = ch\n kdl_rightarm['nJnts'] = ch.getNrOfJoints()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L145_C8", "label": "ch = create_right_chain()", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "vector": [14, 2, 0.4367, 0.003, 2, 0.65, 0.0, 263, 3, 1, 0, 0, 956, 10, 1], "semantic": {"name": "ch", "arg_names": [], "import_names": [], "rhs_call_name": "create_right_chain", "annotation": ""}, "snippet": " ch = self.create_right_chain(end_effector_length)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L146_C8", "label": "fk, ik_v, ik_p, jac = create_solvers()", "type": "assigned_variable", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "vector": [14, 2, 0.4398, 0.003, 2, 0.65, 0.0556, 737, 3, 1, 0, 0, 845, 10, 1], "semantic": {"name": "fk, ik_v, ik_p, jac", "arg_names": [], "import_names": [], "rhs_call_name": "create_solvers", "annotation": ""}, "snippet": " fk, ik_v, ik_p, jac = self.create_solvers(ch)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L148_C8", "label": "kdl_rightarm =", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "vector": [14, 2, 0.4458, 0.003, 2, 0.65, 0.1111, 168, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "kdl_rightarm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kdl_rightarm = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L149_C8", "label": "assign", "type": "assigned_variable", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "vector": [14, 2, 0.4488, 0.003, 2, 0.65, 0.1667, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kdl_rightarm['chain'] = ch"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L150_C8", "label": " = getNrOfJoints()", "type": "assigned_variable", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "vector": [14, 2, 0.4518, 0.003, 2, 0.65, 0.2222, 0, 3, 0, 0, 0, 822, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "getNrOfJoints", "annotation": ""}, "snippet": " kdl_rightarm['nJnts'] = ch.getNrOfJoints()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L151_C8", "label": "assign", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "vector": [14, 2, 0.4548, 0.003, 2, 0.65, 0.2778, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kdl_rightarm['fk_p'] = fk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L152_C8", "label": "assign", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "vector": [14, 2, 0.4578, 0.003, 2, 0.65, 0.3333, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kdl_rightarm['ik_v'] = ik_v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L153_C8", "label": "assign", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "vector": [14, 2, 0.4608, 0.003, 2, 0.65, 0.3889, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kdl_rightarm['ik_p'] = ik_p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L154_C8", "label": "assign", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "vector": [14, 2, 0.4639, 0.003, 2, 0.65, 0.4444, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kdl_rightarm['jacobian_solver'] = jac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L157_C8", "label": "kdl_leftarm =", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "vector": [14, 2, 0.4729, 0.003, 2, 0.65, 0.5, 893, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "kdl_leftarm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kdl_leftarm = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L158_C8", "label": "ch = create_left_chain()", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "vector": [14, 2, 0.4759, 0.003, 2, 0.65, 0.5556, 263, 3, 1, 0, 0, 985, 10, 1], "semantic": {"name": "ch", "arg_names": [], "import_names": [], "rhs_call_name": "create_left_chain", "annotation": ""}, "snippet": " ch = self.create_left_chain(end_effector_length)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L159_C8", "label": "fk, ik_v, ik_p, jac = create_solvers()", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "vector": [14, 2, 0.4789, 0.003, 2, 0.65, 0.6111, 737, 3, 1, 0, 0, 845, 10, 1], "semantic": {"name": "fk, ik_v, ik_p, jac", "arg_names": [], "import_names": [], "rhs_call_name": "create_solvers", "annotation": ""}, "snippet": " fk, ik_v, ik_p, jac = self.create_solvers(ch)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L161_C8", "label": "assign", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "vector": [14, 2, 0.4849, 0.003, 2, 0.65, 0.6667, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kdl_leftarm['chain'] = ch"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L162_C8", "label": " = getNrOfJoints()", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "vector": [14, 2, 0.488, 0.003, 2, 0.65, 0.7222, 0, 3, 0, 0, 0, 822, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "getNrOfJoints", "annotation": ""}, "snippet": " kdl_leftarm['nJnts'] = ch.getNrOfJoints()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L163_C8", "label": "assign", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "vector": [14, 2, 0.491, 0.003, 2, 0.65, 0.7778, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kdl_leftarm['fk_p'] = fk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L164_C8", "label": "assign", "type": "assigned_variable", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "vector": [14, 2, 0.494, 0.003, 2, 0.65, 0.8333, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kdl_leftarm['ik_v'] = ik_v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L165_C8", "label": "assign", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "vector": [14, 2, 0.497, 0.003, 2, 0.65, 0.8889, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kdl_leftarm['ik_p'] = ik_p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L166_C8", "label": "assign", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "vector": [14, 2, 0.5, 0.003, 2, 0.65, 0.9444, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kdl_leftarm['jacobian_solver'] = jac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L169_C8", "label": "self.cody_kdl =", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "vector": [14, 2, 0.509, 0.003, 2, 0.65, 1.0, 289, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.cody_kdl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cody_kdl = {'right_arm':kdl_rightarm,'left_arm':kdl_leftarm}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L171_C4", "label": "FK_kdl", "type": "function", "loc": [171, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "vector": [2, 1, 0.5301, 0.0331, 1, 0.6, 0.4118, 929, 0, 4, 1, 0, 0, 0, 3], "semantic": {"name": "FK_kdl", "arg_names": ["self", "arm", "q", "link_number"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def FK_kdl(self, arm, q, link_number):\n fk_solver = self.cody_kdl[arm]['fk_p']\n endeffec_frame = kdl.Frame()\n kinematics_status = fk_solver.JntToCart(q, endeffec_frame,\n link_number)\n if kinematics_status >= 0:\n# print 'End effector transformation matrix:', endeffec_frame\n return endeffec_frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L172_C8", "label": "fk_solver =", "type": "assigned_variable", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L171_C4", "vector": [14, 2, 0.5181, 0.003, 2, 0.08, 0.0, 660, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fk_solver", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fk_solver = self.cody_kdl[arm]['fk_p']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L173_C8", "label": "endeffec_frame = Frame()", "type": "assigned_variable", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L171_C4", "vector": [14, 2, 0.5211, 0.003, 2, 0.08, 0.3333, 271, 3, 0, 0, 0, 342, 10, 1], "semantic": {"name": "endeffec_frame", "arg_names": [], "import_names": [], "rhs_call_name": "Frame", "annotation": ""}, "snippet": " endeffec_frame = kdl.Frame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L174_C8", "label": "kinematics_status = JntToCart()", "type": "assigned_variable", "loc": [174, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L171_C4", "vector": [14, 2, 0.5256, 0.006, 2, 0.08, 0.6667, 714, 3, 3, 0, 0, 79, 10, 1], "semantic": {"name": "kinematics_status", "arg_names": [], "import_names": [], "rhs_call_name": "JntToCart", "annotation": ""}, "snippet": " kinematics_status = fk_solver.JntToCart(q, endeffec_frame,\n link_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L176_C8", "label": "if", "type": "if", "loc": [176, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L171_C4", "vector": [4, 2, 0.5377, 0.0181, 2, 0.08, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if kinematics_status >= 0:\n# print 'End effector transformation matrix:', endeffec_frame\n return endeffec_frame\n else:\n print('Could not compute forward kinematics.')\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L178_C12", "label": "return", "type": "return", "loc": [178, 178], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L176_C8", "vector": [13, 3, 0.5361, 0.003, 3, 0.3, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return endeffec_frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L180_C12", "label": "print()", "type": "expression", "loc": [180, 180], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L176_C8", "vector": [8, 3, 0.5422, 0.003, 3, 0.3, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Could not compute forward kinematics.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L181_C12", "label": "return", "type": "return", "loc": [181, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L176_C8", "vector": [13, 3, 0.5452, 0.003, 3, 0.3, 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_99746:FunctionDef_L183_C4", "label": "Jac_kdl", "type": "function", "loc": [183, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "vector": [2, 1, 0.5723, 0.0452, 1, 0.6, 0.4706, 295, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "Jac_kdl", "arg_names": ["self", "arm", "q"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def Jac_kdl(self,arm,q):\n ''' returns the Jacobian, given the joint angles\n '''\n J_kdl = kdl.Jacobian(7)\n self.cody_kdl[arm]['jacobian_solver'].JntToJac(q,J_kdl)\n\n kdl_jac = np.matrix([\n [J_kdl[0,0],J_kdl[0,1],J_kdl[0,2],J_kdl[0,3],J_kdl[0,4],J_kdl[0,5],J_kdl[0,6]],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L184_C8", "label": "expression", "type": "expression", "loc": [184, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L183_C4", "vector": [8, 2, 0.5557, 0.006, 2, 0.91, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' returns the Jacobian, given the joint angles\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L186_C8", "label": "J_kdl = Jacobian()", "type": "assigned_variable", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L183_C4", "vector": [14, 2, 0.5602, 0.003, 2, 0.91, 0.25, 652, 3, 1, 0, 0, 182, 10, 1], "semantic": {"name": "J_kdl", "arg_names": [], "import_names": [], "rhs_call_name": "Jacobian", "annotation": ""}, "snippet": " J_kdl = kdl.Jacobian(7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L187_C8", "label": "JntToJac()", "type": "expression", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L183_C4", "vector": [8, 2, 0.5633, 0.003, 2, 0.91, 0.5, 953, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "JntToJac", "arg_names": [], "import_names": [], "rhs_call_name": "JntToJac", "annotation": ""}, "snippet": " self.cody_kdl[arm]['jacobian_solver'].JntToJac(q,J_kdl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L189_C8", "label": "kdl_jac = matrix()", "type": "assigned_variable", "loc": [189, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L183_C4", "vector": [14, 2, 0.5798, 0.0241, 2, 0.91, 0.75, 33, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "kdl_jac", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " kdl_jac = np.matrix([\n [J_kdl[0,0],J_kdl[0,1],J_kdl[0,2],J_kdl[0,3],J_kdl[0,4],J_kdl[0,5],J_kdl[0,6]],\n [J_kdl[1,0],J_kdl[1,1],J_kdl[1,2],J_kdl[1,3],J_kdl[1,4],J_kdl[1,5],J_kdl[1,6]],\n [J_kdl[2,0],J_kdl[2,1],J_kdl[2,2],J_kdl[2,3],J_kdl[2,4],J_kdl[2,5],J_kdl[2,6]],\n [J_kdl[3,0],J_kdl[3,1],J_kdl[3,2],J_kdl[3,3],J_kdl[3,4],J_kdl[3,5],J_kdl[3,6]],\n [J_kdl[4,0],J_kdl[4,1],J_kdl[4,2],J_kdl[4,3],J_kdl[4,4],J_kdl[4,5],J_kdl[4,6]],\n [J_kdl[5,0],J_kdl[5,1],J_kdl[5,2],J_kdl[5,3],J_kdl[5,4],J_kdl[5,5],J_kdl[5,6]],\n ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L197_C8", "label": "return", "type": "return", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L183_C4", "vector": [13, 2, 0.5934, 0.003, 2, 0.91, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return kdl_jac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L199_C4", "label": "IK_kdl", "type": "function", "loc": [199, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "vector": [2, 1, 0.6295, 0.0633, 1, 0.6, 0.5294, 753, 0, 4, 1, 0, 0, 0, 8], "semantic": {"name": "IK_kdl", "arg_names": ["self", "arm", "frame", "q_init"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def IK_kdl(self,arm,frame, q_init):\n ''' IK, returns jointArray (None if impossible)\n frame - desired frame of the end effector\n q_init - initial guess for the joint angles. (JntArray)\n '''\n nJnts = self.cody_kdl[arm]['nJnts']\n ik_solver = self.cody_kdl[arm]['ik_p']\n q = kdl.JntArray(nJnts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L200_C8", "label": "expression", "type": "expression", "loc": [200, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L199_C4", "vector": [8, 2, 0.6069, 0.012, 2, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' IK, returns jointArray (None if impossible)\n frame - desired frame of the end effector\n q_init - initial guess for the joint angles. (JntArray)\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L204_C8", "label": "nJnts =", "type": "assigned_variable", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L199_C4", "vector": [14, 2, 0.6145, 0.003, 2, 0.93, 0.25, 851, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "nJnts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nJnts = self.cody_kdl[arm]['nJnts']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L205_C8", "label": "ik_solver =", "type": "assigned_variable", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L199_C4", "vector": [14, 2, 0.6175, 0.003, 2, 0.93, 0.5, 705, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_solver", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_solver = self.cody_kdl[arm]['ik_p']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L206_C8", "label": "q = JntArray()", "type": "assigned_variable", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L199_C4", "vector": [14, 2, 0.6205, 0.003, 2, 0.93, 0.75, 516, 3, 1, 0, 0, 115, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "JntArray", "annotation": ""}, "snippet": " q = kdl.JntArray(nJnts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L207_C8", "label": "if", "type": "if", "loc": [207, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L199_C4", "vector": [4, 2, 0.6416, 0.0392, 2, 0.93, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ik_solver.CartToJnt(q_init,frame,q)>=0:\n for i in range(nJnts):\n q[i] = tr.angle_within_mod180(q[i])\n return q\n else:\n if arm == 'right_arm':\n ik_solver = self.cody_kdl[arm]['ik_p_nolim']\n if ik_solver.CartToJnt(q_init,frame,q)>=0:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L208_C12", "label": "for i", "type": "for", "loc": [208, 209], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L207_C8", "vector": [6, 3, 0.628, 0.006, 3, 0.55, 0.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(nJnts):\n q[i] = tr.angle_within_mod180(q[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L209_C16", "label": " = angle_within_mod180()", "type": "assigned_variable", "loc": [209, 209], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L208_C12", "vector": [14, 4, 0.6295, 0.003, 4, 0.89, 0.0, 0, 3, 1, 0, 0, 694, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "angle_within_mod180", "annotation": ""}, "snippet": " q[i] = tr.angle_within_mod180(q[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L210_C12", "label": "return", "type": "return", "loc": [210, 210], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L207_C8", "vector": [13, 3, 0.6325, 0.003, 3, 0.55, 0.25, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L212_C12", "label": "if", "type": "if", "loc": [212, 217], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L207_C8", "vector": [4, 3, 0.6461, 0.0181, 3, 0.55, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'right_arm':\n ik_solver = self.cody_kdl[arm]['ik_p_nolim']\n if ik_solver.CartToJnt(q_init,frame,q)>=0:\n for i in range(nJnts):\n q[i] = tr.angle_within_mod180(q[i])\n return q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L213_C16", "label": "ik_solver =", "type": "assigned_variable", "loc": [213, 213], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L212_C12", "vector": [14, 4, 0.6416, 0.003, 4, 0.54, 0.0, 705, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_solver", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_solver = self.cody_kdl[arm]['ik_p_nolim']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L214_C16", "label": "if", "type": "if", "loc": [214, 217], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L212_C12", "vector": [4, 4, 0.6491, 0.012, 4, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ik_solver.CartToJnt(q_init,frame,q)>=0:\n for i in range(nJnts):\n q[i] = tr.angle_within_mod180(q[i])\n return q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L215_C20", "label": "for i", "type": "for", "loc": [215, 216], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L214_C16", "vector": [6, 5, 0.6491, 0.006, 5, 0.91, 0.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(nJnts):\n q[i] = tr.angle_within_mod180(q[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L216_C24", "label": " = angle_within_mod180()", "type": "assigned_variable", "loc": [216, 216], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L215_C20", "vector": [14, 6, 0.6506, 0.003, 6, 0.9, 0.0, 0, 3, 1, 0, 0, 694, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "angle_within_mod180", "annotation": ""}, "snippet": " q[i] = tr.angle_within_mod180(q[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L217_C20", "label": "return", "type": "return", "loc": [217, 217], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L214_C16", "vector": [13, 5, 0.6536, 0.003, 5, 0.91, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L218_C12", "label": "print()", "type": "expression", "loc": [218, 218], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L207_C8", "vector": [8, 3, 0.6566, 0.003, 3, 0.55, 0.75, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Error: could not calculate inverse kinematics')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L219_C12", "label": "return", "type": "return", "loc": [219, 219], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L207_C8", "vector": [13, 3, 0.6596, 0.003, 3, 0.55, 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_99746:FunctionDef_L221_C4", "label": "FK_rot", "type": "function", "loc": [221, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "vector": [2, 1, 0.6687, 0.009, 1, 0.6, 0.5882, 586, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "FK_rot", "arg_names": ["self", "arm", "q", "link_number"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def FK_rot(self, arm, q, link_number = 7):\n pos, rot = self.FK_all(arm, q, link_number)\n return rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L222_C8", "label": "pos, rot = FK_all()", "type": "assigned_variable", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L221_C4", "vector": [14, 2, 0.6687, 0.003, 2, 0.94, 0.0, 298, 3, 3, 0, 0, 415, 10, 1], "semantic": {"name": "pos, rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK_all", "annotation": ""}, "snippet": " pos, rot = self.FK_all(arm, q, link_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L223_C8", "label": "return", "type": "return", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L221_C4", "vector": [13, 2, 0.6717, 0.003, 2, 0.94, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L229_C4", "label": "FK", "type": "function", "loc": [229, 231], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "vector": [2, 1, 0.6928, 0.009, 1, 0.6, 0.6471, 252, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "FK", "arg_names": ["self", "arm", "q", "link_number"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def FK(self, arm, q, link_number = 7):\n pos, rot = self.FK_all(arm, q, link_number)\n return pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L230_C8", "label": "pos, rot = FK_all()", "type": "assigned_variable", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L229_C4", "vector": [14, 2, 0.6928, 0.003, 2, 0.84, 0.0, 298, 3, 3, 0, 0, 415, 10, 1], "semantic": {"name": "pos, rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK_all", "annotation": ""}, "snippet": " pos, rot = self.FK_all(arm, q, link_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L231_C8", "label": "return", "type": "return", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L229_C4", "vector": [13, 2, 0.6958, 0.003, 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 pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L233_C4", "label": "FK_all", "type": "function", "loc": [233, 240], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "vector": [2, 1, 0.7123, 0.0241, 1, 0.6, 0.7059, 415, 0, 4, 1, 0, 0, 0, 4], "semantic": {"name": "FK_all", "arg_names": ["self", "arm", "q", "link_number"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def FK_all(self, arm, q, link_number = 7):\n q = self.meka_angles_to_kdl(arm, q)\n frame = self.FK_kdl(arm, q, link_number)\n pos = frame.p\n pos = ku.kdl_vec_to_np(pos)\n m = frame.M\n rot = ku.kdl_rot_to_np(m)\n return pos, rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L234_C8", "label": "q = meka_angles_to_kdl()", "type": "assigned_variable", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L233_C4", "vector": [14, 2, 0.7048, 0.003, 2, 0.05, 0.0, 516, 3, 2, 0, 0, 278, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "meka_angles_to_kdl", "annotation": ""}, "snippet": " q = self.meka_angles_to_kdl(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L235_C8", "label": "frame = FK_kdl()", "type": "assigned_variable", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L233_C4", "vector": [14, 2, 0.7078, 0.003, 2, 0.05, 0.1667, 313, 3, 3, 0, 0, 929, 10, 1], "semantic": {"name": "frame", "arg_names": [], "import_names": [], "rhs_call_name": "FK_kdl", "annotation": ""}, "snippet": " frame = self.FK_kdl(arm, q, link_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L236_C8", "label": "pos =", "type": "assigned_variable", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L233_C4", "vector": [14, 2, 0.7108, 0.003, 2, 0.05, 0.3333, 627, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = frame.p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L237_C8", "label": "pos = kdl_vec_to_np()", "type": "assigned_variable", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L233_C4", "vector": [14, 2, 0.7139, 0.003, 2, 0.05, 0.5, 627, 3, 1, 0, 0, 707, 10, 1], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "kdl_vec_to_np", "annotation": ""}, "snippet": " pos = ku.kdl_vec_to_np(pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L238_C8", "label": "m =", "type": "assigned_variable", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L233_C4", "vector": [14, 2, 0.7169, 0.003, 2, 0.05, 0.6667, 711, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m = frame.M"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L239_C8", "label": "rot = kdl_rot_to_np()", "type": "assigned_variable", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L233_C4", "vector": [14, 2, 0.7199, 0.003, 2, 0.05, 0.8333, 812, 3, 1, 0, 0, 380, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "kdl_rot_to_np", "annotation": ""}, "snippet": " rot = ku.kdl_rot_to_np(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L240_C8", "label": "return", "type": "return", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L233_C4", "vector": [13, 2, 0.7229, 0.003, 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 pos, rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L242_C4", "label": "Jac", "type": "function", "loc": [242, 250], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "vector": [2, 1, 0.741, 0.0271, 1, 0.6, 0.7647, 115, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "Jac", "arg_names": ["self", "arm", "q"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def Jac(self,arm,q):\n ''' q - list of 7 joint angles (meka axes) in RADIANS.\n arm - 'right_arm' or 'left_arm'\n returns 6x7 numpy matrix.\n '''\n jntarr = self.meka_angles_to_kdl(arm,q)\n kdl_jac = self.Jac_kdl(arm,jntarr)\n meka_jac = -kdl_jac # the kdl jacobian is the negative of meka jacobian (see kdl_angles_to_meka)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L243_C8", "label": "expression", "type": "expression", "loc": [243, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L242_C4", "vector": [8, 2, 0.7364, 0.012, 2, 0.76, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' q - list of 7 joint angles (meka axes) in RADIANS.\n arm - 'right_arm' or 'left_arm'\n returns 6x7 numpy matrix.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L247_C8", "label": "jntarr = meka_angles_to_kdl()", "type": "assigned_variable", "loc": [247, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L242_C4", "vector": [14, 2, 0.744, 0.003, 2, 0.76, 0.25, 140, 3, 2, 0, 0, 278, 10, 1], "semantic": {"name": "jntarr", "arg_names": [], "import_names": [], "rhs_call_name": "meka_angles_to_kdl", "annotation": ""}, "snippet": " jntarr = self.meka_angles_to_kdl(arm,q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L248_C8", "label": "kdl_jac = Jac_kdl()", "type": "assigned_variable", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L242_C4", "vector": [14, 2, 0.747, 0.003, 2, 0.76, 0.5, 33, 3, 2, 0, 0, 295, 10, 1], "semantic": {"name": "kdl_jac", "arg_names": [], "import_names": [], "rhs_call_name": "Jac_kdl", "annotation": ""}, "snippet": " kdl_jac = self.Jac_kdl(arm,jntarr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L249_C8", "label": "meka_jac =", "type": "assigned_variable", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L242_C4", "vector": [14, 2, 0.75, 0.003, 2, 0.76, 0.75, 798, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "meka_jac", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " meka_jac = -kdl_jac # the kdl jacobian is the negative of meka jacobian (see kdl_angles_to_meka)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L250_C8", "label": "return", "type": "return", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L242_C4", "vector": [13, 2, 0.753, 0.003, 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 meka_jac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L254_C4", "label": "Jacobian", "type": "function", "loc": [254, 269], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "vector": [2, 1, 0.7877, 0.0482, 1, 0.6, 0.8235, 182, 0, 4, 1, 0, 0, 0, 13], "semantic": {"name": "Jacobian", "arg_names": ["self", "arm", "q", "pos"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def Jacobian(self, arm, q, pos):\n chain = self.cody_kdl[arm]['chain']\n v_list = []\n w_list = []\n for i in range(7):\n p, rot = self.FK_all(arm, q, i)\n r = pos - p\n z_idx = chain.getSegment(i).getJoint().getType() - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L255_C8", "label": "chain =", "type": "assigned_variable", "loc": [255, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L254_C4", "vector": [14, 2, 0.7681, 0.003, 2, 0.39, 0.0, 271, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "chain", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " chain = self.cody_kdl[arm]['chain']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L256_C8", "label": "v_list =", "type": "assigned_variable", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L254_C4", "vector": [14, 2, 0.7711, 0.003, 2, 0.39, 0.1667, 218, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "v_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L257_C8", "label": "w_list =", "type": "assigned_variable", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L254_C4", "vector": [14, 2, 0.7741, 0.003, 2, 0.39, 0.3333, 821, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "w_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " w_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L258_C8", "label": "for i", "type": "for", "loc": [258, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L254_C4", "vector": [6, 2, 0.7861, 0.0211, 2, 0.39, 0.5, 826, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(7):\n p, rot = self.FK_all(arm, q, i)\n r = pos - p\n z_idx = chain.getSegment(i).getJoint().getType() - 1\n z = rot[:, z_idx]\n v_list.append(np.matrix(np.cross(z.A1, r.A1)).T)\n w_list.append(z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L259_C12", "label": "p, rot = FK_all()", "type": "assigned_variable", "loc": [259, 259], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L258_C8", "vector": [14, 3, 0.7801, 0.003, 3, 0.92, 0.0, 466, 3, 3, 0, 0, 415, 10, 1], "semantic": {"name": "p, rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK_all", "annotation": ""}, "snippet": " p, rot = self.FK_all(arm, q, i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L260_C12", "label": "r =", "type": "assigned_variable", "loc": [260, 260], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L258_C8", "vector": [14, 3, 0.7831, 0.003, 3, 0.92, 0.2, 436, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = pos - p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L261_C12", "label": "z_idx =", "type": "assigned_variable", "loc": [261, 261], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L258_C8", "vector": [14, 3, 0.7861, 0.003, 3, 0.92, 0.4, 160, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "z_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_idx = chain.getSegment(i).getJoint().getType() - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L262_C12", "label": "z =", "type": "assigned_variable", "loc": [262, 262], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L258_C8", "vector": [14, 3, 0.7892, 0.003, 3, 0.92, 0.6, 859, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = rot[:, z_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L263_C12", "label": "append()", "type": "expression", "loc": [263, 263], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L258_C8", "vector": [8, 3, 0.7922, 0.003, 3, 0.92, 0.8, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " v_list.append(np.matrix(np.cross(z.A1, r.A1)).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L264_C12", "label": "append()", "type": "expression", "loc": [264, 264], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L258_C8", "vector": [8, 3, 0.7952, 0.003, 3, 0.92, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " w_list.append(z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L266_C8", "label": "J = row_stack()", "type": "assigned_variable", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L254_C4", "vector": [14, 2, 0.8012, 0.003, 2, 0.39, 0.6667, 946, 3, 1, 0, 0, 612, 10, 3], "semantic": {"name": "J", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " J = np.row_stack((np.column_stack(v_list), np.column_stack(w_list)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L268_C8", "label": "J = Jac()", "type": "assigned_variable", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L254_C4", "vector": [14, 2, 0.8072, 0.003, 2, 0.39, 0.8333, 946, 3, 2, 0, 0, 115, 10, 1], "semantic": {"name": "J", "arg_names": [], "import_names": [], "rhs_call_name": "Jac", "annotation": ""}, "snippet": " J = self.Jac(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L269_C8", "label": "return", "type": "return", "loc": [269, 269], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L254_C4", "vector": [13, 2, 0.8102, 0.003, 2, 0.39, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return J"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L278_C4", "label": "IK", "type": "function", "loc": [278, 308], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "vector": [2, 1, 0.8825, 0.0934, 1, 0.6, 0.8824, 719, 0, 5, 1, 0, 0, 0, 14], "semantic": {"name": "IK", "arg_names": ["self", "arm", "p", "rot", "q_guess"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def IK(self,arm,p,rot,q_guess=None):\n p_kdl = ku.np_vec_to_kdl(p)\n rot_kdl = ku.np_rot_to_kdl(rot)\n fr = kdl.Frame(rot_kdl,p_kdl)\n\n if q_guess == None:\n if arm == 'left_arm':\n q_guess = cgd.find_good_config(p,self.q_guess_dict_left)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L279_C8", "label": "p_kdl = np_vec_to_kdl()", "type": "assigned_variable", "loc": [279, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L278_C4", "vector": [14, 2, 0.8404, 0.003, 2, 0.53, 0.0, 133, 3, 1, 0, 0, 918, 10, 1], "semantic": {"name": "p_kdl", "arg_names": [], "import_names": [], "rhs_call_name": "np_vec_to_kdl", "annotation": ""}, "snippet": " p_kdl = ku.np_vec_to_kdl(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L280_C8", "label": "rot_kdl = np_rot_to_kdl()", "type": "assigned_variable", "loc": [280, 280], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L278_C4", "vector": [14, 2, 0.8434, 0.003, 2, 0.53, 0.1429, 165, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "rot_kdl", "arg_names": [], "import_names": [], "rhs_call_name": "np_rot_to_kdl", "annotation": ""}, "snippet": " rot_kdl = ku.np_rot_to_kdl(rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L281_C8", "label": "fr = Frame()", "type": "assigned_variable", "loc": [281, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L278_C4", "vector": [14, 2, 0.8464, 0.003, 2, 0.53, 0.2857, 6, 3, 2, 0, 0, 342, 10, 1], "semantic": {"name": "fr", "arg_names": [], "import_names": [], "rhs_call_name": "Frame", "annotation": ""}, "snippet": " fr = kdl.Frame(rot_kdl,p_kdl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L283_C8", "label": "if", "type": "if", "loc": [283, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L278_C4", "vector": [4, 2, 0.8584, 0.0151, 2, 0.53, 0.4286, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if q_guess == None:\n if arm == 'left_arm':\n q_guess = cgd.find_good_config(p,self.q_guess_dict_left)\n elif arm == 'right_arm': \n q_guess = cgd.find_good_config(p,self.q_guess_dict_right)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L284_C12", "label": "if", "type": "if", "loc": [284, 287], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L283_C8", "vector": [4, 3, 0.8599, 0.012, 3, 0.15, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'left_arm':\n q_guess = cgd.find_good_config(p,self.q_guess_dict_left)\n elif arm == 'right_arm': \n q_guess = cgd.find_good_config(p,self.q_guess_dict_right)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L285_C16", "label": "q_guess = find_good_config()", "type": "assigned_variable", "loc": [285, 285], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L284_C12", "vector": [14, 4, 0.8584, 0.003, 4, 0.1, 0.0, 993, 3, 2, 0, 0, 858, 10, 1], "semantic": {"name": "q_guess", "arg_names": [], "import_names": [], "rhs_call_name": "find_good_config", "annotation": ""}, "snippet": " q_guess = cgd.find_good_config(p,self.q_guess_dict_left)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L286_C12", "label": "if", "type": "if", "loc": [286, 287], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L284_C12", "vector": [4, 4, 0.863, 0.006, 4, 0.1, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif arm == 'right_arm': \n q_guess = cgd.find_good_config(p,self.q_guess_dict_right)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L287_C16", "label": "q_guess = find_good_config()", "type": "assigned_variable", "loc": [287, 287], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L286_C12", "vector": [14, 5, 0.8645, 0.003, 5, 0.09, 0.0, 993, 3, 2, 0, 0, 858, 10, 1], "semantic": {"name": "q_guess", "arg_names": [], "import_names": [], "rhs_call_name": "find_good_config", "annotation": ""}, "snippet": " q_guess = cgd.find_good_config(p,self.q_guess_dict_right)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L289_C8", "label": "q_guess = meka_angles_to_kdl()", "type": "assigned_variable", "loc": [289, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L278_C4", "vector": [14, 2, 0.8705, 0.003, 2, 0.53, 0.5714, 993, 3, 2, 0, 0, 278, 10, 1], "semantic": {"name": "q_guess", "arg_names": [], "import_names": [], "rhs_call_name": "meka_angles_to_kdl", "annotation": ""}, "snippet": " q_guess = self.meka_angles_to_kdl(arm,q_guess)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L291_C8", "label": "q_res = IK_kdl()", "type": "assigned_variable", "loc": [291, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L278_C4", "vector": [14, 2, 0.8765, 0.003, 2, 0.53, 0.7143, 881, 3, 3, 0, 0, 753, 10, 1], "semantic": {"name": "q_res", "arg_names": [], "import_names": [], "rhs_call_name": "IK_kdl", "annotation": ""}, "snippet": " q_res = self.IK_kdl(arm,fr,q_guess)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L292_C8", "label": "q_res = kdl_angles_to_meka()", "type": "assigned_variable", "loc": [292, 292], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L278_C4", "vector": [14, 2, 0.8795, 0.003, 2, 0.53, 0.8571, 881, 3, 2, 0, 0, 808, 10, 1], "semantic": {"name": "q_res", "arg_names": [], "import_names": [], "rhs_call_name": "kdl_angles_to_meka", "annotation": ""}, "snippet": " q_res = self.kdl_angles_to_meka(arm,q_res)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L294_C8", "label": "if", "type": "if", "loc": [294, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L278_C4", "vector": [4, 2, 0.9066, 0.0452, 2, 0.53, 1.0, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.within_joint_limits(arm,q_res):\n if arm == 'right_arm': \n if q_res[1]<0.:\n q_res[1] = math.radians(10.)\n qg = self.meka_angles_to_kdl(arm,q_res)\n q_res = self.IK_kdl(arm,fr,qg)\n q_res = self.kdl_angles_to_meka(arm,q_res)\n if self.within_joint_limits(arm,q_res):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L295_C12", "label": "if", "type": "if", "loc": [295, 306], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L294_C8", "vector": [4, 3, 0.9051, 0.0361, 3, 0.87, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'right_arm': \n if q_res[1]<0.:\n q_res[1] = math.radians(10.)\n qg = self.meka_angles_to_kdl(arm,q_res)\n q_res = self.IK_kdl(arm,fr,qg)\n q_res = self.kdl_angles_to_meka(arm,q_res)\n if self.within_joint_limits(arm,q_res):\n return q_res"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L296_C16", "label": "if", "type": "if", "loc": [296, 300], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L295_C12", "vector": [4, 4, 0.8976, 0.0151, 4, 0.49, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if q_res[1]<0.:\n q_res[1] = math.radians(10.)\n qg = self.meka_angles_to_kdl(arm,q_res)\n q_res = self.IK_kdl(arm,fr,qg)\n q_res = self.kdl_angles_to_meka(arm,q_res)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L297_C20", "label": " = radians()", "type": "assigned_variable", "loc": [297, 297], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L296_C16", "vector": [14, 5, 0.8946, 0.003, 5, 0.78, 0.0, 0, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " q_res[1] = math.radians(10.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L298_C20", "label": "qg = meka_angles_to_kdl()", "type": "assigned_variable", "loc": [298, 298], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L296_C16", "vector": [14, 5, 0.8976, 0.003, 5, 0.78, 0.3333, 927, 3, 2, 0, 0, 278, 10, 1], "semantic": {"name": "qg", "arg_names": [], "import_names": [], "rhs_call_name": "meka_angles_to_kdl", "annotation": ""}, "snippet": " qg = self.meka_angles_to_kdl(arm,q_res)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L299_C20", "label": "q_res = IK_kdl()", "type": "assigned_variable", "loc": [299, 299], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L296_C16", "vector": [14, 5, 0.9006, 0.003, 5, 0.78, 0.6667, 881, 3, 3, 0, 0, 753, 10, 1], "semantic": {"name": "q_res", "arg_names": [], "import_names": [], "rhs_call_name": "IK_kdl", "annotation": ""}, "snippet": " q_res = self.IK_kdl(arm,fr,qg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L300_C20", "label": "q_res = kdl_angles_to_meka()", "type": "assigned_variable", "loc": [300, 300], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L296_C16", "vector": [14, 5, 0.9036, 0.003, 5, 0.78, 1.0, 881, 3, 2, 0, 0, 808, 10, 1], "semantic": {"name": "q_res", "arg_names": [], "import_names": [], "rhs_call_name": "kdl_angles_to_meka", "annotation": ""}, "snippet": " q_res = self.kdl_angles_to_meka(arm,q_res)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L301_C16", "label": "if", "type": "if", "loc": [301, 304], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L295_C12", "vector": [4, 4, 0.9111, 0.012, 4, 0.49, 0.5, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.within_joint_limits(arm,q_res):\n return q_res\n else:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L302_C20", "label": "return", "type": "return", "loc": [302, 302], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L301_C16", "vector": [13, 5, 0.9096, 0.003, 5, 0.27, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return q_res"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L304_C20", "label": "return", "type": "return", "loc": [304, 304], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L301_C16", "vector": [13, 5, 0.9157, 0.003, 5, 0.27, 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_99746:Return_L306_C16", "label": "return", "type": "return", "loc": [306, 306], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L295_C12", "vector": [13, 4, 0.9217, 0.003, 4, 0.49, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return q_res"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L308_C12", "label": "return", "type": "return", "loc": [308, 308], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L294_C8", "vector": [13, 3, 0.9277, 0.003, 3, 0.87, 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_99746:FunctionDef_L314_C4", "label": "clamp_to_joint_limits", "type": "function", "loc": [314, 320], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "vector": [2, 1, 0.9548, 0.0211, 1, 0.6, 0.9412, 606, 0, 4, 1, 0, 0, 0, 3], "semantic": {"name": "clamp_to_joint_limits", "arg_names": ["self", "arm", "q", "delta_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def clamp_to_joint_limits(self, arm, q, delta_list=[0.,0.,0.,0.,0.,0.,0.]):\n d = self.joint_lim_dict[arm]\n max_arr = d['max']\n min_arr = d['min']\n q_arr = np.array(q)\n d_arr = np.array(delta_list)\n return np.clip(q_arr, min_arr-d_arr, max_arr+d_arr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L315_C8", "label": "d =", "type": "assigned_variable", "loc": [315, 315], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L314_C4", "vector": [14, 2, 0.9488, 0.003, 2, 0.96, 0.0, 355, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = self.joint_lim_dict[arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L316_C8", "label": "max_arr =", "type": "assigned_variable", "loc": [316, 316], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L314_C4", "vector": [14, 2, 0.9518, 0.003, 2, 0.96, 0.2, 605, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_arr = d['max']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L317_C8", "label": "min_arr =", "type": "assigned_variable", "loc": [317, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L314_C4", "vector": [14, 2, 0.9548, 0.003, 2, 0.96, 0.4, 34, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "min_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_arr = d['min']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L318_C8", "label": "q_arr = array()", "type": "assigned_variable", "loc": [318, 318], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L314_C4", "vector": [14, 2, 0.9578, 0.003, 2, 0.96, 0.6, 918, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "q_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " q_arr = np.array(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L319_C8", "label": "d_arr = array()", "type": "assigned_variable", "loc": [319, 319], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L314_C4", "vector": [14, 2, 0.9608, 0.003, 2, 0.96, 0.8, 301, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "d_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " d_arr = np.array(delta_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L320_C8", "label": "return", "type": "return", "loc": [320, 320], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L314_C4", "vector": [13, 2, 0.9639, 0.003, 2, 0.96, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.clip(q_arr, min_arr-d_arr, max_arr+d_arr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L322_C4", "label": "within_joint_limits", "type": "function", "loc": [322, 328], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "vector": [2, 1, 0.9789, 0.0211, 1, 0.6, 1.0, 596, 0, 4, 1, 0, 0, 0, 3], "semantic": {"name": "within_joint_limits", "arg_names": ["self", "arm", "q", "delta_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def within_joint_limits(self, arm, q, delta_list=[0.,0.,0.,0.,0.,0.,0.]):\n d = self.joint_lim_dict[arm]\n max_arr = d['max']\n min_arr = d['min']\n q_arr = np.array(q)\n d_arr = np.array(delta_list)\n return np.all((q_arr <= max_arr+d_arr, q_arr >= min_arr-d_arr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L323_C8", "label": "d =", "type": "assigned_variable", "loc": [323, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L322_C4", "vector": [14, 2, 0.9729, 0.003, 2, 0.56, 0.0, 355, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = self.joint_lim_dict[arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L324_C8", "label": "max_arr =", "type": "assigned_variable", "loc": [324, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L322_C4", "vector": [14, 2, 0.9759, 0.003, 2, 0.56, 0.2, 605, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_arr = d['max']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L325_C8", "label": "min_arr =", "type": "assigned_variable", "loc": [325, 325], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L322_C4", "vector": [14, 2, 0.9789, 0.003, 2, 0.56, 0.4, 34, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "min_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_arr = d['min']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L326_C8", "label": "q_arr = array()", "type": "assigned_variable", "loc": [326, 326], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L322_C4", "vector": [14, 2, 0.9819, 0.003, 2, 0.56, 0.6, 918, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "q_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " q_arr = np.array(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L327_C8", "label": "d_arr = array()", "type": "assigned_variable", "loc": [327, 327], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L322_C4", "vector": [14, 2, 0.9849, 0.003, 2, 0.56, 0.8, 301, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "d_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " d_arr = np.array(delta_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L328_C8", "label": "return", "type": "return", "loc": [328, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L322_C4", "vector": [13, 2, 0.988, 0.003, 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 np.all((q_arr <= max_arr+d_arr, q_arr >= min_arr-d_arr))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L108_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L108_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L108_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L137_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L138_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L139_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L140_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L141_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L176_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L178_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L176_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L180_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L176_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L181_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L207_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L208_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L208_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L209_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L207_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L210_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L207_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L212_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L212_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L213_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L212_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L214_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L214_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L215_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L215_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L216_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L214_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L217_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L207_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L218_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L207_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L219_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L229_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L229_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L229_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L242_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L254_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L258_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L259_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L258_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L260_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L258_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L261_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L258_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L262_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L258_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L263_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:For_L258_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Expr_L264_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L278_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L280_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L283_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L284_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L284_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L285_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L284_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L286_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L286_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L287_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L289_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L291_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L292_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L294_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L294_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L295_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L295_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L296_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L296_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L297_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L296_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L298_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L296_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L299_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L296_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L300_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L295_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L301_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L301_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L302_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L301_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L304_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L295_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L306_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:If_L294_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L308_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L314_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L316_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L317_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L318_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L319_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L320_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L322_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L323_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L324_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L325_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L326_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Assign_L327_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99746:FunctionDef_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99746:Return_L328_C8"}]
# # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Author: Advait Jain import arms as ar import math, numpy as np import sys, optparse import roslib; roslib.load_manifest('epc_core') import hrl_lib.transforms as tr import hrl_lib.util as ut def find_good_config(pt,dict): ''' finds a good configuration for the 3x1 pt. ''' m = dict['cart_pts_mat'] min_idx = np.argmin(ut.norm(m-pt)) c = dict['good_configs_list'][min_idx] # print 'good configuration:', [math.degrees(qi) for qi in c] return c def test_dict(fname): dict = ut.load_pickle(fname) firenze = ar.M3HrlRobot(connect=False) rot = tr.rotY(math.radians(-90)) p = np.matrix([0.4,-0.42,-0.2]).T c = find_good_config(p,dict) res = firenze.IK(p,rot,q_guess=c) print 'IK soln: ', [math.degrees(qi) for qi in res] def create_dict(fname): firenze = ar.M3HrlRobot(connect=False) good_configs_list = ut.load_pickle(fname) cartesian_points_list = [] for gc in good_configs_list: cartesian_points_list.append(firenze.FK('right_arm',gc).A1.tolist()) m = np.matrix(cartesian_points_list).T print 'm.shape:', m.shape dict = {'cart_pts_mat':m, 'good_configs_list':good_configs_list} ut.save_pickle(dict,ut.formatted_time()+'_goodconf_dict.pkl') def record_good_configs(use_left_arm): import m3.toolbox as m3t settings_arm = ar.MekaArmSettings(stiffness_list=[0.,0.,0.,0.,0.],control_mode='torque_gc') if use_left_arm: firenze = ar.M3HrlRobot(connect=True,left_arm_settings=settings_arm) arm = 'left_arm' else: firenze = ar.M3HrlRobot(connect=True,right_arm_settings=settings_arm) arm = 'right_arm' print 'hit ENTER to start the recording process' k=m3t.get_keystroke() firenze.power_on() good_configs_list = [] while k == '\r': print 'hit ENTER to record configuration, something else to exit' k=m3t.get_keystroke() firenze.proxy.step() q = firenze.get_joint_angles(arm) good_configs_list.append(np.matrix(q).A1.tolist()) firenze.stop() ut.save_pickle(good_configs_list,ut.formatted_time()+'_good_configs_list.pkl') if __name__=='__main__': p = optparse.OptionParser() p.add_option('-r', action='store_true', dest='record', help='put robot in GC and record good configurations.') p.add_option('-c', action='store_true', dest='create', help='create table to map points to good configs. (needs a good_configs pkl)') p.add_option('-t', action='store_true', dest='test', help='find a good config for a cartesian point. (needs a dict pkl)') p.add_option('-f', action='store', type='string', dest='fname', help='pkl file to use.', default='') p.add_option('--ra', action='store_true', dest='right', help='choose the right arm') p.add_option('--la', action='store_true', dest='left', help='choose the left arm') opt, args = p.parse_args() record = opt.record create = opt.create test = opt.test fname = opt.fname use_left_arm = opt.left use_right_arm = opt.right if test: if fname == '': print 'Specify a file name.' sys.exit() test_dict(fname) elif create: if fname == '': print 'Specify a file name.' sys.exit() create_dict(fname) elif record: if use_right_arm == None and use_left_arm == None: print 'Please specify either left or right arm. (--ra or --la)' print 'Exiting...' sys.exit() record_good_configs(use_left_arm) else: print 'Please specify either record or create.'
ajibawa-2023/Python-Code-Large/train/row_99747
83
143
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Import_L30_C0", "label": "arms import ar", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.2098, 0.007, 0, 0.66, 0.0, 375, 0, 1, 0, 0, 375, 0, 0], "semantic": {"name": "arms", "arg_names": [], "import_names": ["ar"], "rhs_call_name": "", "annotation": ""}, "snippet": "import arms as ar"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Import_L31_C0", "label": "math import math, np", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.2168, 0.007, 0, 0.66, 0.0909, 526, 0, 2, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math", "np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math, numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Import_L32_C0", "label": "sys import sys, optparse", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.2238, 0.007, 0, 0.66, 0.1818, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "optparse"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, optparse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Import_L34_C0", "label": "roslib import roslib", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.2378, 0.007, 0, 0.66, 0.2727, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('epc_core')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L34_C15", "label": "load_manifest()", "type": "expression", "loc": [34, 34], "level": 0, "parent": null, "vector": [8, 0, 0.2378, 0.007, 0, 0.66, 0.3636, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('epc_core')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Import_L35_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.2448, 0.007, 0, 0.66, 0.4545, 82, 0, 1, 0, 0, 82, 0, 0], "semantic": {"name": "hrl_lib.transforms", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Import_L36_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.2517, 0.007, 0, 0.66, 0.5455, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L38_C0", "label": "find_good_config", "type": "function", "loc": [38, 45], "level": 0, "parent": null, "vector": [2, 0, 0.2902, 0.0559, 0, 0.66, 0.6364, 858, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "find_good_config", "arg_names": ["pt", "dict"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def find_good_config(pt,dict):\n ''' finds a good configuration for the 3x1 pt.\n '''\n m = dict['cart_pts_mat']\n min_idx = np.argmin(ut.norm(m-pt))\n c = dict['good_configs_list'][min_idx]\n# print 'good configuration:', [math.degrees(qi) for qi in c]\n return c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L39_C4", "label": "expression", "type": "expression", "loc": [39, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L38_C0", "vector": [8, 1, 0.2762, 0.014, 1, 0.41, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' finds a good configuration for the 3x1 pt.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L41_C4", "label": "m =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L38_C0", "vector": [14, 1, 0.2867, 0.007, 1, 0.41, 0.25, 711, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m = dict['cart_pts_mat']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L42_C4", "label": "min_idx = argmin()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L38_C0", "vector": [14, 1, 0.2937, 0.007, 1, 0.41, 0.5, 912, 3, 1, 0, 0, 879, 10, 2], "semantic": {"name": "min_idx", "arg_names": [], "import_names": [], "rhs_call_name": "argmin", "annotation": ""}, "snippet": " min_idx = np.argmin(ut.norm(m-pt))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L43_C4", "label": "c =", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L38_C0", "vector": [14, 1, 0.3007, 0.007, 1, 0.41, 0.75, 411, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c = dict['good_configs_list'][min_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Return_L45_C4", "label": "return", "type": "return", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L38_C0", "vector": [13, 1, 0.3147, 0.007, 1, 0.41, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L47_C0", "label": "test_dict", "type": "function", "loc": [47, 56], "level": 0, "parent": null, "vector": [2, 0, 0.3601, 0.0699, 0, 0.66, 0.7273, 108, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "test_dict", "arg_names": ["fname"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_dict(fname):\n dict = ut.load_pickle(fname)\n firenze = ar.M3HrlRobot(connect=False)\n\n rot = tr.rotY(math.radians(-90))\n p = np.matrix([0.4,-0.42,-0.2]).T\n\n c = find_good_config(p,dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L48_C4", "label": "dict = load_pickle()", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L47_C0", "vector": [14, 1, 0.3357, 0.007, 1, 0.02, 0.0, 827, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "dict", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " dict = ut.load_pickle(fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L49_C4", "label": "firenze = M3HrlRobot()", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L47_C0", "vector": [14, 1, 0.3427, 0.007, 1, 0.02, 0.1667, 736, 3, 1, 0, 0, 305, 10, 1], "semantic": {"name": "firenze", "arg_names": [], "import_names": [], "rhs_call_name": "M3HrlRobot", "annotation": ""}, "snippet": " firenze = ar.M3HrlRobot(connect=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L51_C4", "label": "rot = rotY()", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L47_C0", "vector": [14, 1, 0.3566, 0.007, 1, 0.02, 0.3333, 812, 3, 1, 0, 0, 649, 10, 2], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "rotY", "annotation": ""}, "snippet": " rot = tr.rotY(math.radians(-90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L52_C4", "label": "p =", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L47_C0", "vector": [14, 1, 0.3636, 0.007, 1, 0.02, 0.5, 491, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = np.matrix([0.4,-0.42,-0.2]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L54_C4", "label": "c = find_good_config()", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L47_C0", "vector": [14, 1, 0.3776, 0.007, 1, 0.02, 0.6667, 411, 3, 2, 0, 0, 858, 10, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "find_good_config", "annotation": ""}, "snippet": " c = find_good_config(p,dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L55_C4", "label": "res = IK()", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L47_C0", "vector": [14, 1, 0.3846, 0.007, 1, 0.02, 0.8333, 413, 3, 3, 0, 0, 719, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " res = firenze.IK(p,rot,q_guess=c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L56_C4", "label": "print()", "type": "expression", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L47_C0", "vector": [8, 1, 0.3916, 0.007, 1, 0.02, 1.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('IK soln: ', [math.degrees(qi) for qi in res])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L58_C0", "label": "create_dict", "type": "function", "loc": [58, 68], "level": 0, "parent": null, "vector": [2, 0, 0.4406, 0.0769, 0, 0.66, 0.8182, 849, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "create_dict", "arg_names": ["fname"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_dict(fname):\n firenze = ar.M3HrlRobot(connect=False)\n good_configs_list = ut.load_pickle(fname)\n cartesian_points_list = []\n for gc in good_configs_list:\n cartesian_points_list.append(firenze.FK('right_arm',gc).A1.tolist())\n\n m = np.matrix(cartesian_points_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L59_C4", "label": "firenze = M3HrlRobot()", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L58_C0", "vector": [14, 1, 0.4126, 0.007, 1, 0.0, 0.0, 736, 3, 1, 0, 0, 305, 10, 1], "semantic": {"name": "firenze", "arg_names": [], "import_names": [], "rhs_call_name": "M3HrlRobot", "annotation": ""}, "snippet": " firenze = ar.M3HrlRobot(connect=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L60_C4", "label": "good_configs_list = load_pickle()", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L58_C0", "vector": [14, 1, 0.4196, 0.007, 1, 0.0, 0.1429, 698, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "good_configs_list", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " good_configs_list = ut.load_pickle(fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L61_C4", "label": "cartesian_points_list =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L58_C0", "vector": [14, 1, 0.4266, 0.007, 1, 0.0, 0.2857, 190, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "cartesian_points_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cartesian_points_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:For_L62_C4", "label": "for gc", "type": "for", "loc": [62, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L58_C0", "vector": [6, 1, 0.4371, 0.014, 1, 0.0, 0.4286, 92, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "gc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for gc in good_configs_list:\n cartesian_points_list.append(firenze.FK('right_arm',gc).A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L63_C8", "label": "append()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:For_L62_C4", "vector": [8, 2, 0.4406, 0.007, 2, 0.05, 0.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " cartesian_points_list.append(firenze.FK('right_arm',gc).A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L65_C4", "label": "m =", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L58_C0", "vector": [14, 1, 0.4545, 0.007, 1, 0.0, 0.5714, 711, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m = np.matrix(cartesian_points_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L66_C4", "label": "print()", "type": "expression", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L58_C0", "vector": [8, 1, 0.4615, 0.007, 1, 0.0, 0.7143, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('m.shape:', m.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L67_C4", "label": "dict =", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L58_C0", "vector": [14, 1, 0.4685, 0.007, 1, 0.0, 0.8571, 827, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dict = {'cart_pts_mat':m, 'good_configs_list':good_configs_list}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L68_C4", "label": "save_pickle()", "type": "expression", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L58_C0", "vector": [8, 1, 0.4755, 0.007, 1, 0.0, 1.0, 390, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(dict,ut.formatted_time()+'_goodconf_dict.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L71_C0", "label": "record_good_configs", "type": "function", "loc": [71, 96], "level": 0, "parent": null, "vector": [2, 0, 0.5839, 0.1818, 0, 0.66, 0.9091, 421, 0, 1, 0, 0, 0, 0, 16], "semantic": {"name": "record_good_configs", "arg_names": ["use_left_arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def record_good_configs(use_left_arm):\n import m3.toolbox as m3t\n settings_arm = ar.MekaArmSettings(stiffness_list=[0.,0.,0.,0.,0.],control_mode='torque_gc')\n\n if use_left_arm:\n firenze = ar.M3HrlRobot(connect=True,left_arm_settings=settings_arm)\n arm = 'left_arm'\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Import_L72_C4", "label": "m3.toolbox import m3t", "type": "import", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L71_C0", "vector": [1, 1, 0.5035, 0.007, 1, 0.62, 0.0, 478, 0, 1, 0, 0, 478, 0, 0], "semantic": {"name": "m3.toolbox", "arg_names": [], "import_names": ["m3t"], "rhs_call_name": "", "annotation": ""}, "snippet": " import m3.toolbox as m3t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L73_C4", "label": "settings_arm = MekaArmSettings()", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L71_C0", "vector": [14, 1, 0.5105, 0.007, 1, 0.62, 0.1111, 447, 3, 2, 0, 0, 503, 10, 1], "semantic": {"name": "settings_arm", "arg_names": [], "import_names": [], "rhs_call_name": "MekaArmSettings", "annotation": ""}, "snippet": " settings_arm = ar.MekaArmSettings(stiffness_list=[0.,0.,0.,0.,0.],control_mode='torque_gc')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L75_C4", "label": "if", "type": "if", "loc": [75, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L71_C0", "vector": [4, 1, 0.542, 0.042, 1, 0.62, 0.2222, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if use_left_arm:\n firenze = ar.M3HrlRobot(connect=True,left_arm_settings=settings_arm)\n arm = 'left_arm'\n else:\n firenze = ar.M3HrlRobot(connect=True,right_arm_settings=settings_arm)\n arm = 'right_arm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L76_C8", "label": "firenze = M3HrlRobot()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L75_C4", "vector": [14, 2, 0.5315, 0.007, 2, 0.83, 0.0, 736, 3, 2, 0, 0, 305, 10, 1], "semantic": {"name": "firenze", "arg_names": [], "import_names": [], "rhs_call_name": "M3HrlRobot", "annotation": ""}, "snippet": " firenze = ar.M3HrlRobot(connect=True,left_arm_settings=settings_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L77_C8", "label": "arm =", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L75_C4", "vector": [14, 2, 0.5385, 0.007, 2, 0.83, 0.3333, 413, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = 'left_arm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L79_C8", "label": "firenze = M3HrlRobot()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L75_C4", "vector": [14, 2, 0.5524, 0.007, 2, 0.83, 0.6667, 736, 3, 2, 0, 0, 305, 10, 1], "semantic": {"name": "firenze", "arg_names": [], "import_names": [], "rhs_call_name": "M3HrlRobot", "annotation": ""}, "snippet": " firenze = ar.M3HrlRobot(connect=True,right_arm_settings=settings_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L80_C8", "label": "arm =", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L75_C4", "vector": [14, 2, 0.5594, 0.007, 2, 0.83, 1.0, 413, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = 'right_arm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L82_C4", "label": "print()", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L71_C0", "vector": [8, 1, 0.5734, 0.007, 1, 0.62, 0.3333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('hit ENTER to start the recording process')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L83_C4", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L71_C0", "vector": [14, 1, 0.5804, 0.007, 1, 0.62, 0.4444, 954, 3, 0, 0, 0, 773, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "get_keystroke", "annotation": ""}, "snippet": " k=m3t.get_keystroke()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L84_C4", "label": "power_on()", "type": "expression", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L71_C0", "vector": [8, 1, 0.5874, 0.007, 1, 0.62, 0.5556, 777, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "power_on", "arg_names": [], "import_names": [], "rhs_call_name": "power_on", "annotation": ""}, "snippet": " firenze.power_on()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L86_C4", "label": "good_configs_list =", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L71_C0", "vector": [14, 1, 0.6014, 0.007, 1, 0.62, 0.6667, 698, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "good_configs_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " good_configs_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:While_L88_C4", "label": "while", "type": "while", "loc": [88, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L71_C0", "vector": [5, 1, 0.6329, 0.042, 1, 0.62, 0.7778, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while k == '\\r':\n print('hit ENTER to record configuration, something else to exit')\n k=m3t.get_keystroke()\n firenze.proxy.step()\n q = firenze.get_joint_angles(arm)\n good_configs_list.append(np.matrix(q).A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L89_C8", "label": "print()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:While_L88_C4", "vector": [8, 2, 0.6224, 0.007, 2, 0.73, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('hit ENTER to record configuration, something else to exit')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L90_C8", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:While_L88_C4", "vector": [14, 2, 0.6294, 0.007, 2, 0.73, 0.25, 954, 3, 0, 0, 0, 773, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "get_keystroke", "annotation": ""}, "snippet": " k=m3t.get_keystroke()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L91_C8", "label": "step()", "type": "expression", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:While_L88_C4", "vector": [8, 2, 0.6364, 0.007, 2, 0.73, 0.5, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " firenze.proxy.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L92_C8", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:While_L88_C4", "vector": [14, 2, 0.6434, 0.007, 2, 0.73, 0.75, 516, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " q = firenze.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L93_C8", "label": "append()", "type": "expression", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:While_L88_C4", "vector": [8, 2, 0.6503, 0.007, 2, 0.73, 1.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " good_configs_list.append(np.matrix(q).A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L95_C4", "label": "stop()", "type": "expression", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L71_C0", "vector": [8, 1, 0.6643, 0.007, 1, 0.62, 0.8889, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " firenze.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L96_C4", "label": "save_pickle()", "type": "expression", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L71_C0", "vector": [8, 1, 0.6713, 0.007, 1, 0.62, 1.0, 390, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(good_configs_list,ut.formatted_time()+'_good_configs_list.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "label": "if", "type": "if", "loc": [100, 141], "level": 0, "parent": null, "vector": [4, 0, 0.8427, 0.2937, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 19], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__=='__main__':\n p = optparse.OptionParser()\n p.add_option('-r', action='store_true', dest='record',\n help='put robot in GC and record good configurations.')\n p.add_option('-c', action='store_true', dest='create',\n help='create table to map points to good configs. (needs a good_configs pkl)')\n p.add_option('-t', action='store_true', dest='test',\n help='find a good config for a cartesian point. (needs a dict pkl)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L101_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "vector": [14, 1, 0.7063, 0.007, 1, 0.02, 0.0, 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_99747:Expr_L102_C4", "label": "add_option()", "type": "expression", "loc": [102, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "vector": [8, 1, 0.7168, 0.014, 1, 0.02, 0.0714, 176, 3, 4, 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_true', dest='record',\n help='put robot in GC and record good configurations.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L104_C4", "label": "add_option()", "type": "expression", "loc": [104, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "vector": [8, 1, 0.7308, 0.014, 1, 0.02, 0.1429, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-c', action='store_true', dest='create',\n help='create table to map points to good configs. (needs a good_configs pkl)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L106_C4", "label": "add_option()", "type": "expression", "loc": [106, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "vector": [8, 1, 0.7448, 0.014, 1, 0.02, 0.2143, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-t', action='store_true', dest='test',\n help='find a good config for a cartesian point. (needs a dict pkl)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L108_C4", "label": "add_option()", "type": "expression", "loc": [108, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "vector": [8, 1, 0.7587, 0.014, 1, 0.02, 0.2857, 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('-f', action='store', type='string', dest='fname',\n help='pkl file to use.', default='')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L110_C4", "label": "add_option()", "type": "expression", "loc": [110, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "vector": [8, 1, 0.7727, 0.014, 1, 0.02, 0.3571, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--ra', action='store_true', dest='right',\n help='choose the right arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L112_C4", "label": "add_option()", "type": "expression", "loc": [112, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "vector": [8, 1, 0.7867, 0.014, 1, 0.02, 0.4286, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--la', action='store_true', dest='left',\n help='choose the left arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L115_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "vector": [14, 1, 0.8042, 0.007, 1, 0.02, 0.5, 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_99747:Assign_L116_C4", "label": "record =", "type": "assigned_variable", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "vector": [14, 1, 0.8112, 0.007, 1, 0.02, 0.5714, 667, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "record", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " record = opt.record"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L117_C4", "label": "create =", "type": "assigned_variable", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "vector": [14, 1, 0.8182, 0.007, 1, 0.02, 0.6429, 316, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "create", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " create = opt.create"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L118_C4", "label": "test =", "type": "assigned_variable", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "vector": [14, 1, 0.8252, 0.007, 1, 0.02, 0.7143, 224, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test = opt.test"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L119_C4", "label": "fname =", "type": "assigned_variable", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "vector": [14, 1, 0.8322, 0.007, 1, 0.02, 0.7857, 190, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fname = opt.fname"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L120_C4", "label": "use_left_arm =", "type": "assigned_variable", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "vector": [14, 1, 0.8392, 0.007, 1, 0.02, 0.8571, 26, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "use_left_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " use_left_arm = opt.left"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L121_C4", "label": "use_right_arm =", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "vector": [14, 1, 0.8462, 0.007, 1, 0.02, 0.9286, 634, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "use_right_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " use_right_arm = opt.right"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L123_C4", "label": "if", "type": "if", "loc": [123, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "vector": [4, 1, 0.9231, 0.1329, 1, 0.02, 1.0, 0, 2, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test:\n if fname == '':\n print('Specify a file name.')\n sys.exit()\n test_dict(fname)\n elif create:\n if fname == '':\n print('Specify a file name.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L124_C8", "label": "if", "type": "if", "loc": [124, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L123_C4", "vector": [4, 2, 0.8741, 0.021, 2, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fname == '':\n print('Specify a file name.')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L125_C12", "label": "print()", "type": "expression", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L124_C8", "vector": [8, 3, 0.8741, 0.007, 3, 0.09, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Specify a file name.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L126_C12", "label": "exit()", "type": "expression", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L124_C8", "vector": [8, 3, 0.8811, 0.007, 3, 0.09, 1.0, 436, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L127_C8", "label": "test_dict()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L123_C4", "vector": [8, 2, 0.8881, 0.007, 2, 0.71, 0.5, 108, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "test_dict", "arg_names": [], "import_names": [], "rhs_call_name": "test_dict", "annotation": ""}, "snippet": " test_dict(fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L128_C4", "label": "if", "type": "if", "loc": [128, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L123_C4", "vector": [4, 2, 0.9406, 0.0979, 2, 0.71, 1.0, 0, 2, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif create:\n if fname == '':\n print('Specify a file name.')\n sys.exit()\n create_dict(fname)\n elif record:\n if use_right_arm == None and use_left_arm == None:\n print('Please specify either left or right arm. (--ra or --la)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L129_C8", "label": "if", "type": "if", "loc": [129, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L128_C4", "vector": [4, 3, 0.9091, 0.021, 3, 0.8, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fname == '':\n print('Specify a file name.')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L130_C12", "label": "print()", "type": "expression", "loc": [130, 130], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L129_C8", "vector": [8, 4, 0.9091, 0.007, 4, 0.41, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Specify a file name.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L131_C12", "label": "exit()", "type": "expression", "loc": [131, 131], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L129_C8", "vector": [8, 4, 0.9161, 0.007, 4, 0.41, 1.0, 436, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L132_C8", "label": "create_dict()", "type": "expression", "loc": [132, 132], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L128_C4", "vector": [8, 3, 0.9231, 0.007, 3, 0.8, 0.5, 849, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "create_dict", "arg_names": [], "import_names": [], "rhs_call_name": "create_dict", "annotation": ""}, "snippet": " create_dict(fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L133_C4", "label": "if", "type": "if", "loc": [133, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L128_C4", "vector": [4, 3, 0.958, 0.0629, 3, 0.8, 1.0, 0, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif record:\n if use_right_arm == None and use_left_arm == None:\n print('Please specify either left or right arm. (--ra or --la)')\n print('Exiting...')\n sys.exit()\n\n record_good_configs(use_left_arm)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L134_C8", "label": "if", "type": "if", "loc": [134, 137], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L133_C4", "vector": [4, 4, 0.9476, 0.028, 4, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if use_right_arm == None and use_left_arm == None:\n print('Please specify either left or right arm. (--ra or --la)')\n print('Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L135_C12", "label": "print()", "type": "expression", "loc": [135, 135], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L134_C8", "vector": [8, 5, 0.9441, 0.007, 5, 0.31, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Please specify either left or right arm. (--ra or --la)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L136_C12", "label": "print()", "type": "expression", "loc": [136, 136], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L134_C8", "vector": [8, 5, 0.951, 0.007, 5, 0.31, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Exiting...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L137_C12", "label": "exit()", "type": "expression", "loc": [137, 137], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L134_C8", "vector": [8, 5, 0.958, 0.007, 5, 0.31, 1.0, 436, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L139_C8", "label": "record_good_configs()", "type": "expression", "loc": [139, 139], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L133_C4", "vector": [8, 4, 0.972, 0.007, 4, 0.71, 0.5, 421, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "record_good_configs", "arg_names": [], "import_names": [], "rhs_call_name": "record_good_configs", "annotation": ""}, "snippet": " record_good_configs(use_left_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L141_C8", "label": "print()", "type": "expression", "loc": [141, 141], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L133_C4", "vector": [8, 4, 0.986, 0.007, 4, 0.71, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Please specify either record or create.')"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Return_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:For_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:For_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Import_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:While_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:While_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:While_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:While_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:While_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:While_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99747:If_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99747:Expr_L141_C8"}]
# # subscribe to thw joint angles and raw forces topics, and provide FK # etc. # # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Author: Advait Jain import math import numpy as np import copy import sys, time, os from threading import RLock import roslib; roslib.load_manifest('epc_core') import rospy import hrl_lib.viz as hv from hrl_msgs.msg import FloatArray from roslib.msg import Header from std_msgs.msg import Bool from std_msgs.msg import Empty from std_srvs.srv import Empty as Empty_srv from visualization_msgs.msg import Marker # used in client and server. def get_joint_name_dict(): joint_names_list = {} joint_names_list['right_arm'] = ['m3joint_ma1_j%d'%i for i in range(7)] joint_names_list['left_arm'] = ['m3joint_ma2_j%d'%i for i in range(7)] return joint_names_list class MekaArmClient(): ## # @param arms: object of the ArmKinematics class. def __init__(self, arms): self.cb_lock = RLock() self.r_arm_jep = None self.l_arm_jep = None self.r_arm_alpha = None self.l_arm_alpha = None self.r_arm_q = None self.l_arm_q = None self.r_arm_force = None self.r_arm_raw_force = None self.l_arm_force = None self.l_arm_raw_force = None self.pwr_state = False self.left_arm_ft = {'force': np.matrix(np.zeros((3,1),dtype='float32')), 'torque': np.matrix(np.zeros((3,1),dtype='float32'))} self.right_arm_ft = {'force': np.matrix(np.zeros((3,1),dtype='float32')), 'torque': np.matrix(np.zeros((3,1),dtype='float32'))} self.fts_bias = {'left_arm': self.left_arm_ft, 'right_arm': self.right_arm_ft} self.arms = arms self.joint_names_list = get_joint_name_dict() self.r_jep_cmd_pub = rospy.Publisher('/r_arm/command/jep', FloatArray) self.l_jep_cmd_pub = rospy.Publisher('/l_arm/command/jep', FloatArray) self.r_alph_cmd_pub = rospy.Publisher('/r_arm/command/joint_impedance_scale', FloatArray) self.l_alph_cmd_pub = rospy.Publisher('/l_arm/command/joint_impedance_scale', FloatArray) self.stop_pub = rospy.Publisher('/arms/stop', Empty) self.motors_off_pub = rospy.Publisher('/arms/command/motors_off', Empty) self.cep_marker_pub = rospy.Publisher('/arms/viz/cep', Marker) rospy.Subscriber('/r_arm/jep', FloatArray, self.r_arm_jep_cb) rospy.Subscriber('/l_arm/jep', FloatArray, self.l_arm_jep_cb) rospy.Subscriber('/r_arm/joint_impedance_scale', FloatArray, self.r_arm_alpha_cb) rospy.Subscriber('/l_arm/joint_impedance_scale', FloatArray, self.l_arm_alpha_cb) rospy.Subscriber('/r_arm/q', FloatArray, self.r_arm_q_cb) rospy.Subscriber('/l_arm/q', FloatArray, self.l_arm_q_cb) rospy.Subscriber('/r_arm/force', FloatArray, self.r_arm_force_cb) rospy.Subscriber('/l_arm/force', FloatArray, self.l_arm_force_cb) rospy.Subscriber('/r_arm/force_raw', FloatArray, self.r_arm_raw_force_cb) rospy.Subscriber('/l_arm/force_raw', FloatArray, self.l_arm_raw_force_cb) rospy.Subscriber('/arms/pwr_state', Bool, self.pwr_state_cb) rospy.wait_for_service('toggle_floating_arms') self.toggle_floating_arms = rospy.ServiceProxy('toggle_floating_arms', Empty_srv) try: rospy.init_node('cody_arm_client', anonymous=True) except rospy.ROSException: pass #---------- ROS callbacks ----------------- def pwr_state_cb(self, msg): self.cb_lock.acquire() self.pwr_state = msg.data self.cb_lock.release() def r_arm_jep_cb(self, msg): self.cb_lock.acquire() self.r_arm_jep = list(msg.data) self.cb_lock.release() # publish the CEP marker. cep, r = self.arms.FK_all('right_arm', self.r_arm_jep) o = np.matrix([0.,0.,0.,1.]).T cep_marker = hv.single_marker(cep, o, 'sphere', '/torso_lift_link', color=(0., 0., 1., 1.), scale = (0.02, 0.02, 0.02), duration=0.) cep_marker.header.stamp = msg.header.stamp self.cep_marker_pub.publish(cep_marker) def l_arm_jep_cb(self, msg): self.cb_lock.acquire() self.l_arm_jep = list(msg.data) self.cb_lock.release() def r_arm_alpha_cb(self, msg): self.cb_lock.acquire() self.r_arm_alpha = list(msg.data) self.cb_lock.release() def l_arm_alpha_cb(self, msg): self.cb_lock.acquire() self.l_arm_alpha = list(msg.data) self.cb_lock.release() def r_arm_q_cb(self, msg): self.cb_lock.acquire() self.r_arm_q = list(msg.data) self.cb_lock.release() def l_arm_q_cb(self, msg): self.cb_lock.acquire() self.l_arm_q = list(msg.data) self.cb_lock.release() def r_arm_force_cb(self, msg): self.cb_lock.acquire() self.r_arm_force = msg.data self.cb_lock.release() def l_arm_force_cb(self, msg): self.cb_lock.acquire() self.l_arm_force = msg.data self.cb_lock.release() def r_arm_raw_force_cb(self, msg): self.cb_lock.acquire() self.r_arm_raw_force = msg.data self.cb_lock.release() def l_arm_raw_force_cb(self, msg): self.cb_lock.acquire() self.l_arm_raw_force = msg.data self.cb_lock.release() #--------- functions to use ----------------- ## Returns the current position, rotation of the arm. # @param arm 0 for right, 1 for left # @return position, rotation def end_effector_pos(self, arm): q = self.get_joint_angles(arm) return self.arms.FK_all(arm, q) ## # @return list of 7 joint angles. def get_joint_angles(self, arm): self.cb_lock.acquire() if arm == 'right_arm': q = copy.copy(self.r_arm_q) elif arm == 'left_arm': q = copy.copy(self.l_arm_q) else: self.cb_lock.release() raise RuntimeError('Undefined arm: %s'%(arm)) self.cb_lock.release() return q def get_wrist_force(self, arm, bias=True, base_frame=False, filtered = True): self.cb_lock.acquire() if arm == 'right_arm': if filtered: f = copy.copy(self.r_arm_force) else: f = copy.copy(self.r_arm_raw_force) elif arm == 'left_arm': if filtered: f = copy.copy(self.l_arm_force) else: f = copy.copy(self.l_arm_raw_force) else: self.cb_lock.release() raise RuntimeError('Undefined arm: %s'%(arm)) self.cb_lock.release() f_mat = np.matrix(f).T if bias: f_mat = f_mat - self.fts_bias[arm]['force'] if base_frame: q = self.get_joint_angles(arm) rot = self.arms.FK_rot(arm, q) f_mat = rot*f_mat return f_mat def bias_wrist_ft(self, arm): f_list = [] t_list = [] print 'Starting biasing...' for i in range(20): f_list.append(self.get_wrist_force(arm, bias=False)) rospy.sleep(0.02) f_b = np.mean(np.column_stack(f_list), 1) # torque is unimplemented. t_b = self.get_wrist_torque(arm, bias=False) self.fts_bias[arm]['force'] = f_b self.fts_bias[arm]['torque'] = t_b print 'self.fts_bias[arm][\'force\']', self.fts_bias[arm]['force'] print 'arm:', arm print '...done' ## # @return list of floats b/w 0 and 1. def get_impedance_scale(self, arm): self.cb_lock.acquire() if arm == 'right_arm': sc = copy.copy(self.r_arm_alpha) elif arm == 'left_arm': sc = copy.copy(self.l_arm_alpha) else: self.cb_lock.release() raise RuntimeError('Undefined arm: %s'%(arm)) self.cb_lock.release() return sc ## # @param s - list of floats b/w 0 and 1. def set_impedance_scale(self, arm, s): if arm == 'right_arm': pub = self.r_alph_cmd_pub elif arm == 'left_arm': pub = self.l_alph_cmd_pub else: raise RuntimeError('Undefined arm: %s'%(arm)) time_stamp = rospy.Time.now() h = Header() h.stamp = time_stamp pub.publish(FloatArray(h, s)) def get_jep(self, arm): self.cb_lock.acquire() if arm == 'right_arm': jep = copy.copy(self.r_arm_jep) elif arm == 'left_arm': jep = copy.copy(self.l_arm_jep) else: self.cb_lock.release() raise RuntimeError('Undefined arm: %s'%(arm)) self.cb_lock.release() return jep ## # @param q - list of 7 joint angles in RADIANS. according to meka's coordinate frames. # @param duration - for compatibility with the PR2 class. def set_jep(self, arm, q, duration=None): if arm == 'right_arm': pub = self.r_jep_cmd_pub elif arm == 'left_arm': pub = self.l_jep_cmd_pub else: raise RuntimeError('Undefined arm: %s'%(arm)) time_stamp = rospy.Time.now() h = Header() h.stamp = time_stamp pub.publish(FloatArray(h, q)) ## #Function that commands the arm(s) to incrementally move to a jep #@param speed the max angular speed (in radians per second) #@return 'reach' def go_jep(self, arm, q, stopping_function=None, speed=math.radians(30)): if speed>math.radians(90.): speed = math.radians(90.) qs_list,qe_list,ns_list,qstep_list = [],[],[],[] done_list = [] time_between_cmds = 0.025 #qs = np.matrix(self.get_joint_angles(arm)) qs = np.matrix(self.get_jep(arm)) qe = np.matrix(q) max_change = np.max(np.abs(qe-qs)) total_time = max_change/speed n_steps = int(total_time/time_between_cmds+0.5) qstep = (qe-qs)/n_steps if stopping_function != None: done = stopping_function() else: done = False step_number = 0 t0 = rospy.Time.now().to_time() t_end = t0 while done==False: t_end += time_between_cmds t1 = rospy.Time.now().to_time() if stopping_function != None: done = stopping_function() if step_number < n_steps and done == False: q = (qs + step_number*qstep).A1.tolist() self.set_jep(arm, q) else: done = True while t1 < t_end: if stopping_function != None: done = done or stopping_function() rospy.sleep(time_between_cmds/5) t1 = rospy.Time.now().to_time() step_number += 1 rospy.sleep(time_between_cmds) return 'reach' # Expect this to crash the program because sending a stop crashes # the meka server def stop(self): self.stop_pub.publish() def is_motor_power_on(self): return self.pwr_state def go_cep(self, arm, p, rot, speed = 0.10, stopping_function = None, q_guess = None): q = self.arms.IK(arm, p, rot, q_guess) if q == None: print 'IK soln NOT found.' print 'trying to reach p= ', p return 'fail' else: q_start = np.matrix(self.get_joint_angles(arm)) p_start = self.arms.FK(arm, q_start.A1.tolist()) q_end = np.matrix(q) dist = np.linalg.norm(p-p_start) total_time = dist/speed max_change = np.max(np.abs(q_end-q_start)) ang_speed = max_change/total_time return self.go_jep(arm, q, stopping_function, speed=ang_speed) ## # linearly interpolates the commanded cep. # @param arm - 'left_arm' or 'right_arm' # @param p - 3x1 np matrix # @param rot - rotation matrix # @param speed - linear speed (m/s) # @param stopping_function - returns True or False # @return string (reason for stopping) def go_cep_interpolate(self, arm, p, rot=None, speed=0.10, stopping_function=None): rot = None # Rotational interpolation not implemented right now. time_between_cmds = 0.025 q_guess = self.get_jep(arm) cep = self.arms.FK(arm, q_guess) if rot == None: rot = self.arms.FK_rot(arm, q_guess) vec = p-cep dist = np.linalg.norm(vec) total_time = dist/speed n_steps = int(total_time/time_between_cmds + 0.5) vec = vec/dist vec = vec * speed * time_between_cmds pt = cep all_done = False i = 0 t0 = rospy.Time.now().to_time() t_end = t0 while all_done==False: t_end += time_between_cmds t1 = rospy.Time.now().to_time() pt = pt + vec q = self.arms.IK(arm, pt, rot, q_guess) if q == None: all_done = True stop = 'IK fail' continue self.set_jep(arm, q) q_guess = q while t1<t_end: if stopping_function != None: all_done = stopping_function() if all_done: stop = 'Stopping Condition' break rospy.sleep(time_between_cmds/5) t1 = rospy.Time.now().to_time() i+=1 if i == n_steps: all_done = True stop = '' return stop ## # @param vec - displacement vector (base frame) # @param q_guess - previous JEP? # @return string def move_till_hit(self, arm, vec=np.matrix([0.3,0.,0.]).T, force_threshold=3.0, speed=0.1, bias_FT=True): unit_vec = vec/np.linalg.norm(vec) def stopping_function(): force = self.get_wrist_force(arm, base_frame = True) force_projection = force.T*unit_vec *-1 # projection in direction opposite to motion. if force_projection>force_threshold: return True elif np.linalg.norm(force)>45.: return True else: return False jep = self.get_jep(arm) cep, rot = self.arms.FK_all(arm, jep) if bias_FT: self.bias_wrist_ft(arm) time.sleep(0.5) p = cep + vec return self.go_cep_interpolate(arm, p, rot, speed, stopping_function) def motors_off(self): self.motors_off_pub.publish() # def step(self): # rospy.sleep(0.01) #-------- unimplemented functions ----------------- # leaving this unimplemented for now. Advait Nov 14, 2010. def get_joint_velocities(self, arm): pass # leaving this unimplemented for now. Advait Nov 14, 2010. def get_joint_accelerations(self, arm): pass # leaving this unimplemented for now. Advait Nov 14, 2010. def get_joint_torques(self, arm): pass # leaving this unimplemented for now. Advait Nov 14, 2010. def get_wrist_torque(self, arm, bias=True): pass # leaving this unimplemented for now. Advait Nov 14, 2010. def power_on(self): pass # leaving this unimplemented for now. Advait Nov 14, 2010. # something to change and get arm_settings. if __name__ == '__main__': import arms as ar import m3.toolbox as m3t import hrl_lib.transforms as tr r_arm = 'right_arm' l_arm = 'left_arm' arms = ar.M3HrlRobot() ac = MekaArmClient(arms) # print FT sensor readings. if False: ac.bias_wrist_ft(r_arm) while not rospy.is_shutdown(): f = ac.get_wrist_force(r_arm) print 'f:', f.A1 rospy.sleep(0.05) # move the arms. if False: print 'hit a key to move the arms.' k=m3t.get_keystroke() rot_mat = tr.rotY(math.radians(-90)) p = np.matrix([0.3, -0.24, -0.3]).T # q = arms.IK(l_arm, p, rot_mat) # ac.go_jep(l_arm, q) # ac.go_cep(l_arm, p, rot_mat) ac.go_cep(r_arm, p, rot_mat) # jep = ac.get_jep(r_arm) # ac.go_jep(r_arm, jep) rospy.sleep(0.5) raw_input('Hit ENTER to print ee position') q = ac.get_joint_angles(r_arm) ee = ac.arms.FK(r_arm, q) print 'ee:', ee.A1 print 'desired ee:', p.A1 if False: print 'hit a key to float arms.' k=m3t.get_keystroke() ac.toggle_floating_arms() print 'hit a key to UNfloat arms.' k=m3t.get_keystroke() ac.toggle_floating_arms() #ac.move_till_hit(l_arm) #ac.motors_off() # ac.stop() if False: while not rospy.is_shutdown(): jep = ac.get_jep(r_arm) print 'jep:', jep rospy.sleep(0.05) if True: rospy.sleep(1.) isc = ac.get_impedance_scale(r_arm) print isc isc[1] = 0.3 ac.set_impedance_scale(r_arm, isc) rospy.sleep(1.) isc = ac.get_impedance_scale(r_arm) print isc
ajibawa-2023/Python-Code-Large/train/row_99748
352
577
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Import_L33_C0", "label": "math import math", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.0572, 0.0017, 0, 0.66, 0.0, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Import_L34_C0", "label": "numpy import np", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0589, 0.0017, 0, 0.66, 0.0588, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Import_L35_C0", "label": "copy import copy", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.0607, 0.0017, 0, 0.66, 0.1176, 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_99748:Import_L36_C0", "label": "sys import sys, time, os", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.0624, 0.0017, 0, 0.66, 0.1765, 509, 0, 3, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "time", "os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, time, os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:ImportFrom_L37_C0", "label": "from threading import RLock", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.0641, 0.0017, 0, 0.66, 0.2353, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["RLock"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import RLock"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Import_L39_C0", "label": "roslib import roslib", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.0676, 0.0017, 0, 0.66, 0.2941, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('epc_core')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L39_C15", "label": "load_manifest()", "type": "expression", "loc": [39, 39], "level": 0, "parent": null, "vector": [8, 0, 0.0676, 0.0017, 0, 0.66, 0.3529, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('epc_core')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Import_L40_C0", "label": "rospy import rospy", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.0693, 0.0017, 0, 0.66, 0.4118, 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_99748:Import_L42_C0", "label": "hrl_lib.viz import hv", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.0728, 0.0017, 0, 0.66, 0.4706, 48, 0, 1, 0, 0, 48, 0, 0], "semantic": {"name": "hrl_lib.viz", "arg_names": [], "import_names": ["hv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.viz as hv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:ImportFrom_L44_C0", "label": "from hrl_msgs.msg import FloatArray", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.0763, 0.0017, 0, 0.66, 0.5294, 513, 0, 1, 0, 0, 513, 0, 0], "semantic": {"name": "hrl_msgs.msg", "arg_names": [], "import_names": ["FloatArray"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_msgs.msg import FloatArray"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:ImportFrom_L45_C0", "label": "from roslib.msg import Header", "type": "import", "loc": [45, 45], "level": 0, "parent": null, "vector": [1, 0, 0.078, 0.0017, 0, 0.66, 0.5882, 276, 0, 1, 0, 0, 276, 0, 0], "semantic": {"name": "roslib.msg", "arg_names": [], "import_names": ["Header"], "rhs_call_name": "", "annotation": ""}, "snippet": "from roslib.msg import Header"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:ImportFrom_L46_C0", "label": "from std_msgs.msg import Bool", "type": "import", "loc": [46, 46], "level": 0, "parent": null, "vector": [1, 0, 0.0797, 0.0017, 0, 0.66, 0.6471, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Bool"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Bool"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:ImportFrom_L47_C0", "label": "from std_msgs.msg import Empty", "type": "import", "loc": [47, 47], "level": 0, "parent": null, "vector": [1, 0, 0.0815, 0.0017, 0, 0.66, 0.7059, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Empty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:ImportFrom_L49_C0", "label": "from std_srvs.srv import Empty_srv", "type": "import", "loc": [49, 49], "level": 0, "parent": null, "vector": [1, 0, 0.0849, 0.0017, 0, 0.66, 0.7647, 261, 0, 1, 0, 0, 261, 0, 0], "semantic": {"name": "std_srvs.srv", "arg_names": [], "import_names": ["Empty_srv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_srvs.srv import Empty as Empty_srv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:ImportFrom_L50_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [50, 50], "level": 0, "parent": null, "vector": [1, 0, 0.0867, 0.0017, 0, 0.66, 0.8235, 124, 0, 1, 0, 0, 124, 0, 0], "semantic": {"name": "visualization_msgs.msg", "arg_names": [], "import_names": ["Marker"], "rhs_call_name": "", "annotation": ""}, "snippet": "from visualization_msgs.msg import Marker"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L54_C0", "label": "get_joint_name_dict", "type": "function", "loc": [54, 58], "level": 0, "parent": null, "vector": [2, 0, 0.0971, 0.0087, 0, 0.66, 0.8824, 823, 0, 0, 1, 0, 0, 0, 2], "semantic": {"name": "get_joint_name_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_joint_name_dict():\n joint_names_list = {}\n joint_names_list['right_arm'] = ['m3joint_ma1_j%d'%i for i in range(7)]\n joint_names_list['left_arm'] = ['m3joint_ma2_j%d'%i for i in range(7)]\n return joint_names_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L55_C4", "label": "joint_names_list =", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L54_C0", "vector": [14, 1, 0.0953, 0.0017, 1, 0.39, 0.0, 69, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "joint_names_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joint_names_list = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L56_C4", "label": "assign", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L54_C0", "vector": [14, 1, 0.0971, 0.0017, 1, 0.39, 0.3333, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joint_names_list['right_arm'] = ['m3joint_ma1_j%d'%i for i in range(7)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L57_C4", "label": "assign", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L54_C0", "vector": [14, 1, 0.0988, 0.0017, 1, 0.39, 0.6667, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joint_names_list['left_arm'] = ['m3joint_ma2_j%d'%i for i in range(7)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L58_C4", "label": "return", "type": "return", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L54_C0", "vector": [13, 1, 0.1005, 0.0017, 1, 0.39, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return joint_names_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "label": "MekaArmClient", "type": "class", "loc": [61, 499], "level": 0, "parent": null, "vector": [3, 0, 0.4853, 0.7608, 0, 0.66, 0.9412, 267, 0, 33, 0, 0, 0, 0, 99], "semantic": {"name": "MekaArmClient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MekaArmClient():\n ##\n # @param arms: object of the ArmKinematics class.\n def __init__(self, arms):\n self.cb_lock = RLock()\n self.r_arm_jep = None\n self.l_arm_jep = None\n self.r_arm_alpha = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "label": "__init__", "type": "function", "loc": [64, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.1577, 0.0953, 1, 0.25, 0.0, 555, 0, 2, 0, 0, 0, 0, 31], "semantic": {"name": "__init__", "arg_names": ["self", "arms"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arms):\n self.cb_lock = RLock()\n self.r_arm_jep = None\n self.l_arm_jep = None\n self.r_arm_alpha = None\n self.l_arm_alpha = None\n self.r_arm_q = None\n self.l_arm_q = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L65_C8", "label": "self.cb_lock = RLock()", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1127, 0.0017, 2, 0.37, 0.0, 725, 3, 0, 0, 0, 207, 10, 1], "semantic": {"name": "self.cb_lock", "arg_names": [], "import_names": [], "rhs_call_name": "RLock", "annotation": ""}, "snippet": " self.cb_lock = RLock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L66_C8", "label": "self.r_arm_jep =", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1144, 0.0017, 2, 0.37, 0.027, 536, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.r_arm_jep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_arm_jep = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L67_C8", "label": "self.l_arm_jep =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1161, 0.0017, 2, 0.37, 0.0541, 891, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.l_arm_jep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l_arm_jep = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L68_C8", "label": "self.r_arm_alpha =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1179, 0.0017, 2, 0.37, 0.0811, 983, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.r_arm_alpha", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_arm_alpha = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L69_C8", "label": "self.l_arm_alpha =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1196, 0.0017, 2, 0.37, 0.1081, 561, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.l_arm_alpha", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l_arm_alpha = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L70_C8", "label": "self.r_arm_q =", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1213, 0.0017, 2, 0.37, 0.1351, 993, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.r_arm_q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_arm_q = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L71_C8", "label": "self.l_arm_q =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1231, 0.0017, 2, 0.37, 0.1622, 700, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.l_arm_q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l_arm_q = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L72_C8", "label": "self.r_arm_force =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1248, 0.0017, 2, 0.37, 0.1892, 996, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.r_arm_force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_arm_force = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L73_C8", "label": "self.r_arm_raw_force =", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1265, 0.0017, 2, 0.37, 0.2162, 89, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.r_arm_raw_force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_arm_raw_force = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L74_C8", "label": "self.l_arm_force =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1282, 0.0017, 2, 0.37, 0.2432, 818, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.l_arm_force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l_arm_force = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L75_C8", "label": "self.l_arm_raw_force =", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.13, 0.0017, 2, 0.37, 0.2703, 171, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.l_arm_raw_force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l_arm_raw_force = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L76_C8", "label": "self.pwr_state =", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1317, 0.0017, 2, 0.37, 0.2973, 989, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.pwr_state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pwr_state = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L78_C8", "label": "self.left_arm_ft =", "type": "assigned_variable", "loc": [78, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.136, 0.0035, 2, 0.37, 0.3243, 527, 0, 0, 0, 0, 0, 6, 4], "semantic": {"name": "self.left_arm_ft", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.left_arm_ft = {'force': np.matrix(np.zeros((3,1),dtype='float32')),\n 'torque': np.matrix(np.zeros((3,1),dtype='float32'))}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L80_C8", "label": "self.right_arm_ft =", "type": "assigned_variable", "loc": [80, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1395, 0.0035, 2, 0.37, 0.3514, 452, 0, 0, 0, 0, 0, 6, 4], "semantic": {"name": "self.right_arm_ft", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_arm_ft = {'force': np.matrix(np.zeros((3,1),dtype='float32')),\n 'torque': np.matrix(np.zeros((3,1),dtype='float32'))}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L82_C8", "label": "self.fts_bias =", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1421, 0.0017, 2, 0.37, 0.3784, 959, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.fts_bias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.fts_bias = {'left_arm': self.left_arm_ft, 'right_arm': self.right_arm_ft}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L83_C8", "label": "self.arms =", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1438, 0.0017, 2, 0.37, 0.4054, 495, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arms = arms"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L85_C8", "label": "self.joint_names_list = get_joint_name_dict()", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1473, 0.0017, 2, 0.37, 0.4324, 515, 3, 0, 0, 0, 823, 10, 1], "semantic": {"name": "self.joint_names_list", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_name_dict", "annotation": ""}, "snippet": " self.joint_names_list = get_joint_name_dict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L87_C8", "label": "self.r_jep_cmd_pub = Publisher()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1508, 0.0017, 2, 0.37, 0.4595, 901, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.r_jep_cmd_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.r_jep_cmd_pub = rospy.Publisher('/r_arm/command/jep', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L88_C8", "label": "self.l_jep_cmd_pub = Publisher()", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1525, 0.0017, 2, 0.37, 0.4865, 898, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.l_jep_cmd_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.l_jep_cmd_pub = rospy.Publisher('/l_arm/command/jep', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L89_C8", "label": "self.r_alph_cmd_pub = Publisher()", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1542, 0.0017, 2, 0.37, 0.5135, 396, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.r_alph_cmd_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.r_alph_cmd_pub = rospy.Publisher('/r_arm/command/joint_impedance_scale', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L90_C8", "label": "self.l_alph_cmd_pub = Publisher()", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.156, 0.0017, 2, 0.37, 0.5405, 232, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.l_alph_cmd_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.l_alph_cmd_pub = rospy.Publisher('/l_arm/command/joint_impedance_scale', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L91_C8", "label": "self.stop_pub = Publisher()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1577, 0.0017, 2, 0.37, 0.5676, 623, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.stop_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.stop_pub = rospy.Publisher('/arms/stop', Empty)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L92_C8", "label": "self.motors_off_pub = Publisher()", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1594, 0.0017, 2, 0.37, 0.5946, 690, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.motors_off_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.motors_off_pub = rospy.Publisher('/arms/command/motors_off', Empty)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L94_C8", "label": "self.cep_marker_pub = Publisher()", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1629, 0.0017, 2, 0.37, 0.6216, 265, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.cep_marker_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.cep_marker_pub = rospy.Publisher('/arms/viz/cep', Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L96_C8", "label": "Subscriber()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [8, 2, 0.1664, 0.0017, 2, 0.37, 0.6486, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/r_arm/jep', FloatArray, self.r_arm_jep_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L97_C8", "label": "Subscriber()", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [8, 2, 0.1681, 0.0017, 2, 0.37, 0.6757, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/l_arm/jep', FloatArray, self.l_arm_jep_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L98_C8", "label": "Subscriber()", "type": "expression", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [8, 2, 0.1698, 0.0017, 2, 0.37, 0.7027, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/r_arm/joint_impedance_scale', FloatArray, self.r_arm_alpha_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L99_C8", "label": "Subscriber()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [8, 2, 0.1716, 0.0017, 2, 0.37, 0.7297, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/l_arm/joint_impedance_scale', FloatArray, self.l_arm_alpha_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L101_C8", "label": "Subscriber()", "type": "expression", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [8, 2, 0.175, 0.0017, 2, 0.37, 0.7568, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/r_arm/q', FloatArray, self.r_arm_q_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L102_C8", "label": "Subscriber()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [8, 2, 0.1768, 0.0017, 2, 0.37, 0.7838, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/l_arm/q', FloatArray, self.l_arm_q_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L104_C8", "label": "Subscriber()", "type": "expression", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [8, 2, 0.1802, 0.0017, 2, 0.37, 0.8108, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/r_arm/force', FloatArray, self.r_arm_force_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L105_C8", "label": "Subscriber()", "type": "expression", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [8, 2, 0.182, 0.0017, 2, 0.37, 0.8378, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/l_arm/force', FloatArray, self.l_arm_force_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L106_C8", "label": "Subscriber()", "type": "expression", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [8, 2, 0.1837, 0.0017, 2, 0.37, 0.8649, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/r_arm/force_raw', FloatArray, self.r_arm_raw_force_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L107_C8", "label": "Subscriber()", "type": "expression", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [8, 2, 0.1854, 0.0017, 2, 0.37, 0.8919, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/l_arm/force_raw', FloatArray, self.l_arm_raw_force_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L109_C8", "label": "Subscriber()", "type": "expression", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [8, 2, 0.1889, 0.0017, 2, 0.37, 0.9189, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/arms/pwr_state', Bool, self.pwr_state_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L111_C8", "label": "wait_for_service()", "type": "expression", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [8, 2, 0.1924, 0.0017, 2, 0.37, 0.9459, 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('toggle_floating_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L112_C8", "label": "self.toggle_floating_arms = ServiceProxy()", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [14, 2, 0.1941, 0.0017, 2, 0.37, 0.973, 495, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.toggle_floating_arms", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.toggle_floating_arms = rospy.ServiceProxy('toggle_floating_arms', Empty_srv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Try_L115_C8", "label": "try", "type": "try", "loc": [115, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "vector": [7, 2, 0.2019, 0.0069, 2, 0.37, 1.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('cody_arm_client', anonymous=True)\n except rospy.ROSException:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L116_C12", "label": "init_node()", "type": "expression", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:Try_L115_C8", "vector": [8, 3, 0.201, 0.0017, 3, 0.97, 0.0, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('cody_arm_client', anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L121_C4", "label": "pwr_state_cb", "type": "function", "loc": [121, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.2123, 0.0069, 1, 0.25, 0.0323, 665, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "pwr_state_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pwr_state_cb(self, msg):\n self.cb_lock.acquire()\n self.pwr_state = msg.data\n self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L122_C8", "label": "acquire()", "type": "expression", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L121_C4", "vector": [8, 2, 0.2114, 0.0017, 2, 0.46, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L123_C8", "label": "self.pwr_state =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L121_C4", "vector": [14, 2, 0.2132, 0.0017, 2, 0.46, 0.5, 989, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.pwr_state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pwr_state = msg.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L124_C8", "label": "release()", "type": "expression", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L121_C4", "vector": [8, 2, 0.2149, 0.0017, 2, 0.46, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L126_C4", "label": "r_arm_jep_cb", "type": "function", "loc": [126, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.2296, 0.0243, 1, 0.25, 0.0645, 611, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "r_arm_jep_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def r_arm_jep_cb(self, msg):\n self.cb_lock.acquire()\n self.r_arm_jep = list(msg.data)\n self.cb_lock.release()\n\n # publish the CEP marker.\n cep, r = self.arms.FK_all('right_arm', self.r_arm_jep)\n o = np.matrix([0.,0.,0.,1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L127_C8", "label": "acquire()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L126_C4", "vector": [8, 2, 0.2201, 0.0017, 2, 0.37, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L128_C8", "label": "self.r_arm_jep = list()", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L126_C4", "vector": [14, 2, 0.2218, 0.0017, 2, 0.37, 0.1429, 536, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "self.r_arm_jep", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " self.r_arm_jep = list(msg.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L129_C8", "label": "release()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L126_C4", "vector": [8, 2, 0.2236, 0.0017, 2, 0.37, 0.2857, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L132_C8", "label": "cep, r = FK_all()", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L126_C4", "vector": [14, 2, 0.2288, 0.0017, 2, 0.37, 0.4286, 805, 3, 2, 0, 0, 415, 10, 1], "semantic": {"name": "cep, r", "arg_names": [], "import_names": [], "rhs_call_name": "FK_all", "annotation": ""}, "snippet": " cep, r = self.arms.FK_all('right_arm', self.r_arm_jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L133_C8", "label": "o =", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L126_C4", "vector": [14, 2, 0.2305, 0.0017, 2, 0.37, 0.5714, 926, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "o", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " o = np.matrix([0.,0.,0.,1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L134_C8", "label": "cep_marker = single_marker()", "type": "assigned_variable", "loc": [134, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L126_C4", "vector": [14, 2, 0.234, 0.0052, 2, 0.37, 0.7143, 414, 3, 7, 0, 0, 614, 10, 1], "semantic": {"name": "cep_marker", "arg_names": [], "import_names": [], "rhs_call_name": "single_marker", "annotation": ""}, "snippet": " cep_marker = hv.single_marker(cep, o, 'sphere',\n '/torso_lift_link', color=(0., 0., 1., 1.),\n scale = (0.02, 0.02, 0.02), duration=0.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L138_C8", "label": "cep_marker.header.stamp =", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L126_C4", "vector": [14, 2, 0.2392, 0.0017, 2, 0.37, 0.8571, 772, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cep_marker.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_marker.header.stamp = msg.header.stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L139_C8", "label": "publish()", "type": "expression", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L126_C4", "vector": [8, 2, 0.2409, 0.0017, 2, 0.37, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.cep_marker_pub.publish(cep_marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L141_C4", "label": "l_arm_jep_cb", "type": "function", "loc": [141, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.247, 0.0069, 1, 0.25, 0.0968, 742, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "l_arm_jep_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def l_arm_jep_cb(self, msg):\n self.cb_lock.acquire()\n self.l_arm_jep = list(msg.data)\n self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L142_C8", "label": "acquire()", "type": "expression", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L141_C4", "vector": [8, 2, 0.2461, 0.0017, 2, 0.07, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L143_C8", "label": "self.l_arm_jep = list()", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L141_C4", "vector": [14, 2, 0.2478, 0.0017, 2, 0.07, 0.5, 891, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "self.l_arm_jep", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " self.l_arm_jep = list(msg.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L144_C8", "label": "release()", "type": "expression", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L141_C4", "vector": [8, 2, 0.2496, 0.0017, 2, 0.07, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L146_C4", "label": "r_arm_alpha_cb", "type": "function", "loc": [146, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.2556, 0.0069, 1, 0.25, 0.129, 30, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "r_arm_alpha_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def r_arm_alpha_cb(self, msg):\n self.cb_lock.acquire()\n self.r_arm_alpha = list(msg.data)\n self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L147_C8", "label": "acquire()", "type": "expression", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L146_C4", "vector": [8, 2, 0.2548, 0.0017, 2, 0.18, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L148_C8", "label": "self.r_arm_alpha = list()", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L146_C4", "vector": [14, 2, 0.2565, 0.0017, 2, 0.18, 0.5, 983, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "self.r_arm_alpha", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " self.r_arm_alpha = list(msg.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L149_C8", "label": "release()", "type": "expression", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L146_C4", "vector": [8, 2, 0.2582, 0.0017, 2, 0.18, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L151_C4", "label": "l_arm_alpha_cb", "type": "function", "loc": [151, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.2643, 0.0069, 1, 0.25, 0.1613, 375, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "l_arm_alpha_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def l_arm_alpha_cb(self, msg):\n self.cb_lock.acquire()\n self.l_arm_alpha = list(msg.data)\n self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L152_C8", "label": "acquire()", "type": "expression", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L151_C4", "vector": [8, 2, 0.2634, 0.0017, 2, 0.55, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L153_C8", "label": "self.l_arm_alpha = list()", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L151_C4", "vector": [14, 2, 0.2652, 0.0017, 2, 0.55, 0.5, 561, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "self.l_arm_alpha", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " self.l_arm_alpha = list(msg.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L154_C8", "label": "release()", "type": "expression", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L151_C4", "vector": [8, 2, 0.2669, 0.0017, 2, 0.55, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L156_C4", "label": "r_arm_q_cb", "type": "function", "loc": [156, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.273, 0.0069, 1, 0.25, 0.1935, 24, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "r_arm_q_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def r_arm_q_cb(self, msg):\n self.cb_lock.acquire()\n self.r_arm_q = list(msg.data)\n self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L157_C8", "label": "acquire()", "type": "expression", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L156_C4", "vector": [8, 2, 0.2721, 0.0017, 2, 0.68, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L158_C8", "label": "self.r_arm_q = list()", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L156_C4", "vector": [14, 2, 0.2738, 0.0017, 2, 0.68, 0.5, 993, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "self.r_arm_q", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " self.r_arm_q = list(msg.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L159_C8", "label": "release()", "type": "expression", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L156_C4", "vector": [8, 2, 0.2756, 0.0017, 2, 0.68, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L161_C4", "label": "l_arm_q_cb", "type": "function", "loc": [161, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.2816, 0.0069, 1, 0.25, 0.2258, 753, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "l_arm_q_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def l_arm_q_cb(self, msg):\n self.cb_lock.acquire()\n self.l_arm_q = list(msg.data)\n self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L162_C8", "label": "acquire()", "type": "expression", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L161_C4", "vector": [8, 2, 0.2808, 0.0017, 2, 0.99, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L163_C8", "label": "self.l_arm_q = list()", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L161_C4", "vector": [14, 2, 0.2825, 0.0017, 2, 0.99, 0.5, 700, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "self.l_arm_q", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " self.l_arm_q = list(msg.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L164_C8", "label": "release()", "type": "expression", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L161_C4", "vector": [8, 2, 0.2842, 0.0017, 2, 0.99, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L166_C4", "label": "r_arm_force_cb", "type": "function", "loc": [166, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.2903, 0.0069, 1, 0.25, 0.2581, 911, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "r_arm_force_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def r_arm_force_cb(self, msg):\n self.cb_lock.acquire()\n self.r_arm_force = msg.data\n self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L167_C8", "label": "acquire()", "type": "expression", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L166_C4", "vector": [8, 2, 0.2894, 0.0017, 2, 0.71, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L168_C8", "label": "self.r_arm_force =", "type": "assigned_variable", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L166_C4", "vector": [14, 2, 0.2912, 0.0017, 2, 0.71, 0.5, 996, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.r_arm_force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_arm_force = msg.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L169_C8", "label": "release()", "type": "expression", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L166_C4", "vector": [8, 2, 0.2929, 0.0017, 2, 0.71, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L171_C4", "label": "l_arm_force_cb", "type": "function", "loc": [171, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.299, 0.0069, 1, 0.25, 0.2903, 174, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "l_arm_force_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def l_arm_force_cb(self, msg):\n self.cb_lock.acquire()\n self.l_arm_force = msg.data\n self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L172_C8", "label": "acquire()", "type": "expression", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L171_C4", "vector": [8, 2, 0.2981, 0.0017, 2, 0.64, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L173_C8", "label": "self.l_arm_force =", "type": "assigned_variable", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L171_C4", "vector": [14, 2, 0.2998, 0.0017, 2, 0.64, 0.5, 818, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.l_arm_force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l_arm_force = msg.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L174_C8", "label": "release()", "type": "expression", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L171_C4", "vector": [8, 2, 0.3016, 0.0017, 2, 0.64, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L176_C4", "label": "r_arm_raw_force_cb", "type": "function", "loc": [176, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.3076, 0.0069, 1, 0.25, 0.3226, 304, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "r_arm_raw_force_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def r_arm_raw_force_cb(self, msg):\n self.cb_lock.acquire()\n self.r_arm_raw_force = msg.data\n self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L177_C8", "label": "acquire()", "type": "expression", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L176_C4", "vector": [8, 2, 0.3068, 0.0017, 2, 0.01, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L178_C8", "label": "self.r_arm_raw_force =", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L176_C4", "vector": [14, 2, 0.3085, 0.0017, 2, 0.01, 0.5, 89, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.r_arm_raw_force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_arm_raw_force = msg.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L179_C8", "label": "release()", "type": "expression", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L176_C4", "vector": [8, 2, 0.3102, 0.0017, 2, 0.01, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L181_C4", "label": "l_arm_raw_force_cb", "type": "function", "loc": [181, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.3163, 0.0069, 1, 0.25, 0.3548, 294, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "l_arm_raw_force_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def l_arm_raw_force_cb(self, msg):\n self.cb_lock.acquire()\n self.l_arm_raw_force = msg.data\n self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L182_C8", "label": "acquire()", "type": "expression", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L181_C4", "vector": [8, 2, 0.3154, 0.0017, 2, 0.28, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L183_C8", "label": "self.l_arm_raw_force =", "type": "assigned_variable", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L181_C4", "vector": [14, 2, 0.3172, 0.0017, 2, 0.28, 0.5, 171, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.l_arm_raw_force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l_arm_raw_force = msg.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L184_C8", "label": "release()", "type": "expression", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L181_C4", "vector": [8, 2, 0.3189, 0.0017, 2, 0.28, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L191_C4", "label": "end_effector_pos", "type": "function", "loc": [191, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.3328, 0.0052, 1, 0.25, 0.3871, 889, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "end_effector_pos", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_effector_pos(self, arm):\n q = self.get_joint_angles(arm)\n return self.arms.FK_all(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L192_C8", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L191_C4", "vector": [14, 2, 0.3328, 0.0017, 2, 0.91, 0.0, 516, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " q = self.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L193_C8", "label": "return", "type": "return", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L191_C4", "vector": [13, 2, 0.3345, 0.0017, 2, 0.91, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.arms.FK_all(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L197_C4", "label": "get_joint_angles", "type": "function", "loc": [197, 207], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.3501, 0.0191, 1, 0.25, 0.4194, 820, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "get_joint_angles", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_joint_angles(self, arm):\n self.cb_lock.acquire()\n if arm == 'right_arm':\n q = copy.copy(self.r_arm_q)\n elif arm == 'left_arm':\n q = copy.copy(self.l_arm_q)\n else:\n self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L198_C8", "label": "acquire()", "type": "expression", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L197_C4", "vector": [8, 2, 0.3432, 0.0017, 2, 0.03, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L199_C8", "label": "if", "type": "if", "loc": [199, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L197_C4", "vector": [4, 2, 0.3501, 0.0121, 2, 0.03, 0.3333, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'right_arm':\n q = copy.copy(self.r_arm_q)\n elif arm == 'left_arm':\n q = copy.copy(self.l_arm_q)\n else:\n self.cb_lock.release()\n raise RuntimeError('Undefined arm: %s'%(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L200_C12", "label": "q = copy()", "type": "assigned_variable", "loc": [200, 200], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L199_C8", "vector": [14, 3, 0.3466, 0.0017, 3, 0.94, 0.0, 516, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " q = copy.copy(self.r_arm_q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L201_C8", "label": "if", "type": "if", "loc": [201, 205], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L199_C8", "vector": [4, 3, 0.3518, 0.0087, 3, 0.94, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif arm == 'left_arm':\n q = copy.copy(self.l_arm_q)\n else:\n self.cb_lock.release()\n raise RuntimeError('Undefined arm: %s'%(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L202_C12", "label": "q = copy()", "type": "assigned_variable", "loc": [202, 202], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L201_C8", "vector": [14, 4, 0.3501, 0.0017, 4, 0.55, 0.0, 516, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " q = copy.copy(self.l_arm_q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L204_C12", "label": "release()", "type": "expression", "loc": [204, 204], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L201_C8", "vector": [8, 4, 0.3536, 0.0017, 4, 0.55, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L206_C8", "label": "release()", "type": "expression", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L197_C4", "vector": [8, 2, 0.357, 0.0017, 2, 0.03, 0.6667, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L207_C8", "label": "return", "type": "return", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L197_C4", "vector": [13, 2, 0.3588, 0.0017, 2, 0.03, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L209_C4", "label": "get_wrist_force", "type": "function", "loc": [209, 235], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.3847, 0.0468, 1, 0.25, 0.4516, 854, 0, 5, 1, 0, 0, 0, 11], "semantic": {"name": "get_wrist_force", "arg_names": ["self", "arm", "bias", "base_frame", "filtered"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_wrist_force(self, arm, bias=True, base_frame=False,\n filtered = True):\n self.cb_lock.acquire()\n if arm == 'right_arm':\n if filtered:\n f = copy.copy(self.r_arm_force)\n else:\n f = copy.copy(self.r_arm_raw_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L211_C8", "label": "acquire()", "type": "expression", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L209_C4", "vector": [8, 2, 0.3657, 0.0017, 2, 0.85, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L212_C8", "label": "if", "type": "if", "loc": [212, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L209_C4", "vector": [4, 2, 0.3778, 0.0225, 2, 0.85, 0.1667, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'right_arm':\n if filtered:\n f = copy.copy(self.r_arm_force)\n else:\n f = copy.copy(self.r_arm_raw_force)\n elif arm == 'left_arm':\n if filtered:\n f = copy.copy(self.l_arm_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L213_C12", "label": "if", "type": "if", "loc": [213, 216], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L212_C8", "vector": [4, 3, 0.3718, 0.0069, 3, 0.43, 0.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if filtered:\n f = copy.copy(self.r_arm_force)\n else:\n f = copy.copy(self.r_arm_raw_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L214_C16", "label": "f = copy()", "type": "assigned_variable", "loc": [214, 214], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L213_C12", "vector": [14, 4, 0.3709, 0.0017, 4, 0.14, 0.0, 899, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " f = copy.copy(self.r_arm_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L216_C16", "label": "f = copy()", "type": "assigned_variable", "loc": [216, 216], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L213_C12", "vector": [14, 4, 0.3744, 0.0017, 4, 0.14, 1.0, 899, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " f = copy.copy(self.r_arm_raw_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L217_C8", "label": "if", "type": "if", "loc": [217, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L212_C8", "vector": [4, 3, 0.3821, 0.0139, 3, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif arm == 'left_arm':\n if filtered:\n f = copy.copy(self.l_arm_force)\n else:\n f = copy.copy(self.l_arm_raw_force)\n else:\n self.cb_lock.release()\n raise RuntimeError('Undefined arm: %s'%(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L218_C12", "label": "if", "type": "if", "loc": [218, 221], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L217_C8", "vector": [4, 4, 0.3804, 0.0069, 4, 0.14, 0.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if filtered:\n f = copy.copy(self.l_arm_force)\n else:\n f = copy.copy(self.l_arm_raw_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L219_C16", "label": "f = copy()", "type": "assigned_variable", "loc": [219, 219], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L218_C12", "vector": [14, 5, 0.3795, 0.0017, 5, 0.27, 0.0, 899, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " f = copy.copy(self.l_arm_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L221_C16", "label": "f = copy()", "type": "assigned_variable", "loc": [221, 221], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L218_C12", "vector": [14, 5, 0.383, 0.0017, 5, 0.27, 1.0, 899, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " f = copy.copy(self.l_arm_raw_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L223_C12", "label": "release()", "type": "expression", "loc": [223, 223], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L217_C8", "vector": [8, 4, 0.3865, 0.0017, 4, 0.14, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L225_C8", "label": "release()", "type": "expression", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L209_C4", "vector": [8, 2, 0.3899, 0.0017, 2, 0.85, 0.3333, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L227_C8", "label": "f_mat =", "type": "assigned_variable", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L209_C4", "vector": [14, 2, 0.3934, 0.0017, 2, 0.85, 0.5, 37, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "f_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_mat = np.matrix(f).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L228_C8", "label": "if", "type": "if", "loc": [228, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L209_C4", "vector": [4, 2, 0.396, 0.0035, 2, 0.85, 0.6667, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if bias:\n f_mat = f_mat - self.fts_bias[arm]['force']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L229_C12", "label": "f_mat =", "type": "assigned_variable", "loc": [229, 229], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L228_C8", "vector": [14, 3, 0.3969, 0.0017, 3, 0.93, 0.0, 37, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_mat = f_mat - self.fts_bias[arm]['force']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L231_C8", "label": "if", "type": "if", "loc": [231, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L209_C4", "vector": [4, 2, 0.4029, 0.0069, 2, 0.85, 0.8333, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if base_frame:\n q = self.get_joint_angles(arm)\n rot = self.arms.FK_rot(arm, q)\n f_mat = rot*f_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L232_C12", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [232, 232], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L231_C8", "vector": [14, 3, 0.4021, 0.0017, 3, 0.46, 0.0, 516, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " q = self.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L233_C12", "label": "rot = FK_rot()", "type": "assigned_variable", "loc": [233, 233], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L231_C8", "vector": [14, 3, 0.4038, 0.0017, 3, 0.46, 0.5, 812, 3, 2, 0, 0, 586, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK_rot", "annotation": ""}, "snippet": " rot = self.arms.FK_rot(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L234_C12", "label": "f_mat =", "type": "assigned_variable", "loc": [234, 234], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L231_C8", "vector": [14, 3, 0.4055, 0.0017, 3, 0.46, 1.0, 37, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_mat = rot*f_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L235_C8", "label": "return", "type": "return", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L209_C4", "vector": [13, 2, 0.4073, 0.0017, 2, 0.85, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return f_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "label": "bias_wrist_ft", "type": "function", "loc": [237, 252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.4237, 0.0277, 1, 0.25, 0.4839, 604, 0, 2, 0, 0, 0, 0, 11], "semantic": {"name": "bias_wrist_ft", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def bias_wrist_ft(self, arm):\n f_list = []\n t_list = []\n print('Starting biasing...')\n for i in range(20):\n f_list.append(self.get_wrist_force(arm, bias=False))\n rospy.sleep(0.02)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L238_C8", "label": "f_list =", "type": "assigned_variable", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "vector": [14, 2, 0.4125, 0.0017, 2, 0.99, 0.0, 992, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L239_C8", "label": "t_list =", "type": "assigned_variable", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "vector": [14, 2, 0.4142, 0.0017, 2, 0.99, 0.1, 192, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "t_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L240_C8", "label": "print()", "type": "expression", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "vector": [8, 2, 0.4159, 0.0017, 2, 0.99, 0.2, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Starting biasing...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:For_L241_C8", "label": "for i", "type": "for", "loc": [241, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "vector": [6, 2, 0.4194, 0.0052, 2, 0.99, 0.3, 826, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(20):\n f_list.append(self.get_wrist_force(arm, bias=False))\n rospy.sleep(0.02)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L242_C12", "label": "append()", "type": "expression", "loc": [242, 242], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:For_L241_C8", "vector": [8, 3, 0.4194, 0.0017, 3, 0.68, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " f_list.append(self.get_wrist_force(arm, bias=False))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L243_C12", "label": "sleep()", "type": "expression", "loc": [243, 243], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:For_L241_C8", "vector": [8, 3, 0.4211, 0.0017, 3, 0.68, 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.02)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L245_C8", "label": "f_b = mean()", "type": "assigned_variable", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "vector": [14, 2, 0.4246, 0.0017, 2, 0.99, 0.4, 950, 3, 2, 0, 0, 856, 10, 2], "semantic": {"name": "f_b", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " f_b = np.mean(np.column_stack(f_list), 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L247_C8", "label": "t_b = get_wrist_torque()", "type": "assigned_variable", "loc": [247, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "vector": [14, 2, 0.4281, 0.0017, 2, 0.99, 0.5, 306, 3, 2, 0, 0, 476, 10, 1], "semantic": {"name": "t_b", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_torque", "annotation": ""}, "snippet": " t_b = self.get_wrist_torque(arm, bias=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L248_C8", "label": "assign", "type": "assigned_variable", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "vector": [14, 2, 0.4298, 0.0017, 2, 0.99, 0.6, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.fts_bias[arm]['force'] = f_b"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L249_C8", "label": "assign", "type": "assigned_variable", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "vector": [14, 2, 0.4315, 0.0017, 2, 0.99, 0.7, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.fts_bias[arm]['torque'] = t_b"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L250_C8", "label": "print()", "type": "expression", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "vector": [8, 2, 0.4333, 0.0017, 2, 0.99, 0.8, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('self.fts_bias[arm][\\'force\\']', self.fts_bias[arm]['force'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L251_C8", "label": "print()", "type": "expression", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "vector": [8, 2, 0.435, 0.0017, 2, 0.99, 0.9, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('arm:', arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L252_C8", "label": "print()", "type": "expression", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "vector": [8, 2, 0.4367, 0.0017, 2, 0.99, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('...done')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L256_C4", "label": "get_impedance_scale", "type": "function", "loc": [256, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.4523, 0.0191, 1, 0.25, 0.5161, 730, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "get_impedance_scale", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_impedance_scale(self, arm):\n self.cb_lock.acquire()\n if arm == 'right_arm':\n sc = copy.copy(self.r_arm_alpha)\n elif arm == 'left_arm':\n sc = copy.copy(self.l_arm_alpha)\n else:\n self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L257_C8", "label": "acquire()", "type": "expression", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L256_C4", "vector": [8, 2, 0.4454, 0.0017, 2, 0.48, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L258_C8", "label": "if", "type": "if", "loc": [258, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L256_C4", "vector": [4, 2, 0.4523, 0.0121, 2, 0.48, 0.3333, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'right_arm':\n sc = copy.copy(self.r_arm_alpha)\n elif arm == 'left_arm':\n sc = copy.copy(self.l_arm_alpha)\n else:\n self.cb_lock.release()\n raise RuntimeError('Undefined arm: %s'%(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L259_C12", "label": "sc = copy()", "type": "assigned_variable", "loc": [259, 259], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L258_C8", "vector": [14, 3, 0.4489, 0.0017, 3, 0.65, 0.0, 356, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "sc", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " sc = copy.copy(self.r_arm_alpha)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L260_C8", "label": "if", "type": "if", "loc": [260, 264], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L258_C8", "vector": [4, 3, 0.4541, 0.0087, 3, 0.65, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif arm == 'left_arm':\n sc = copy.copy(self.l_arm_alpha)\n else:\n self.cb_lock.release()\n raise RuntimeError('Undefined arm: %s'%(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L261_C12", "label": "sc = copy()", "type": "assigned_variable", "loc": [261, 261], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L260_C8", "vector": [14, 4, 0.4523, 0.0017, 4, 0.99, 0.0, 356, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "sc", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " sc = copy.copy(self.l_arm_alpha)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L263_C12", "label": "release()", "type": "expression", "loc": [263, 263], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L260_C8", "vector": [8, 4, 0.4558, 0.0017, 4, 0.99, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L265_C8", "label": "release()", "type": "expression", "loc": [265, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L256_C4", "vector": [8, 2, 0.4593, 0.0017, 2, 0.48, 0.6667, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L266_C8", "label": "return", "type": "return", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L256_C4", "vector": [13, 2, 0.461, 0.0017, 2, 0.48, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L270_C4", "label": "set_impedance_scale", "type": "function", "loc": [270, 280], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.4766, 0.0191, 1, 0.25, 0.5484, 430, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "set_impedance_scale", "arg_names": ["self", "arm", "s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_impedance_scale(self, arm, s):\n if arm == 'right_arm': \n pub = self.r_alph_cmd_pub\n elif arm == 'left_arm':\n pub = self.l_alph_cmd_pub\n else:\n raise RuntimeError('Undefined arm: %s'%(arm))\n time_stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L271_C8", "label": "if", "type": "if", "loc": [271, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L270_C4", "vector": [4, 2, 0.474, 0.0104, 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 arm == 'right_arm': \n pub = self.r_alph_cmd_pub\n elif arm == 'left_arm':\n pub = self.l_alph_cmd_pub\n else:\n raise RuntimeError('Undefined arm: %s'%(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L272_C12", "label": "pub =", "type": "assigned_variable", "loc": [272, 272], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L271_C8", "vector": [14, 3, 0.4714, 0.0017, 3, 0.84, 0.0, 41, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pub = self.r_alph_cmd_pub"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L273_C8", "label": "if", "type": "if", "loc": [273, 276], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L271_C8", "vector": [4, 3, 0.4757, 0.0069, 3, 0.84, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif arm == 'left_arm':\n pub = self.l_alph_cmd_pub\n else:\n raise RuntimeError('Undefined arm: %s'%(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L274_C12", "label": "pub =", "type": "assigned_variable", "loc": [274, 274], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L273_C8", "vector": [14, 4, 0.4749, 0.0017, 4, 0.19, 0.0, 41, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pub = self.l_alph_cmd_pub"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L277_C8", "label": "time_stamp = now()", "type": "assigned_variable", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L270_C4", "vector": [14, 2, 0.4801, 0.0017, 2, 0.82, 0.25, 156, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "time_stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " time_stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L278_C8", "label": "h = Header()", "type": "assigned_variable", "loc": [278, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L270_C4", "vector": [14, 2, 0.4818, 0.0017, 2, 0.82, 0.5, 686, 3, 0, 0, 0, 976, 10, 1], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "Header", "annotation": ""}, "snippet": " h = Header()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L279_C8", "label": "h.stamp =", "type": "assigned_variable", "loc": [279, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L270_C4", "vector": [14, 2, 0.4835, 0.0017, 2, 0.82, 0.75, 57, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "h.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h.stamp = time_stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L280_C8", "label": "publish()", "type": "expression", "loc": [280, 280], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L270_C4", "vector": [8, 2, 0.4853, 0.0017, 2, 0.82, 1.0, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " pub.publish(FloatArray(h, s))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L282_C4", "label": "get_jep", "type": "function", "loc": [282, 292], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.4974, 0.0191, 1, 0.25, 0.5806, 898, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "get_jep", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_jep(self, arm):\n self.cb_lock.acquire()\n if arm == 'right_arm':\n jep = copy.copy(self.r_arm_jep)\n elif arm == 'left_arm':\n jep = copy.copy(self.l_arm_jep)\n else:\n self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L283_C8", "label": "acquire()", "type": "expression", "loc": [283, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L282_C4", "vector": [8, 2, 0.4905, 0.0017, 2, 0.7, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.cb_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L284_C8", "label": "if", "type": "if", "loc": [284, 290], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L282_C4", "vector": [4, 2, 0.4974, 0.0121, 2, 0.7, 0.3333, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'right_arm':\n jep = copy.copy(self.r_arm_jep)\n elif arm == 'left_arm':\n jep = copy.copy(self.l_arm_jep)\n else:\n self.cb_lock.release()\n raise RuntimeError('Undefined arm: %s'%(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L285_C12", "label": "jep = copy()", "type": "assigned_variable", "loc": [285, 285], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L284_C8", "vector": [14, 3, 0.4939, 0.0017, 3, 0.12, 0.0, 838, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "jep", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " jep = copy.copy(self.r_arm_jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L286_C8", "label": "if", "type": "if", "loc": [286, 290], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L284_C8", "vector": [4, 3, 0.4991, 0.0087, 3, 0.12, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif arm == 'left_arm':\n jep = copy.copy(self.l_arm_jep)\n else:\n self.cb_lock.release()\n raise RuntimeError('Undefined arm: %s'%(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L287_C12", "label": "jep = copy()", "type": "assigned_variable", "loc": [287, 287], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L286_C8", "vector": [14, 4, 0.4974, 0.0017, 4, 0.12, 0.0, 838, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "jep", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " jep = copy.copy(self.l_arm_jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L289_C12", "label": "release()", "type": "expression", "loc": [289, 289], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L286_C8", "vector": [8, 4, 0.5009, 0.0017, 4, 0.12, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L291_C8", "label": "release()", "type": "expression", "loc": [291, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L282_C4", "vector": [8, 2, 0.5043, 0.0017, 2, 0.7, 0.6667, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.cb_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L292_C8", "label": "return", "type": "return", "loc": [292, 292], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L282_C4", "vector": [13, 2, 0.5061, 0.0017, 2, 0.7, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return jep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L297_C4", "label": "set_jep", "type": "function", "loc": [297, 307], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.5234, 0.0191, 1, 0.25, 0.6129, 799, 0, 4, 0, 0, 0, 0, 5], "semantic": {"name": "set_jep", "arg_names": ["self", "arm", "q", "duration"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_jep(self, arm, q, duration=None):\n if arm == 'right_arm': \n pub = self.r_jep_cmd_pub\n elif arm == 'left_arm':\n pub = self.l_jep_cmd_pub\n else:\n raise RuntimeError('Undefined arm: %s'%(arm))\n time_stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L298_C8", "label": "if", "type": "if", "loc": [298, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L297_C4", "vector": [4, 2, 0.5208, 0.0104, 2, 0.53, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'right_arm': \n pub = self.r_jep_cmd_pub\n elif arm == 'left_arm':\n pub = self.l_jep_cmd_pub\n else:\n raise RuntimeError('Undefined arm: %s'%(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L299_C12", "label": "pub =", "type": "assigned_variable", "loc": [299, 299], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L298_C8", "vector": [14, 3, 0.5182, 0.0017, 3, 0.96, 0.0, 41, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pub = self.r_jep_cmd_pub"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L300_C8", "label": "if", "type": "if", "loc": [300, 303], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L298_C8", "vector": [4, 3, 0.5225, 0.0069, 3, 0.96, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif arm == 'left_arm':\n pub = self.l_jep_cmd_pub\n else:\n raise RuntimeError('Undefined arm: %s'%(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L301_C12", "label": "pub =", "type": "assigned_variable", "loc": [301, 301], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L300_C8", "vector": [14, 4, 0.5217, 0.0017, 4, 0.48, 0.0, 41, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pub = self.l_jep_cmd_pub"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L304_C8", "label": "time_stamp = now()", "type": "assigned_variable", "loc": [304, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L297_C4", "vector": [14, 2, 0.5269, 0.0017, 2, 0.53, 0.25, 156, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "time_stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " time_stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L305_C8", "label": "h = Header()", "type": "assigned_variable", "loc": [305, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L297_C4", "vector": [14, 2, 0.5286, 0.0017, 2, 0.53, 0.5, 686, 3, 0, 0, 0, 976, 10, 1], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "Header", "annotation": ""}, "snippet": " h = Header()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L306_C8", "label": "h.stamp =", "type": "assigned_variable", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L297_C4", "vector": [14, 2, 0.5303, 0.0017, 2, 0.53, 0.75, 57, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "h.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h.stamp = time_stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L307_C8", "label": "publish()", "type": "expression", "loc": [307, 307], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L297_C4", "vector": [8, 2, 0.5321, 0.0017, 2, 0.53, 1.0, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " pub.publish(FloatArray(h, q))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "label": "go_jep", "type": "function", "loc": [314, 360], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.5841, 0.0815, 1, 0.25, 0.6452, 177, 0, 5, 1, 0, 0, 0, 22], "semantic": {"name": "go_jep", "arg_names": ["self", "arm", "q", "stopping_function", "speed"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def go_jep(self, arm, q, stopping_function=None, speed=math.radians(30)):\n if speed>math.radians(90.):\n speed = math.radians(90.)\n\n qs_list,qe_list,ns_list,qstep_list = [],[],[],[]\n done_list = []\n time_between_cmds = 0.025\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L315_C8", "label": "if", "type": "if", "loc": [315, 316], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "vector": [4, 2, 0.5468, 0.0035, 2, 0.05, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if speed>math.radians(90.):\n speed = math.radians(90.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L316_C12", "label": "speed = radians()", "type": "assigned_variable", "loc": [316, 316], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L315_C8", "vector": [14, 3, 0.5477, 0.0017, 3, 0.71, 0.0, 970, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "speed", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " speed = math.radians(90.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L318_C8", "label": "qs_list, qe_list, ns_list, qstep_list =", "type": "assigned_variable", "loc": [318, 318], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "vector": [14, 2, 0.5511, 0.0017, 2, 0.05, 0.0625, 383, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "qs_list, qe_list, ns_list, qstep_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qs_list,qe_list,ns_list,qstep_list = [],[],[],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L319_C8", "label": "done_list =", "type": "assigned_variable", "loc": [319, 319], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "vector": [14, 2, 0.5529, 0.0017, 2, 0.05, 0.125, 125, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "done_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " done_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L320_C8", "label": "time_between_cmds =", "type": "assigned_variable", "loc": [320, 320], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "vector": [14, 2, 0.5546, 0.0017, 2, 0.05, 0.1875, 489, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "time_between_cmds", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_between_cmds = 0.025"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L323_C8", "label": "qs = matrix()", "type": "assigned_variable", "loc": [323, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "vector": [14, 2, 0.5598, 0.0017, 2, 0.05, 0.25, 251, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "qs", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " qs = np.matrix(self.get_jep(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L324_C8", "label": "qe = matrix()", "type": "assigned_variable", "loc": [324, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "vector": [14, 2, 0.5615, 0.0017, 2, 0.05, 0.3125, 425, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "qe", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " qe = np.matrix(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L325_C8", "label": "max_change = max()", "type": "assigned_variable", "loc": [325, 325], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "vector": [14, 2, 0.5633, 0.0017, 2, 0.05, 0.375, 767, 3, 1, 0, 0, 442, 10, 2], "semantic": {"name": "max_change", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_change = np.max(np.abs(qe-qs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L327_C8", "label": "total_time =", "type": "assigned_variable", "loc": [327, 327], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "vector": [14, 2, 0.5667, 0.0017, 2, 0.05, 0.4375, 875, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "total_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " total_time = max_change/speed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L328_C8", "label": "n_steps = int()", "type": "assigned_variable", "loc": [328, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "vector": [14, 2, 0.5685, 0.0017, 2, 0.05, 0.5, 514, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "n_steps", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " n_steps = int(total_time/time_between_cmds+0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L330_C8", "label": "qstep =", "type": "assigned_variable", "loc": [330, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "vector": [14, 2, 0.5719, 0.0017, 2, 0.05, 0.5625, 422, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "qstep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qstep = (qe-qs)/n_steps"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L332_C8", "label": "if", "type": "if", "loc": [332, 335], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "vector": [4, 2, 0.578, 0.0069, 2, 0.05, 0.625, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stopping_function != None:\n done = stopping_function()\n else:\n done = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L333_C12", "label": "done = stopping_function()", "type": "assigned_variable", "loc": [333, 333], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L332_C8", "vector": [14, 3, 0.5771, 0.0017, 3, 0.32, 0.0, 151, 3, 0, 0, 0, 730, 10, 1], "semantic": {"name": "done", "arg_names": [], "import_names": [], "rhs_call_name": "stopping_function", "annotation": ""}, "snippet": " done = stopping_function()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L335_C12", "label": "done =", "type": "assigned_variable", "loc": [335, 335], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L332_C8", "vector": [14, 3, 0.5806, 0.0017, 3, 0.32, 1.0, 151, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "done", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " done = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L337_C8", "label": "step_number =", "type": "assigned_variable", "loc": [337, 337], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "vector": [14, 2, 0.5841, 0.0017, 2, 0.05, 0.6875, 802, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "step_number", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " step_number = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L338_C8", "label": "t0 = to_time()", "type": "assigned_variable", "loc": [338, 338], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "vector": [14, 2, 0.5858, 0.0017, 2, 0.05, 0.75, 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_99748:Assign_L339_C8", "label": "t_end =", "type": "assigned_variable", "loc": [339, 339], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "vector": [14, 2, 0.5875, 0.0017, 2, 0.05, 0.8125, 945, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t_end", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t_end = t0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L340_C8", "label": "while", "type": "while", "loc": [340, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "vector": [5, 2, 0.604, 0.0312, 2, 0.05, 0.875, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while done==False:\n t_end += time_between_cmds\n t1 = rospy.Time.now().to_time()\n\n if stopping_function != None:\n done = stopping_function()\n if step_number < n_steps and done == False:\n q = (qs + step_number*qstep).A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L342_C12", "label": "t1 = to_time()", "type": "assigned_variable", "loc": [342, 342], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L340_C8", "vector": [14, 3, 0.5927, 0.0017, 3, 0.9, 0.0, 329, 3, 0, 0, 0, 739, 10, 2], "semantic": {"name": "t1", "arg_names": [], "import_names": [], "rhs_call_name": "to_time", "annotation": ""}, "snippet": " t1 = rospy.Time.now().to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L344_C12", "label": "if", "type": "if", "loc": [344, 345], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L340_C8", "vector": [4, 3, 0.5971, 0.0035, 3, 0.9, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stopping_function != None:\n done = stopping_function()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L345_C16", "label": "done = stopping_function()", "type": "assigned_variable", "loc": [345, 345], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L344_C12", "vector": [14, 4, 0.5979, 0.0017, 4, 0.51, 0.0, 151, 3, 0, 0, 0, 730, 10, 1], "semantic": {"name": "done", "arg_names": [], "import_names": [], "rhs_call_name": "stopping_function", "annotation": ""}, "snippet": " done = stopping_function()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L346_C12", "label": "if", "type": "if", "loc": [346, 350], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L340_C8", "vector": [4, 3, 0.6031, 0.0087, 3, 0.9, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if step_number < n_steps and done == False:\n q = (qs + step_number*qstep).A1.tolist()\n self.set_jep(arm, q)\n else:\n done = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L347_C16", "label": "q = tolist()", "type": "assigned_variable", "loc": [347, 347], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L346_C12", "vector": [14, 4, 0.6014, 0.0017, 4, 0.49, 0.0, 516, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " q = (qs + step_number*qstep).A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L348_C16", "label": "set_jep()", "type": "expression", "loc": [348, 348], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L346_C12", "vector": [8, 4, 0.6031, 0.0017, 4, 0.49, 0.5, 799, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_jep", "arg_names": [], "import_names": [], "rhs_call_name": "set_jep", "annotation": ""}, "snippet": " self.set_jep(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L350_C16", "label": "done =", "type": "assigned_variable", "loc": [350, 350], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L346_C12", "vector": [14, 4, 0.6066, 0.0017, 4, 0.49, 1.0, 151, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "done", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " done = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L352_C12", "label": "while", "type": "while", "loc": [352, 356], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L340_C8", "vector": [5, 3, 0.6135, 0.0087, 3, 0.9, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while t1 < t_end:\n if stopping_function != None:\n done = done or stopping_function()\n rospy.sleep(time_between_cmds/5)\n t1 = rospy.Time.now().to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L353_C16", "label": "if", "type": "if", "loc": [353, 354], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L352_C12", "vector": [4, 4, 0.6127, 0.0035, 4, 0.5, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stopping_function != None:\n done = done or stopping_function()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L354_C20", "label": "done =", "type": "assigned_variable", "loc": [354, 354], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L353_C16", "vector": [14, 5, 0.6135, 0.0017, 5, 0.19, 0.0, 151, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "done", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " done = done or stopping_function()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L355_C16", "label": "sleep()", "type": "expression", "loc": [355, 355], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L352_C12", "vector": [8, 4, 0.6153, 0.0017, 4, 0.5, 0.5, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(time_between_cmds/5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L356_C16", "label": "t1 = to_time()", "type": "assigned_variable", "loc": [356, 356], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L352_C12", "vector": [14, 4, 0.617, 0.0017, 4, 0.5, 1.0, 329, 3, 0, 0, 0, 739, 10, 2], "semantic": {"name": "t1", "arg_names": [], "import_names": [], "rhs_call_name": "to_time", "annotation": ""}, "snippet": " t1 = rospy.Time.now().to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L359_C8", "label": "sleep()", "type": "expression", "loc": [359, 359], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "vector": [8, 2, 0.6222, 0.0017, 2, 0.05, 0.9375, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(time_between_cmds)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L360_C8", "label": "return", "type": "return", "loc": [360, 360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "vector": [13, 2, 0.6239, 0.0017, 2, 0.05, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'reach'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L364_C4", "label": "stop", "type": "function", "loc": [364, 365], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.6317, 0.0035, 1, 0.25, 0.6774, 343, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop(self):\n self.stop_pub.publish()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L365_C8", "label": "publish()", "type": "expression", "loc": [365, 365], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L364_C4", "vector": [8, 2, 0.6326, 0.0017, 2, 0.95, 0.0, 102, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.stop_pub.publish()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L367_C4", "label": "is_motor_power_on", "type": "function", "loc": [367, 368], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.6369, 0.0035, 1, 0.25, 0.7097, 123, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_motor_power_on", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_motor_power_on(self):\n return self.pwr_state"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L368_C8", "label": "return", "type": "return", "loc": [368, 368], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L367_C4", "vector": [13, 2, 0.6378, 0.0017, 2, 0.96, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.pwr_state"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L370_C4", "label": "go_cep", "type": "function", "loc": [370, 386], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.6551, 0.0295, 1, 0.25, 0.7419, 586, 0, 7, 1, 0, 0, 0, 12], "semantic": {"name": "go_cep", "arg_names": ["self", "arm", "p", "rot", "speed", "stopping_function", "q_guess"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def go_cep(self, arm, p, rot, speed = 0.10,\n stopping_function = None, q_guess = None):\n q = self.arms.IK(arm, p, rot, q_guess)\n if q == None:\n print('IK soln NOT found.')\n print('trying to reach p= ', p)\n return 'fail'\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L372_C8", "label": "q = IK()", "type": "assigned_variable", "loc": [372, 372], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L370_C4", "vector": [14, 2, 0.6447, 0.0017, 2, 0.07, 0.0, 516, 3, 4, 0, 0, 719, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " q = self.arms.IK(arm, p, rot, q_guess)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "label": "if", "type": "if", "loc": [373, 386], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L370_C4", "vector": [4, 2, 0.6577, 0.0243, 2, 0.07, 1.0, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if q == None:\n print('IK soln NOT found.')\n print('trying to reach p= ', p)\n return 'fail'\n else:\n q_start = np.matrix(self.get_joint_angles(arm))\n p_start = self.arms.FK(arm, q_start.A1.tolist())\n q_end = np.matrix(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L374_C12", "label": "print()", "type": "expression", "loc": [374, 374], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "vector": [8, 3, 0.6482, 0.0017, 3, 0.85, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('IK soln NOT found.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L375_C12", "label": "print()", "type": "expression", "loc": [375, 375], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "vector": [8, 3, 0.6499, 0.0017, 3, 0.85, 0.1, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('trying to reach p= ', p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L376_C12", "label": "return", "type": "return", "loc": [376, 376], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "vector": [13, 3, 0.6516, 0.0017, 3, 0.85, 0.2, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'fail'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L378_C12", "label": "q_start = matrix()", "type": "assigned_variable", "loc": [378, 378], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "vector": [14, 3, 0.6551, 0.0017, 3, 0.85, 0.3, 42, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "q_start", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " q_start = np.matrix(self.get_joint_angles(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L379_C12", "label": "p_start = FK()", "type": "assigned_variable", "loc": [379, 379], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "vector": [14, 3, 0.6568, 0.0017, 3, 0.85, 0.4, 397, 3, 2, 0, 0, 252, 10, 2], "semantic": {"name": "p_start", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " p_start = self.arms.FK(arm, q_start.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L380_C12", "label": "q_end = matrix()", "type": "assigned_variable", "loc": [380, 380], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "vector": [14, 3, 0.6586, 0.0017, 3, 0.85, 0.5, 384, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "q_end", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " q_end = np.matrix(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L382_C12", "label": "dist = norm()", "type": "assigned_variable", "loc": [382, 382], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "vector": [14, 3, 0.662, 0.0017, 3, 0.85, 0.6, 673, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "dist", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " dist = np.linalg.norm(p-p_start)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L383_C12", "label": "total_time =", "type": "assigned_variable", "loc": [383, 383], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "vector": [14, 3, 0.6638, 0.0017, 3, 0.85, 0.7, 875, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "total_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " total_time = dist/speed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L384_C12", "label": "max_change = max()", "type": "assigned_variable", "loc": [384, 384], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "vector": [14, 3, 0.6655, 0.0017, 3, 0.85, 0.8, 767, 3, 1, 0, 0, 442, 10, 2], "semantic": {"name": "max_change", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_change = np.max(np.abs(q_end-q_start))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L385_C12", "label": "ang_speed =", "type": "assigned_variable", "loc": [385, 385], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "vector": [14, 3, 0.6672, 0.0017, 3, 0.85, 0.9, 735, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ang_speed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ang_speed = max_change/total_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L386_C12", "label": "return", "type": "return", "loc": [386, 386], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "vector": [13, 3, 0.669, 0.0017, 3, 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.go_jep(arm, q, stopping_function, speed=ang_speed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "label": "go_cep_interpolate", "type": "function", "loc": [396, 443], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.727, 0.0832, 1, 0.25, 0.7742, 987, 0, 6, 1, 0, 0, 0, 15], "semantic": {"name": "go_cep_interpolate", "arg_names": ["self", "arm", "p", "rot", "speed", "stopping_function"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def go_cep_interpolate(self, arm, p, rot=None, speed=0.10,\n stopping_function=None):\n rot = None # Rotational interpolation not implemented right now.\n time_between_cmds = 0.025\n\n q_guess = self.get_jep(arm)\n cep = self.arms.FK(arm, q_guess)\n if rot == None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L398_C8", "label": "rot =", "type": "assigned_variable", "loc": [398, 398], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "vector": [14, 2, 0.6898, 0.0017, 2, 0.58, 0.0, 812, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot = None # Rotational interpolation not implemented right now."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L399_C8", "label": "time_between_cmds =", "type": "assigned_variable", "loc": [399, 399], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "vector": [14, 2, 0.6915, 0.0017, 2, 0.58, 0.0588, 489, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "time_between_cmds", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_between_cmds = 0.025"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L401_C8", "label": "q_guess = get_jep()", "type": "assigned_variable", "loc": [401, 401], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "vector": [14, 2, 0.695, 0.0017, 2, 0.58, 0.1176, 993, 3, 1, 0, 0, 898, 10, 1], "semantic": {"name": "q_guess", "arg_names": [], "import_names": [], "rhs_call_name": "get_jep", "annotation": ""}, "snippet": " q_guess = self.get_jep(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L402_C8", "label": "cep = FK()", "type": "assigned_variable", "loc": [402, 402], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "vector": [14, 2, 0.6967, 0.0017, 2, 0.58, 0.1765, 487, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "cep", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " cep = self.arms.FK(arm, q_guess)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L403_C8", "label": "if", "type": "if", "loc": [403, 404], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "vector": [4, 2, 0.6993, 0.0035, 2, 0.58, 0.2353, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rot == None:\n rot = self.arms.FK_rot(arm, q_guess)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L404_C12", "label": "rot = FK_rot()", "type": "assigned_variable", "loc": [404, 404], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L403_C8", "vector": [14, 3, 0.7002, 0.0017, 3, 0.01, 0.0, 812, 3, 2, 0, 0, 586, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK_rot", "annotation": ""}, "snippet": " rot = self.arms.FK_rot(arm, q_guess)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L406_C8", "label": "vec =", "type": "assigned_variable", "loc": [406, 406], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "vector": [14, 2, 0.7036, 0.0017, 2, 0.58, 0.2941, 132, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vec = p-cep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L407_C8", "label": "dist = norm()", "type": "assigned_variable", "loc": [407, 407], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "vector": [14, 2, 0.7054, 0.0017, 2, 0.58, 0.3529, 673, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "dist", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " dist = np.linalg.norm(vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L408_C8", "label": "total_time =", "type": "assigned_variable", "loc": [408, 408], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "vector": [14, 2, 0.7071, 0.0017, 2, 0.58, 0.4118, 875, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "total_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " total_time = dist/speed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L409_C8", "label": "n_steps = int()", "type": "assigned_variable", "loc": [409, 409], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "vector": [14, 2, 0.7088, 0.0017, 2, 0.58, 0.4706, 514, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "n_steps", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " n_steps = int(total_time/time_between_cmds + 0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L410_C8", "label": "vec =", "type": "assigned_variable", "loc": [410, 410], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "vector": [14, 2, 0.7106, 0.0017, 2, 0.58, 0.5294, 132, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vec = vec/dist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L411_C8", "label": "vec =", "type": "assigned_variable", "loc": [411, 411], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "vector": [14, 2, 0.7123, 0.0017, 2, 0.58, 0.5882, 132, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vec = vec * speed * time_between_cmds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L413_C8", "label": "pt =", "type": "assigned_variable", "loc": [413, 413], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "vector": [14, 2, 0.7158, 0.0017, 2, 0.58, 0.6471, 989, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = cep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L414_C8", "label": "all_done =", "type": "assigned_variable", "loc": [414, 414], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "vector": [14, 2, 0.7175, 0.0017, 2, 0.58, 0.7059, 985, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "all_done", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " all_done = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L415_C8", "label": "i =", "type": "assigned_variable", "loc": [415, 415], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "vector": [14, 2, 0.7192, 0.0017, 2, 0.58, 0.7647, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = 0 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L416_C8", "label": "t0 = to_time()", "type": "assigned_variable", "loc": [416, 416], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "vector": [14, 2, 0.721, 0.0017, 2, 0.58, 0.8235, 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_99748:Assign_L417_C8", "label": "t_end =", "type": "assigned_variable", "loc": [417, 417], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "vector": [14, 2, 0.7227, 0.0017, 2, 0.58, 0.8824, 945, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t_end", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t_end = t0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L418_C8", "label": "while", "type": "while", "loc": [418, 442], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "vector": [5, 2, 0.7452, 0.0433, 2, 0.58, 0.9412, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while all_done==False:\n t_end += time_between_cmds\n t1 = rospy.Time.now().to_time()\n pt = pt + vec\n q = self.arms.IK(arm, pt, rot, q_guess)\n\n if q == None:\n all_done = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L420_C12", "label": "t1 = to_time()", "type": "assigned_variable", "loc": [420, 420], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L418_C8", "vector": [14, 3, 0.7279, 0.0017, 3, 0.91, 0.0, 329, 3, 0, 0, 0, 739, 10, 2], "semantic": {"name": "t1", "arg_names": [], "import_names": [], "rhs_call_name": "to_time", "annotation": ""}, "snippet": " t1 = rospy.Time.now().to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L421_C12", "label": "pt =", "type": "assigned_variable", "loc": [421, 421], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L418_C8", "vector": [14, 3, 0.7296, 0.0017, 3, 0.91, 0.1429, 989, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = pt + vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L422_C12", "label": "q = IK()", "type": "assigned_variable", "loc": [422, 422], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L418_C8", "vector": [14, 3, 0.7314, 0.0017, 3, 0.91, 0.2857, 516, 3, 4, 0, 0, 719, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " q = self.arms.IK(arm, pt, rot, q_guess)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L424_C12", "label": "if", "type": "if", "loc": [424, 427], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L418_C8", "vector": [4, 3, 0.7374, 0.0069, 3, 0.91, 0.4286, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if q == None:\n all_done = True\n stop = 'IK fail'\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L425_C16", "label": "all_done =", "type": "assigned_variable", "loc": [425, 425], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L424_C12", "vector": [14, 4, 0.7366, 0.0017, 4, 0.9, 0.0, 985, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "all_done", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " all_done = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L426_C16", "label": "stop =", "type": "assigned_variable", "loc": [426, 426], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L424_C12", "vector": [14, 4, 0.7383, 0.0017, 4, 0.9, 1.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'IK fail'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L428_C12", "label": "set_jep()", "type": "expression", "loc": [428, 428], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L418_C8", "vector": [8, 3, 0.7418, 0.0017, 3, 0.91, 0.5714, 799, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_jep", "arg_names": [], "import_names": [], "rhs_call_name": "set_jep", "annotation": ""}, "snippet": " self.set_jep(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L429_C12", "label": "q_guess =", "type": "assigned_variable", "loc": [429, 429], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L418_C8", "vector": [14, 3, 0.7435, 0.0017, 3, 0.91, 0.7143, 993, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_guess = q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L430_C12", "label": "while", "type": "while", "loc": [430, 437], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L418_C8", "vector": [5, 3, 0.7513, 0.0139, 3, 0.91, 0.8571, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while t1<t_end:\n if stopping_function != None:\n all_done = stopping_function()\n if all_done:\n stop = 'Stopping Condition'\n break\n rospy.sleep(time_between_cmds/5)\n t1 = rospy.Time.now().to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L431_C16", "label": "if", "type": "if", "loc": [431, 432], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L430_C12", "vector": [4, 4, 0.7478, 0.0035, 4, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stopping_function != None:\n all_done = stopping_function()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L432_C20", "label": "all_done = stopping_function()", "type": "assigned_variable", "loc": [432, 432], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L431_C16", "vector": [14, 5, 0.7487, 0.0017, 5, 0.63, 0.0, 985, 3, 0, 0, 0, 730, 10, 1], "semantic": {"name": "all_done", "arg_names": [], "import_names": [], "rhs_call_name": "stopping_function", "annotation": ""}, "snippet": " all_done = stopping_function()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L433_C16", "label": "if", "type": "if", "loc": [433, 435], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L430_C12", "vector": [4, 4, 0.7522, 0.0052, 4, 0.99, 0.3333, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if all_done:\n stop = 'Stopping Condition'\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L434_C20", "label": "stop =", "type": "assigned_variable", "loc": [434, 434], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L433_C16", "vector": [14, 5, 0.7522, 0.0017, 5, 0.0, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'Stopping Condition'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L436_C16", "label": "sleep()", "type": "expression", "loc": [436, 436], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L430_C12", "vector": [8, 4, 0.7556, 0.0017, 4, 0.99, 0.6667, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(time_between_cmds/5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L437_C16", "label": "t1 = to_time()", "type": "assigned_variable", "loc": [437, 437], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L430_C12", "vector": [14, 4, 0.7574, 0.0017, 4, 0.99, 1.0, 329, 3, 0, 0, 0, 739, 10, 2], "semantic": {"name": "t1", "arg_names": [], "import_names": [], "rhs_call_name": "to_time", "annotation": ""}, "snippet": " t1 = rospy.Time.now().to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L440_C12", "label": "if", "type": "if", "loc": [440, 442], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L418_C8", "vector": [4, 3, 0.7643, 0.0052, 3, 0.91, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i == n_steps:\n all_done = True\n stop = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L441_C16", "label": "all_done =", "type": "assigned_variable", "loc": [441, 441], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L440_C12", "vector": [14, 4, 0.7643, 0.0017, 4, 0.6, 0.0, 985, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "all_done", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " all_done = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L442_C16", "label": "stop =", "type": "assigned_variable", "loc": [442, 442], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L440_C12", "vector": [14, 4, 0.766, 0.0017, 4, 0.6, 1.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L443_C8", "label": "return", "type": "return", "loc": [443, 443], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "vector": [13, 2, 0.7678, 0.0017, 2, 0.58, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return stop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L449_C4", "label": "move_till_hit", "type": "function", "loc": [449, 471], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.7972, 0.0399, 1, 0.25, 0.8065, 163, 0, 6, 1, 0, 0, 0, 9], "semantic": {"name": "move_till_hit", "arg_names": ["self", "arm", "vec", "force_threshold", "speed", "bias_FT"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_till_hit(self, arm, vec=np.matrix([0.3,0.,0.]).T, force_threshold=3.0,\n speed=0.1, bias_FT=True):\n unit_vec = vec/np.linalg.norm(vec)\n def stopping_function():\n force = self.get_wrist_force(arm, base_frame = True)\n force_projection = force.T*unit_vec *-1 # projection in direction opposite to motion.\n if force_projection>force_threshold:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L451_C8", "label": "unit_vec =", "type": "assigned_variable", "loc": [451, 451], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L449_C4", "vector": [14, 2, 0.7816, 0.0017, 2, 0.01, 0.0, 372, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unit_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " unit_vec = vec/np.linalg.norm(vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L452_C8", "label": "stopping_function", "type": "function", "loc": [452, 460], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L449_C4", "vector": [2, 2, 0.7903, 0.0156, 2, 0.01, 0.1429, 730, 0, 0, 1, 0, 0, 0, 2], "semantic": {"name": "stopping_function", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stopping_function():\n force = self.get_wrist_force(arm, base_frame = True)\n force_projection = force.T*unit_vec *-1 # projection in direction opposite to motion.\n if force_projection>force_threshold:\n return True\n elif np.linalg.norm(force)>45.:\n return True\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L453_C12", "label": "force = get_wrist_force()", "type": "assigned_variable", "loc": [453, 453], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L452_C8", "vector": [14, 3, 0.7851, 0.0017, 3, 0.61, 0.0, 77, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "force", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " force = self.get_wrist_force(arm, base_frame = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L454_C12", "label": "force_projection =", "type": "assigned_variable", "loc": [454, 454], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L452_C8", "vector": [14, 3, 0.7868, 0.0017, 3, 0.61, 0.5, 66, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_projection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_projection = force.T*unit_vec *-1 # projection in direction opposite to motion."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L455_C12", "label": "if", "type": "if", "loc": [455, 460], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L452_C8", "vector": [4, 3, 0.7929, 0.0104, 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 force_projection>force_threshold:\n return True\n elif np.linalg.norm(force)>45.:\n return True\n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L456_C16", "label": "return", "type": "return", "loc": [456, 456], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L455_C12", "vector": [13, 4, 0.7903, 0.0017, 4, 0.4, 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_99748:If_L457_C12", "label": "if", "type": "if", "loc": [457, 460], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L455_C12", "vector": [4, 4, 0.7946, 0.0069, 4, 0.4, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif np.linalg.norm(force)>45.:\n return True\n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L458_C16", "label": "return", "type": "return", "loc": [458, 458], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L457_C12", "vector": [13, 5, 0.7938, 0.0017, 5, 0.43, 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_99748:Return_L460_C16", "label": "return", "type": "return", "loc": [460, 460], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L457_C12", "vector": [13, 5, 0.7972, 0.0017, 5, 0.43, 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_99748:Assign_L462_C8", "label": "jep = get_jep()", "type": "assigned_variable", "loc": [462, 462], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L449_C4", "vector": [14, 2, 0.8007, 0.0017, 2, 0.01, 0.2857, 838, 3, 1, 0, 0, 898, 10, 1], "semantic": {"name": "jep", "arg_names": [], "import_names": [], "rhs_call_name": "get_jep", "annotation": ""}, "snippet": " jep = self.get_jep(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L463_C8", "label": "cep, rot = FK_all()", "type": "assigned_variable", "loc": [463, 463], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L449_C4", "vector": [14, 2, 0.8024, 0.0017, 2, 0.01, 0.4286, 971, 3, 2, 0, 0, 415, 10, 1], "semantic": {"name": "cep, rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK_all", "annotation": ""}, "snippet": " cep, rot = self.arms.FK_all(arm, jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L465_C8", "label": "if", "type": "if", "loc": [465, 466], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L449_C4", "vector": [4, 2, 0.8068, 0.0035, 2, 0.01, 0.5714, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if bias_FT:\n self.bias_wrist_ft(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L466_C12", "label": "bias_wrist_ft()", "type": "expression", "loc": [466, 466], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L465_C8", "vector": [8, 3, 0.8076, 0.0017, 3, 0.27, 0.0, 604, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "bias_wrist_ft", "arg_names": [], "import_names": [], "rhs_call_name": "bias_wrist_ft", "annotation": ""}, "snippet": " self.bias_wrist_ft(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L467_C8", "label": "sleep()", "type": "expression", "loc": [467, 467], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L449_C4", "vector": [8, 2, 0.8094, 0.0017, 2, 0.01, 0.7143, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L469_C8", "label": "p =", "type": "assigned_variable", "loc": [469, 469], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L449_C4", "vector": [14, 2, 0.8128, 0.0017, 2, 0.01, 0.8571, 491, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = cep + vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L470_C8", "label": "return", "type": "return", "loc": [470, 471], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L449_C4", "vector": [13, 2, 0.8154, 0.0035, 2, 0.01, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.go_cep_interpolate(arm, p, rot, speed,\n stopping_function)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L473_C4", "label": "motors_off", "type": "function", "loc": [473, 474], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.8206, 0.0035, 1, 0.25, 0.8387, 881, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "motors_off", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def motors_off(self):\n self.motors_off_pub.publish()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L474_C8", "label": "publish()", "type": "expression", "loc": [474, 474], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L473_C4", "vector": [8, 2, 0.8215, 0.0017, 2, 0.67, 0.0, 102, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.motors_off_pub.publish()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L482_C4", "label": "get_joint_velocities", "type": "function", "loc": [482, 483], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.8362, 0.0035, 1, 0.25, 0.871, 27, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "get_joint_velocities", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_joint_velocities(self, arm):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L486_C4", "label": "get_joint_accelerations", "type": "function", "loc": [486, 487], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.8432, 0.0035, 1, 0.25, 0.9032, 8, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "get_joint_accelerations", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_joint_accelerations(self, arm):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L490_C4", "label": "get_joint_torques", "type": "function", "loc": [490, 491], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.8501, 0.0035, 1, 0.25, 0.9355, 216, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "get_joint_torques", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_joint_torques(self, arm):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L494_C4", "label": "get_wrist_torque", "type": "function", "loc": [494, 495], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.857, 0.0035, 1, 0.25, 0.9677, 476, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "get_wrist_torque", "arg_names": ["self", "arm", "bias"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_wrist_torque(self, arm, bias=True):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L498_C4", "label": "power_on", "type": "function", "loc": [498, 499], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "vector": [2, 1, 0.864, 0.0035, 1, 0.25, 1.0, 777, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "power_on", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def power_on(self):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "label": "if", "type": "if", "loc": [505, 573], "level": 0, "parent": null, "vector": [4, 0, 0.9341, 0.1196, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 36], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import arms as ar\n import m3.toolbox as m3t\n import hrl_lib.transforms as tr\n\n r_arm = 'right_arm'\n l_arm = 'left_arm'\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Import_L506_C4", "label": "arms import ar", "type": "import", "loc": [506, 506], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "vector": [1, 1, 0.8769, 0.0017, 1, 0.13, 0.0, 375, 0, 1, 0, 0, 375, 0, 0], "semantic": {"name": "arms", "arg_names": [], "import_names": ["ar"], "rhs_call_name": "", "annotation": ""}, "snippet": " import arms as ar"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Import_L507_C4", "label": "m3.toolbox import m3t", "type": "import", "loc": [507, 507], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "vector": [1, 1, 0.8787, 0.0017, 1, 0.13, 0.0909, 478, 0, 1, 0, 0, 478, 0, 0], "semantic": {"name": "m3.toolbox", "arg_names": [], "import_names": ["m3t"], "rhs_call_name": "", "annotation": ""}, "snippet": " import m3.toolbox as m3t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Import_L508_C4", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [508, 508], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "vector": [1, 1, 0.8804, 0.0017, 1, 0.13, 0.1818, 82, 0, 1, 0, 0, 82, 0, 0], "semantic": {"name": "hrl_lib.transforms", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": " import hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L510_C4", "label": "r_arm =", "type": "assigned_variable", "loc": [510, 510], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "vector": [14, 1, 0.8839, 0.0017, 1, 0.13, 0.2727, 315, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "r_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_arm = 'right_arm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L511_C4", "label": "l_arm =", "type": "assigned_variable", "loc": [511, 511], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "vector": [14, 1, 0.8856, 0.0017, 1, 0.13, 0.3636, 657, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "l_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l_arm = 'left_arm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L513_C4", "label": "arms = M3HrlRobot()", "type": "assigned_variable", "loc": [513, 513], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "vector": [14, 1, 0.8891, 0.0017, 1, 0.13, 0.4545, 375, 3, 0, 0, 0, 305, 10, 1], "semantic": {"name": "arms", "arg_names": [], "import_names": [], "rhs_call_name": "M3HrlRobot", "annotation": ""}, "snippet": " arms = ar.M3HrlRobot()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L514_C4", "label": "ac = MekaArmClient()", "type": "assigned_variable", "loc": [514, 514], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "vector": [14, 1, 0.8908, 0.0017, 1, 0.13, 0.5455, 651, 3, 1, 0, 0, 267, 10, 1], "semantic": {"name": "ac", "arg_names": [], "import_names": [], "rhs_call_name": "MekaArmClient", "annotation": ""}, "snippet": " ac = MekaArmClient(arms)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L517_C4", "label": "if", "type": "if", "loc": [517, 522], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "vector": [4, 1, 0.9003, 0.0104, 1, 0.13, 0.6364, 0, 1, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n ac.bias_wrist_ft(r_arm)\n while not rospy.is_shutdown():\n f = ac.get_wrist_force(r_arm)\n print('f:', f.A1)\n rospy.sleep(0.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L518_C8", "label": "bias_wrist_ft()", "type": "expression", "loc": [518, 518], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L517_C4", "vector": [8, 2, 0.8977, 0.0017, 2, 0.32, 0.0, 604, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "bias_wrist_ft", "arg_names": [], "import_names": [], "rhs_call_name": "bias_wrist_ft", "annotation": ""}, "snippet": " ac.bias_wrist_ft(r_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L519_C8", "label": "while", "type": "while", "loc": [519, 522], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L517_C4", "vector": [5, 2, 0.9021, 0.0069, 2, 0.32, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n f = ac.get_wrist_force(r_arm)\n print('f:', f.A1)\n rospy.sleep(0.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L520_C12", "label": "f = get_wrist_force()", "type": "assigned_variable", "loc": [520, 520], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L519_C8", "vector": [14, 3, 0.9012, 0.0017, 3, 0.97, 0.0, 899, 3, 1, 0, 0, 854, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " f = ac.get_wrist_force(r_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L521_C12", "label": "print()", "type": "expression", "loc": [521, 521], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L519_C8", "vector": [8, 3, 0.9029, 0.0017, 3, 0.97, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('f:', f.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L522_C12", "label": "sleep()", "type": "expression", "loc": [522, 522], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L519_C8", "vector": [8, 3, 0.9047, 0.0017, 3, 0.97, 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.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "label": "if", "type": "if", "loc": [525, 544], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "vector": [4, 1, 0.9263, 0.0347, 1, 0.13, 0.7273, 0, 1, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n print('hit a key to move the arms.')\n k=m3t.get_keystroke()\n\n rot_mat = tr.rotY(math.radians(-90))\n p = np.matrix([0.3, -0.24, -0.3]).T\n # q = arms.IK(l_arm, p, rot_mat)\n # ac.go_jep(l_arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L526_C8", "label": "print()", "type": "expression", "loc": [526, 526], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "vector": [8, 2, 0.9116, 0.0017, 2, 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('hit a key to move the arms.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L527_C8", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [527, 527], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "vector": [14, 2, 0.9133, 0.0017, 2, 0.74, 0.1, 954, 3, 0, 0, 0, 773, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "get_keystroke", "annotation": ""}, "snippet": " k=m3t.get_keystroke()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L529_C8", "label": "rot_mat = rotY()", "type": "assigned_variable", "loc": [529, 529], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "vector": [14, 2, 0.9168, 0.0017, 2, 0.74, 0.2, 968, 3, 1, 0, 0, 649, 10, 2], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "rotY", "annotation": ""}, "snippet": " rot_mat = tr.rotY(math.radians(-90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L530_C8", "label": "p =", "type": "assigned_variable", "loc": [530, 530], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "vector": [14, 2, 0.9185, 0.0017, 2, 0.74, 0.3, 491, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = np.matrix([0.3, -0.24, -0.3]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L534_C8", "label": "go_cep()", "type": "expression", "loc": [534, 534], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "vector": [8, 2, 0.9255, 0.0017, 2, 0.74, 0.4, 586, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "go_cep", "arg_names": [], "import_names": [], "rhs_call_name": "go_cep", "annotation": ""}, "snippet": " ac.go_cep(r_arm, p, rot_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L539_C8", "label": "sleep()", "type": "expression", "loc": [539, 539], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "vector": [8, 2, 0.9341, 0.0017, 2, 0.74, 0.5, 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_99748:Expr_L540_C8", "label": "raw_input()", "type": "expression", "loc": [540, 540], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "vector": [8, 2, 0.9359, 0.0017, 2, 0.74, 0.6, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Hit ENTER to print ee position')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L541_C8", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [541, 541], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "vector": [14, 2, 0.9376, 0.0017, 2, 0.74, 0.7, 516, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " q = ac.get_joint_angles(r_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L542_C8", "label": "ee = FK()", "type": "assigned_variable", "loc": [542, 542], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "vector": [14, 2, 0.9393, 0.0017, 2, 0.74, 0.8, 683, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "ee", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " ee = ac.arms.FK(r_arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L543_C8", "label": "print()", "type": "expression", "loc": [543, 543], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "vector": [8, 2, 0.9411, 0.0017, 2, 0.74, 0.9, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('ee:', ee.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L544_C8", "label": "print()", "type": "expression", "loc": [544, 544], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "vector": [8, 2, 0.9428, 0.0017, 2, 0.74, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('desired ee:', p.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L546_C4", "label": "if", "type": "if", "loc": [546, 553], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "vector": [4, 1, 0.9523, 0.0139, 1, 0.13, 0.8182, 0, 1, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n print('hit a key to float arms.')\n k=m3t.get_keystroke()\n ac.toggle_floating_arms()\n\n print('hit a key to UNfloat arms.')\n k=m3t.get_keystroke()\n ac.toggle_floating_arms()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L547_C8", "label": "print()", "type": "expression", "loc": [547, 547], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L546_C4", "vector": [8, 2, 0.948, 0.0017, 2, 0.5, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('hit a key to float arms.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L548_C8", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [548, 548], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L546_C4", "vector": [14, 2, 0.9497, 0.0017, 2, 0.5, 0.2, 954, 3, 0, 0, 0, 773, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "get_keystroke", "annotation": ""}, "snippet": " k=m3t.get_keystroke()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L549_C8", "label": "toggle_floating_arms()", "type": "expression", "loc": [549, 549], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L546_C4", "vector": [8, 2, 0.9515, 0.0017, 2, 0.5, 0.4, 637, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "toggle_floating_arms", "arg_names": [], "import_names": [], "rhs_call_name": "toggle_floating_arms", "annotation": ""}, "snippet": " ac.toggle_floating_arms()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L551_C8", "label": "print()", "type": "expression", "loc": [551, 551], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L546_C4", "vector": [8, 2, 0.9549, 0.0017, 2, 0.5, 0.6, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('hit a key to UNfloat arms.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L552_C8", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [552, 552], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L546_C4", "vector": [14, 2, 0.9567, 0.0017, 2, 0.5, 0.8, 954, 3, 0, 0, 0, 773, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "get_keystroke", "annotation": ""}, "snippet": " k=m3t.get_keystroke()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L553_C8", "label": "toggle_floating_arms()", "type": "expression", "loc": [553, 553], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L546_C4", "vector": [8, 2, 0.9584, 0.0017, 2, 0.5, 1.0, 637, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "toggle_floating_arms", "arg_names": [], "import_names": [], "rhs_call_name": "toggle_floating_arms", "annotation": ""}, "snippet": " ac.toggle_floating_arms()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L559_C4", "label": "if", "type": "if", "loc": [559, 563], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "vector": [4, 1, 0.9723, 0.0087, 1, 0.13, 0.9091, 0, 1, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n while not rospy.is_shutdown():\n jep = ac.get_jep(r_arm)\n print('jep:', jep)\n rospy.sleep(0.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L560_C8", "label": "while", "type": "while", "loc": [560, 563], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L559_C4", "vector": [5, 2, 0.9731, 0.0069, 2, 0.51, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n jep = ac.get_jep(r_arm)\n print('jep:', jep)\n rospy.sleep(0.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L561_C12", "label": "jep = get_jep()", "type": "assigned_variable", "loc": [561, 561], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L560_C8", "vector": [14, 3, 0.9723, 0.0017, 3, 0.35, 0.0, 838, 3, 1, 0, 0, 898, 10, 1], "semantic": {"name": "jep", "arg_names": [], "import_names": [], "rhs_call_name": "get_jep", "annotation": ""}, "snippet": " jep = ac.get_jep(r_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L562_C12", "label": "print()", "type": "expression", "loc": [562, 562], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L560_C8", "vector": [8, 3, 0.974, 0.0017, 3, 0.35, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('jep:', jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L563_C12", "label": "sleep()", "type": "expression", "loc": [563, 563], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L560_C8", "vector": [8, 3, 0.9757, 0.0017, 3, 0.35, 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.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L565_C4", "label": "if", "type": "if", "loc": [565, 573], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "vector": [4, 1, 0.9861, 0.0156, 1, 0.13, 1.0, 0, 1, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if True:\n rospy.sleep(1.)\n isc = ac.get_impedance_scale(r_arm)\n print(isc)\n isc[1] = 0.3\n ac.set_impedance_scale(r_arm, isc)\n rospy.sleep(1.)\n isc = ac.get_impedance_scale(r_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L566_C8", "label": "sleep()", "type": "expression", "loc": [566, 566], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L565_C4", "vector": [8, 2, 0.9809, 0.0017, 2, 0.79, 0.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L567_C8", "label": "isc = get_impedance_scale()", "type": "assigned_variable", "loc": [567, 567], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L565_C4", "vector": [14, 2, 0.9827, 0.0017, 2, 0.79, 0.1429, 519, 3, 1, 0, 0, 730, 10, 1], "semantic": {"name": "isc", "arg_names": [], "import_names": [], "rhs_call_name": "get_impedance_scale", "annotation": ""}, "snippet": " isc = ac.get_impedance_scale(r_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L568_C8", "label": "print()", "type": "expression", "loc": [568, 568], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L565_C4", "vector": [8, 2, 0.9844, 0.0017, 2, 0.79, 0.2857, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(isc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L569_C8", "label": "assign", "type": "assigned_variable", "loc": [569, 569], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L565_C4", "vector": [14, 2, 0.9861, 0.0017, 2, 0.79, 0.4286, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " isc[1] = 0.3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L570_C8", "label": "set_impedance_scale()", "type": "expression", "loc": [570, 570], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L565_C4", "vector": [8, 2, 0.9879, 0.0017, 2, 0.79, 0.5714, 430, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_impedance_scale", "arg_names": [], "import_names": [], "rhs_call_name": "set_impedance_scale", "annotation": ""}, "snippet": " ac.set_impedance_scale(r_arm, isc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L571_C8", "label": "sleep()", "type": "expression", "loc": [571, 571], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L565_C4", "vector": [8, 2, 0.9896, 0.0017, 2, 0.79, 0.7143, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L572_C8", "label": "isc = get_impedance_scale()", "type": "assigned_variable", "loc": [572, 572], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L565_C4", "vector": [14, 2, 0.9913, 0.0017, 2, 0.79, 0.8571, 519, 3, 1, 0, 0, 730, 10, 1], "semantic": {"name": "isc", "arg_names": [], "import_names": [], "rhs_call_name": "get_impedance_scale", "annotation": ""}, "snippet": " isc = ac.get_impedance_scale(r_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L573_C8", "label": "print()", "type": "expression", "loc": [573, 573], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L565_C4", "vector": [8, 2, 0.9931, 0.0017, 2, 0.79, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(isc)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Try_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:Try_L115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L197_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L199_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L200_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L199_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L201_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L202_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L201_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L204_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L213_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L213_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L214_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L213_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L216_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L217_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L218_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L218_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L219_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L218_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L221_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L217_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L223_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L228_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L229_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L231_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L232_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L231_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L233_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L231_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L234_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:For_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:For_L241_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L242_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:For_L241_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L243_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L256_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L256_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L256_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L258_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L259_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L258_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L260_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L261_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L260_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L263_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L256_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L256_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L270_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L271_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L272_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L271_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L273_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L274_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L280_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L282_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L282_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L282_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L284_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L284_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L285_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L284_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L286_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L287_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L286_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L289_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L282_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L291_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L282_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L292_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L297_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L297_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L298_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L298_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L299_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L298_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L300_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L300_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L301_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L297_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L304_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L297_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L305_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L297_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L297_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L315_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L316_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L318_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L319_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L320_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L323_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L324_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L325_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L327_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L328_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L330_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L332_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L332_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L333_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L332_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L335_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L337_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L338_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L339_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L340_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L340_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L342_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L340_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L344_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L344_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L345_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L340_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L346_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L346_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L347_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L346_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L348_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L346_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L350_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L340_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L352_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L352_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L353_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L353_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L354_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L352_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L355_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L352_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L356_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L359_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L360_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L364_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L365_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L367_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L367_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L368_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L370_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L374_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L375_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L376_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L378_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L379_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L380_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L382_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L383_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L384_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L385_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L386_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L398_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L399_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L401_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L402_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L403_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L403_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L404_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L406_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L407_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L408_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L409_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L410_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L411_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L413_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L414_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L415_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L416_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L417_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L418_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L418_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L420_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L418_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L421_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L418_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L422_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L418_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L424_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L424_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L425_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L424_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L426_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L418_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L428_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L418_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L429_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L418_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L430_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L430_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L431_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L431_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L432_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L430_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L433_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L433_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L434_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L430_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L436_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L430_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L437_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L418_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L440_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L440_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L441_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L440_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L442_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L443_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L449_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L449_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L451_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L449_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L452_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L452_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L453_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L452_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L454_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L452_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L455_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L455_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L456_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L455_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L457_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L457_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L458_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L457_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L460_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L449_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L462_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L449_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L463_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L449_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L465_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L465_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L466_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L449_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L467_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L449_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L469_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L449_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Return_L470_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L473_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L473_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L474_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L482_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L486_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L490_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L494_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:FunctionDef_L498_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Import_L506_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Import_L507_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Import_L508_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L510_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L511_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L513_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L514_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L517_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L517_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L518_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L517_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L519_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L520_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L521_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L522_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L526_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L527_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L529_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L530_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L534_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L539_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L540_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L541_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L542_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L543_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L525_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L544_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L546_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L546_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L547_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L546_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L548_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L546_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L549_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L546_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L551_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L546_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L552_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L546_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L553_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L559_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L559_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L560_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L560_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L561_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L560_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L562_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:While_L560_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L563_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L505_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L565_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L565_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L566_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L565_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L567_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L565_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L568_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L565_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L569_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L565_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L570_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L565_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L571_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L565_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Assign_L572_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99748:If_L565_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99748:Expr_L573_C8"}]
import numpy as np, math import roslib; roslib.load_manifest('epc_core') import rospy from std_msgs.msg import Bool ## Class defining the core EPC function and a few simple examples. # More complex behaviors that use EPC should have their own ROS # packages. class EPC(): def __init__(self, epc_name = 'epc'): self.stop_epc = False self.pause_epc = False rospy.Subscriber('/'+epc_name+'/stop', Bool, self.stop_cb) rospy.Subscriber('/'+epc_name+'/pause', Bool, self.pause_cb) def stop_cb(self, msg): self.stop_epc = msg.data self.pause_epc = False # stop/start overrides pause. def pause_cb(self, msg): self.pause_epc = msg.data ## # @param equi_pt_generator: function that returns stop, ea where ea: equilibrium angles and stop: string which is '' for epc motion to continue # @param time_step: time between successive calls to equi_pt_generator # @param timeout - time after which the epc motion will stop. # @return stop (the string which has the reason why the epc # motion stopped.), ea (last commanded equilibrium angles) def epc_motion(self, ep_gen_func, ep_gen_state, time_step, control_function=None, ep_clamp_func=None, timeout=np.inf): rt = rospy.Rate(1/time_step) timeout_at = rospy.get_time() + timeout stop = '' ea = None while stop == '': if rospy.is_shutdown(): stop = 'rospy shutdown' continue if self.stop_epc: stop = 'stop_command_over_ROS' continue if self.pause_epc: rospy.sleep(0.1) timeout_at += 0.101 # approximate. continue if timeout_at < rospy.get_time(): stop = 'timed out' if stop == '': stop, ea = equi_pt_generator(ep_gen_state) if stop == 'reset timing': stop = '' t_end = rospy.get_time() if stop == '': if clamp_func != None: ep = ea[0] ea = list(ea) ea[0] = ep_clamp_func(ep) ea = tuple(ea) control_function(*ea) rt.sleep() return stop, ea
ajibawa-2023/Python-Code-Large/train/row_99749
44
76
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Import_L2_C0", "label": "numpy import np, math", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0132, 0, 0.66, 0.0, 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_99749:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0395, 0.0132, 0, 0.66, 0.2, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('epc_core')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Expr_L3_C15", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0395, 0.0132, 0, 0.66, 0.4, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('epc_core')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0132, 0, 0.66, 0.6, 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_99749:ImportFrom_L5_C0", "label": "from std_msgs.msg import Bool", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0658, 0.0132, 0, 0.66, 0.8, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Bool"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Bool"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:ClassDef_L11_C0", "label": "EPC", "type": "class", "loc": [11, 71], "level": 0, "parent": null, "vector": [3, 0, 0.5395, 0.8026, 0, 0.66, 1.0, 417, 0, 4, 0, 0, 0, 0, 14], "semantic": {"name": "EPC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EPC():\n def __init__(self, epc_name = 'epc'):\n self.stop_epc = False\n self.pause_epc = False\n rospy.Subscriber('/'+epc_name+'/stop', Bool, self.stop_cb)\n rospy.Subscriber('/'+epc_name+'/pause', Bool, self.pause_cb)\n\n def stop_cb(self, msg):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L12_C4", "label": "__init__", "type": "function", "loc": [12, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:ClassDef_L11_C0", "vector": [2, 1, 0.1842, 0.0658, 1, 0.55, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "epc_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, epc_name = 'epc'):\n self.stop_epc = False\n self.pause_epc = False\n rospy.Subscriber('/'+epc_name+'/stop', Bool, self.stop_cb)\n rospy.Subscriber('/'+epc_name+'/pause', Bool, self.pause_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L13_C8", "label": "self.stop_epc =", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L12_C4", "vector": [14, 2, 0.1711, 0.0132, 2, 0.78, 0.0, 187, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.stop_epc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.stop_epc = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L14_C8", "label": "self.pause_epc =", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L12_C4", "vector": [14, 2, 0.1842, 0.0132, 2, 0.78, 0.3333, 193, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.pause_epc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pause_epc = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Expr_L15_C8", "label": "Subscriber()", "type": "expression", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L12_C4", "vector": [8, 2, 0.1974, 0.0132, 2, 0.78, 0.6667, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/'+epc_name+'/stop', Bool, self.stop_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Expr_L16_C8", "label": "Subscriber()", "type": "expression", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L12_C4", "vector": [8, 2, 0.2105, 0.0132, 2, 0.78, 1.0, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/'+epc_name+'/pause', Bool, self.pause_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L18_C4", "label": "stop_cb", "type": "function", "loc": [18, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:ClassDef_L11_C0", "vector": [2, 1, 0.25, 0.0395, 1, 0.55, 0.3333, 430, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "stop_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop_cb(self, msg):\n self.stop_epc = msg.data\n self.pause_epc = False # stop/start overrides pause."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L19_C8", "label": "self.stop_epc =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L18_C4", "vector": [14, 2, 0.25, 0.0132, 2, 0.42, 0.0, 187, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.stop_epc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.stop_epc = msg.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L20_C8", "label": "self.pause_epc =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L18_C4", "vector": [14, 2, 0.2632, 0.0132, 2, 0.42, 1.0, 193, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.pause_epc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pause_epc = False # stop/start overrides pause."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L22_C4", "label": "pause_cb", "type": "function", "loc": [22, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:ClassDef_L11_C0", "vector": [2, 1, 0.2961, 0.0263, 1, 0.55, 0.6667, 159, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "pause_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pause_cb(self, msg):\n self.pause_epc = msg.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L23_C8", "label": "self.pause_epc =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L22_C4", "vector": [14, 2, 0.3026, 0.0132, 2, 0.61, 0.0, 193, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.pause_epc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pause_epc = msg.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L31_C4", "label": "epc_motion", "type": "function", "loc": [31, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:ClassDef_L11_C0", "vector": [2, 1, 0.6711, 0.5395, 1, 0.55, 1.0, 938, 0, 7, 1, 0, 0, 0, 12], "semantic": {"name": "epc_motion", "arg_names": ["self", "ep_gen_func", "ep_gen_state", "time_step", "control_function", "ep_clamp_func", "timeout"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def epc_motion(self, ep_gen_func, ep_gen_state, time_step,\n control_function=None, ep_clamp_func=None,\n timeout=np.inf):\n rt = rospy.Rate(1/time_step)\n timeout_at = rospy.get_time() + timeout\n stop = ''\n ea = None\n while stop == '':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L34_C8", "label": "rt = Rate()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L31_C4", "vector": [14, 2, 0.4474, 0.0132, 2, 0.41, 0.0, 991, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "rt", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " rt = rospy.Rate(1/time_step)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L35_C8", "label": "timeout_at =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L31_C4", "vector": [14, 2, 0.4605, 0.0132, 2, 0.41, 0.2, 239, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "timeout_at", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " timeout_at = rospy.get_time() + timeout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L36_C8", "label": "stop =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L31_C4", "vector": [14, 2, 0.4737, 0.0132, 2, 0.41, 0.4, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L37_C8", "label": "ea =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L31_C4", "vector": [14, 2, 0.4868, 0.0132, 2, 0.41, 0.6, 883, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "ea", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ea = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:While_L38_C8", "label": "while", "type": "while", "loc": [38, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L31_C4", "vector": [5, 2, 0.7039, 0.4211, 2, 0.41, 0.8, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while stop == '':\n if rospy.is_shutdown():\n stop = 'rospy shutdown'\n continue\n\n if self.stop_epc:\n stop = 'stop_command_over_ROS'\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L39_C12", "label": "if", "type": "if", "loc": [39, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:While_L38_C8", "vector": [4, 3, 0.5263, 0.0395, 3, 0.37, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rospy.is_shutdown():\n stop = 'rospy shutdown'\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L40_C16", "label": "stop =", "type": "assigned_variable", "loc": [40, 40], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L39_C12", "vector": [14, 4, 0.5263, 0.0132, 4, 0.38, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'rospy shutdown'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L43_C12", "label": "if", "type": "if", "loc": [43, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:While_L38_C8", "vector": [4, 3, 0.5789, 0.0395, 3, 0.37, 0.1429, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.stop_epc:\n stop = 'stop_command_over_ROS'\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L44_C16", "label": "stop =", "type": "assigned_variable", "loc": [44, 44], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L43_C12", "vector": [14, 4, 0.5789, 0.0132, 4, 0.88, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'stop_command_over_ROS'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L47_C12", "label": "if", "type": "if", "loc": [47, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:While_L38_C8", "vector": [4, 3, 0.6382, 0.0526, 3, 0.37, 0.2857, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.pause_epc:\n rospy.sleep(0.1)\n timeout_at += 0.101 # approximate.\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Expr_L48_C16", "label": "sleep()", "type": "expression", "loc": [48, 48], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L47_C12", "vector": [8, 4, 0.6316, 0.0132, 4, 0.9, 0.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.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L52_C12", "label": "if", "type": "if", "loc": [52, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:While_L38_C8", "vector": [4, 3, 0.6908, 0.0263, 3, 0.37, 0.4286, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if timeout_at < rospy.get_time():\n stop = 'timed out'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L53_C16", "label": "stop =", "type": "assigned_variable", "loc": [53, 53], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L52_C12", "vector": [14, 4, 0.6974, 0.0132, 4, 0.19, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'timed out'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L54_C12", "label": "if", "type": "if", "loc": [54, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:While_L38_C8", "vector": [4, 3, 0.7171, 0.0263, 3, 0.37, 0.5714, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stop == '':\n stop, ea = equi_pt_generator(ep_gen_state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L55_C16", "label": "stop, ea = equi_pt_generator()", "type": "assigned_variable", "loc": [55, 55], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L54_C12", "vector": [14, 4, 0.7237, 0.0132, 4, 0.49, 0.0, 665, 3, 1, 0, 0, 648, 10, 1], "semantic": {"name": "stop, ea", "arg_names": [], "import_names": [], "rhs_call_name": "equi_pt_generator", "annotation": ""}, "snippet": " stop, ea = equi_pt_generator(ep_gen_state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L56_C12", "label": "if", "type": "if", "loc": [56, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:While_L38_C8", "vector": [4, 3, 0.75, 0.0395, 3, 0.37, 0.7143, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stop == 'reset timing':\n stop = ''\n t_end = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L57_C16", "label": "stop =", "type": "assigned_variable", "loc": [57, 57], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L56_C12", "vector": [14, 4, 0.75, 0.0132, 4, 0.71, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L58_C16", "label": "t_end = get_time()", "type": "assigned_variable", "loc": [58, 58], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L56_C12", "vector": [14, 4, 0.7632, 0.0132, 4, 0.71, 1.0, 945, 3, 0, 0, 0, 164, 10, 1], "semantic": {"name": "t_end", "arg_names": [], "import_names": [], "rhs_call_name": "get_time", "annotation": ""}, "snippet": " t_end = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L60_C12", "label": "if", "type": "if", "loc": [60, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:While_L38_C8", "vector": [4, 3, 0.8355, 0.1053, 3, 0.37, 0.8571, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stop == '':\n if clamp_func != None:\n ep = ea[0]\n ea = list(ea)\n ea[0] = ep_clamp_func(ep)\n ea = tuple(ea)\n\n control_function(*ea)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L61_C16", "label": "if", "type": "if", "loc": [61, 65], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L60_C12", "vector": [4, 4, 0.8289, 0.0658, 4, 0.27, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if clamp_func != None:\n ep = ea[0]\n ea = list(ea)\n ea[0] = ep_clamp_func(ep)\n ea = tuple(ea)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L62_C20", "label": "ep =", "type": "assigned_variable", "loc": [62, 62], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L61_C16", "vector": [14, 5, 0.8158, 0.0132, 5, 0.69, 0.0, 787, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ep = ea[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L63_C20", "label": "ea = list()", "type": "assigned_variable", "loc": [63, 63], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L61_C16", "vector": [14, 5, 0.8289, 0.0132, 5, 0.69, 0.3333, 883, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "ea", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " ea = list(ea)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L64_C20", "label": " = ep_clamp_func()", "type": "assigned_variable", "loc": [64, 64], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L61_C16", "vector": [14, 5, 0.8421, 0.0132, 5, 0.69, 0.6667, 0, 3, 1, 0, 0, 297, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "ep_clamp_func", "annotation": ""}, "snippet": " ea[0] = ep_clamp_func(ep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L65_C20", "label": "ea = tuple()", "type": "assigned_variable", "loc": [65, 65], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L61_C16", "vector": [14, 5, 0.8553, 0.0132, 5, 0.69, 1.0, 883, 3, 1, 0, 0, 259, 10, 1], "semantic": {"name": "ea", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": " ea = tuple(ea)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Expr_L67_C16", "label": "control_function()", "type": "expression", "loc": [67, 67], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L60_C12", "vector": [8, 4, 0.8816, 0.0132, 4, 0.27, 1.0, 736, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "control_function", "arg_names": [], "import_names": [], "rhs_call_name": "control_function", "annotation": ""}, "snippet": " control_function(*ea)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Expr_L69_C12", "label": "sleep()", "type": "expression", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:While_L38_C8", "vector": [8, 3, 0.9079, 0.0132, 3, 0.37, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rt.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99749:Return_L71_C8", "label": "return", "type": "return", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L31_C4", "vector": [13, 2, 0.9342, 0.0132, 2, 0.41, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return stop, ea"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99749:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Expr_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Expr_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:While_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:While_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L39_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L40_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:While_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L43_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L44_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:While_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L47_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Expr_L48_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:While_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L52_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L53_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:While_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L54_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L55_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:While_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L56_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L57_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L56_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L58_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:While_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L60_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L61_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L61_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L62_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L61_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L63_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L61_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L64_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L61_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Assign_L65_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:If_L60_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Expr_L67_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:While_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Expr_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99749:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99749:Return_L71_C8"}]
# # Any robot that wants to use EPC should implement the functions # sketched out in the HRLArm and HRLArmKinematics # import numpy as np, math class HRLArm(): def __init__(self, kinematics): # object of class derived from HRLArmKinematics self.kinematics = kinematics self.ep = None # equilibrium point #------- abstract functions --------- def get_joint_angles(): raise RuntimeError('Unimplemented Function') def set_ep(self, *args): raise RuntimeError('Unimplemented Function') def get_ep(self): raise RuntimeError('Unimplemented Function') def viz_ep(self, ep): raise RuntimeError('Unimplemented Function') def freeze(self): self.set_ep(self.get_ep()) def get_end_effector_pose(self): return self.kinematics.FK(self.get_joint_angles()) class HRLArmKinematics(): def __init__(self): self.tooltip_pos = np.matrix([0.,0.,0.]).T self.tooltip_rot = np.matrix(np.eye(3)) # @param q - array-like (RADIANs) # @param link_number - perform FK up to this link. (1-7) # @return pos (3X1) np matrix, rot (3X3) np matrix def FK(self, q, link_number=None): raise RuntimeError('Unimplemented Function') def IK(self, p, rot, q_guess=None): raise RuntimeError('Unimplemented Function') ## compute Jacobian at point pos. def Jacobian(self, q, pos=None): raise RuntimeError('Unimplemented Function') ## compute Jacobian at point pos. def jacobian(self, q, pos=None): raise RuntimeError('Unimplemented Function') ## define tooltip as a 3x1 np matrix in the wrist coord frame. def set_tooltip(self, arm, p, rot=np.matrix(np.eye(3))): self.tooltip_pos = p self.tooltip_rot = rot
ajibawa-2023/Python-Code-Large/train/row_99750
24
64
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99750:Import_L7_C0", "label": "numpy import np, math", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1094, 0.0156, 0, 0.66, 0.0, 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_99750:ClassDef_L10_C0", "label": "HRLArm", "type": "class", "loc": [10, 33], "level": 0, "parent": null, "vector": [3, 0, 0.3359, 0.375, 0, 0.66, 0.5, 794, 0, 7, 0, 0, 0, 0, 8], "semantic": {"name": "HRLArm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class HRLArm():\n def __init__(self, kinematics):\n # object of class derived from HRLArmKinematics\n self.kinematics = kinematics\n self.ep = None # equilibrium point\n\n #------- abstract functions ---------\n def get_joint_angles():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L11_C4", "label": "__init__", "type": "function", "loc": [11, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L10_C0", "vector": [2, 1, 0.1953, 0.0625, 1, 0.37, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "kinematics"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, kinematics):\n # object of class derived from HRLArmKinematics\n self.kinematics = kinematics\n self.ep = None # equilibrium point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:Assign_L13_C8", "label": "self.kinematics =", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L11_C4", "vector": [14, 2, 0.2031, 0.0156, 2, 0.87, 0.0, 239, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.kinematics", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.kinematics = kinematics"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:Assign_L14_C8", "label": "self.ep =", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L11_C4", "vector": [14, 2, 0.2188, 0.0156, 2, 0.87, 1.0, 381, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.ep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ep = None # equilibrium point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L17_C4", "label": "get_joint_angles", "type": "function", "loc": [17, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L10_C0", "vector": [2, 1, 0.2734, 0.0312, 1, 0.37, 0.1667, 820, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "get_joint_angles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_joint_angles():\n raise RuntimeError('Unimplemented Function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L20_C4", "label": "set_ep", "type": "function", "loc": [20, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L10_C0", "vector": [2, 1, 0.3203, 0.0312, 1, 0.37, 0.3333, 547, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_ep", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_ep(self, *args):\n raise RuntimeError('Unimplemented Function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L23_C4", "label": "get_ep", "type": "function", "loc": [23, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L10_C0", "vector": [2, 1, 0.3672, 0.0312, 1, 0.37, 0.5, 563, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "get_ep", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_ep(self):\n raise RuntimeError('Unimplemented Function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L26_C4", "label": "viz_ep", "type": "function", "loc": [26, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L10_C0", "vector": [2, 1, 0.4141, 0.0312, 1, 0.37, 0.6667, 954, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "viz_ep", "arg_names": ["self", "ep"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def viz_ep(self, ep):\n raise RuntimeError('Unimplemented Function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L29_C4", "label": "freeze", "type": "function", "loc": [29, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L10_C0", "vector": [2, 1, 0.4609, 0.0312, 1, 0.37, 0.8333, 963, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "freeze", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def freeze(self):\n self.set_ep(self.get_ep())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:Expr_L30_C8", "label": "set_ep()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L29_C4", "vector": [8, 2, 0.4688, 0.0156, 2, 0.28, 0.0, 547, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_ep", "arg_names": [], "import_names": [], "rhs_call_name": "set_ep", "annotation": ""}, "snippet": " self.set_ep(self.get_ep())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L32_C4", "label": "get_end_effector_pose", "type": "function", "loc": [32, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L10_C0", "vector": [2, 1, 0.5078, 0.0312, 1, 0.37, 1.0, 254, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "get_end_effector_pose", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_end_effector_pose(self):\n return self.kinematics.FK(self.get_joint_angles())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:Return_L33_C8", "label": "return", "type": "return", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L32_C4", "vector": [13, 2, 0.5156, 0.0156, 2, 0.63, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.kinematics.FK(self.get_joint_angles())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L36_C0", "label": "HRLArmKinematics", "type": "class", "loc": [36, 61], "level": 0, "parent": null, "vector": [3, 0, 0.7578, 0.4062, 0, 0.66, 1.0, 235, 0, 6, 0, 0, 0, 0, 9], "semantic": {"name": "HRLArmKinematics", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class HRLArmKinematics():\n def __init__(self):\n self.tooltip_pos = np.matrix([0.,0.,0.]).T\n self.tooltip_rot = np.matrix(np.eye(3))\n\n # @param q - array-like (RADIANs)\n # @param link_number - perform FK up to this link. (1-7)\n # @return pos (3X1) np matrix, rot (3X3) np matrix"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L37_C4", "label": "__init__", "type": "function", "loc": [37, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L36_C0", "vector": [2, 1, 0.5938, 0.0469, 1, 0.68, 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 self.tooltip_pos = np.matrix([0.,0.,0.]).T\n self.tooltip_rot = np.matrix(np.eye(3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:Assign_L38_C8", "label": "self.tooltip_pos =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L37_C4", "vector": [14, 2, 0.5938, 0.0156, 2, 0.21, 0.0, 302, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.tooltip_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tooltip_pos = np.matrix([0.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:Assign_L39_C8", "label": "self.tooltip_rot = matrix()", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L37_C4", "vector": [14, 2, 0.6094, 0.0156, 2, 0.21, 1.0, 395, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "self.tooltip_rot", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " self.tooltip_rot = np.matrix(np.eye(3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L44_C4", "label": "FK", "type": "function", "loc": [44, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L36_C0", "vector": [2, 1, 0.6953, 0.0312, 1, 0.68, 0.2, 252, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "FK", "arg_names": ["self", "q", "link_number"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def FK(self, q, link_number=None):\n raise RuntimeError('Unimplemented Function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L47_C4", "label": "IK", "type": "function", "loc": [47, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L36_C0", "vector": [2, 1, 0.7422, 0.0312, 1, 0.68, 0.4, 719, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "IK", "arg_names": ["self", "p", "rot", "q_guess"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def IK(self, p, rot, q_guess=None):\n raise RuntimeError('Unimplemented Function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L51_C4", "label": "Jacobian", "type": "function", "loc": [51, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L36_C0", "vector": [2, 1, 0.8047, 0.0312, 1, 0.68, 0.6, 182, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Jacobian", "arg_names": ["self", "q", "pos"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def Jacobian(self, q, pos=None):\n raise RuntimeError('Unimplemented Function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L55_C4", "label": "jacobian", "type": "function", "loc": [55, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L36_C0", "vector": [2, 1, 0.8672, 0.0312, 1, 0.68, 0.8, 8, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "jacobian", "arg_names": ["self", "q", "pos"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def jacobian(self, q, pos=None):\n raise RuntimeError('Unimplemented Function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L59_C4", "label": "set_tooltip", "type": "function", "loc": [59, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L36_C0", "vector": [2, 1, 0.9375, 0.0469, 1, 0.68, 1.0, 350, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "set_tooltip", "arg_names": ["self", "arm", "p", "rot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_tooltip(self, arm, p, rot=np.matrix(np.eye(3))):\n self.tooltip_pos = p\n self.tooltip_rot = rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:Assign_L60_C8", "label": "self.tooltip_pos =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L59_C4", "vector": [14, 2, 0.9375, 0.0156, 2, 0.95, 0.0, 302, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tooltip_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tooltip_pos = p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99750:Assign_L61_C8", "label": "self.tooltip_rot =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L59_C4", "vector": [14, 2, 0.9531, 0.0156, 2, 0.95, 1.0, 395, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tooltip_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tooltip_rot = rot"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99750:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99750:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99750:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99750:Return_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99750:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99750:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99750:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99750:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99750:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99750:Assign_L61_C8"}]
# # subscribe to thw joint angles and raw forces topics, and provide FK # etc. # # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Author: Advait Jain import numpy as np, math from threading import RLock, Timer import sys, copy import roslib; roslib.load_manifest('epc_core') roslib.load_manifest('force_torque') # hack by Advait import force_torque.FTClient as ftc import tf import hrl_lib.transforms as tr import hrl_lib.viz as hv import rospy import PyKDL as kdl import actionlib from actionlib_msgs.msg import GoalStatus from pr2_controllers_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal, JointTrajectoryControllerState from pr2_controllers_msgs.msg import Pr2GripperCommandGoal, Pr2GripperCommandAction, Pr2GripperCommand from kinematics_msgs.srv import GetPositionIK, GetPositionIKRequest, GetPositionIKResponse from kinematics_msgs.srv import GetPositionFK, GetPositionFKRequest, GetPositionFKResponse from trajectory_msgs.msg import JointTrajectoryPoint from geometry_msgs.msg import PoseStamped, Pose, Point, Quaternion from teleop_controllers.msg import JTTeleopControllerState from std_msgs.msg import Float64 from sensor_msgs.msg import JointState import hrl_lib.transforms as tr import hrl_lib.kdl_utils as ku import time from visualization_msgs.msg import Marker node_name = "pr2_arms" def log(str): rospy.loginfo(node_name + ": " + str) class PR2Arms(): def __init__(self, primary_ft_sensor=None): log("Loading PR2Arms") self.arms = PR2Arms_kdl() # KDL chain. self.joint_names_list = [['r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint'], ['l_shoulder_pan_joint', 'l_shoulder_lift_joint', 'l_upper_arm_roll_joint', 'l_elbow_flex_joint', 'l_forearm_roll_joint', 'l_wrist_flex_joint', 'l_wrist_roll_joint']] self.arm_state_lock = [RLock(), RLock()] self.jep = [None, None] self.arm_angles = [None, None] self.torso_position = None self.arm_efforts = [None, None] self.r_arm_cart_pub = rospy.Publisher('/r_cart/command_pose', PoseStamped) self.l_arm_cart_pub = rospy.Publisher('/l_cart/command_pose', PoseStamped) rospy.Subscriber('/r_cart/state', JTTeleopControllerState, self.r_cart_state_cb) rospy.Subscriber('/l_cart/state', JTTeleopControllerState, self.l_cart_state_cb) rospy.Subscriber('/joint_states', JointState, self.joint_states_cb) self.marker_pub = rospy.Publisher('/pr2_arms/viz_markers', Marker) self.cep_marker_id = 1 self.r_arm_ftc = ftc.FTClient('force_torque_ft2') self.r_arm_ftc_estimate = ftc.FTClient('force_torque_ft2_estimate') self.tf_lstnr = tf.TransformListener() if primary_ft_sensor == 'ati': self.get_wrist_force = self.get_wrist_force_ati if primary_ft_sensor == 'estimate': self.get_wrist_force = self.get_wrist_force_estimate r_action_client = actionlib.SimpleActionClient('r_arm_controller/joint_trajectory_action', JointTrajectoryAction) l_action_client = actionlib.SimpleActionClient('l_arm_controller/joint_trajectory_action', JointTrajectoryAction) self.joint_action_client = [r_action_client, l_action_client] r_gripper_client = actionlib.SimpleActionClient('r_gripper_controller/gripper_action', Pr2GripperCommandAction) l_gripper_client = actionlib.SimpleActionClient('l_gripper_controller/gripper_action', Pr2GripperCommandAction) self.gripper_action_client = [r_gripper_client, l_gripper_client] r_ik_srv = rospy.ServiceProxy('pr2_right_arm_kinematics/get_ik', GetPositionIK) l_ik_srv = rospy.ServiceProxy('pr2_left_arm_kinematics/get_ik', GetPositionIK) self.ik_srv = [r_ik_srv, l_ik_srv] r_fk_srv = rospy.ServiceProxy('pr2_right_arm_kinematics/get_fk', GetPositionFK) l_fk_srv = rospy.ServiceProxy('pr2_left_arm_kinematics/get_fk', GetPositionFK) self.fk_srv = [r_fk_srv, l_fk_srv] rospy.sleep(2.) # self.joint_action_client[0].wait_for_server() # self.joint_action_client[1].wait_for_server() self.gripper_action_client[0].wait_for_server() self.gripper_action_client[1].wait_for_server() log("Finished loading SimpleArmManger") ## # Callback for /joint_states topic. Updates current joint # angles and efforts for the arms constantly # @param data JointState message recieved from the /joint_states topic def joint_states_cb(self, data): arm_angles = [[], []] arm_efforts = [[], []] r_jt_idx_list = [0]*7 l_jt_idx_list = [0]*7 for i, jt_nm in enumerate(self.joint_names_list[0]): r_jt_idx_list[i] = data.name.index(jt_nm) for i, jt_nm in enumerate(self.joint_names_list[1]): l_jt_idx_list[i] = data.name.index(jt_nm) for i in range(7): idx = r_jt_idx_list[i] if data.name[idx] != self.joint_names_list[0][i]: raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', data.name[idx], i)) arm_angles[0].append(data.position[idx]) arm_efforts[0].append(data.effort[idx]) idx = l_jt_idx_list[i] if data.name[idx] != self.joint_names_list[1][i]: raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', data.name[idx], i)) #ang = tr.angle_within_mod180(data.position[idx]) ang = data.position[idx] arm_angles[1] += [ang] arm_efforts[1] += [data.effort[idx]] self.arm_state_lock[0].acquire() self.arm_angles[0] = arm_angles[0] self.arm_efforts[0] = arm_efforts[0] torso_idx = data.name.index('torso_lift_joint') self.torso_position = data.position[torso_idx] self.arm_state_lock[0].release() self.arm_state_lock[1].acquire() self.arm_angles[1] = arm_angles[1] self.arm_efforts[1] = arm_efforts[1] self.arm_state_lock[1].release() def r_cart_state_cb(self, msg): try: trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link', 'r_gripper_tool_frame', rospy.Time(0)) rot = tr.quaternion_to_matrix(quat) tip = np.matrix([0.12, 0., 0.]).T self.r_ee_pos = rot*tip + np.matrix(trans).T self.r_ee_rot = rot marker = Marker() marker.header.frame_id = 'torso_lift_link' time_stamp = rospy.Time.now() marker.header.stamp = time_stamp marker.ns = 'aloha land' marker.type = Marker.SPHERE marker.action = Marker.ADD marker.pose.position.x = self.r_ee_pos[0,0] marker.pose.position.y = self.r_ee_pos[1,0] marker.pose.position.z = self.r_ee_pos[2,0] size = 0.02 marker.scale.x = size marker.scale.y = size marker.scale.z = size marker.lifetime = rospy.Duration() marker.id = 71 marker.pose.orientation.x = 0 marker.pose.orientation.y = 0 marker.pose.orientation.z = 0 marker.pose.orientation.w = 1 color = (0.5, 0., 0.0) marker.color.r = color[0] marker.color.g = color[1] marker.color.b = color[2] marker.color.a = 1. self.marker_pub.publish(marker) ros_pt = msg.x_desi_filtered.pose.position x, y, z = ros_pt.x, ros_pt.y, ros_pt.z self.r_cep_pos = np.matrix([x, y, z]).T pt = rot.T * (np.matrix([x,y,z]).T - np.matrix(trans).T) pt = pt + tip self.r_cep_pos_hooktip = rot*pt + np.matrix(trans).T ros_quat = msg.x_desi_filtered.pose.orientation quat = (ros_quat.x, ros_quat.y, ros_quat.z, ros_quat.w) self.r_cep_rot = tr.quaternion_to_matrix(quat) except: return def l_cart_state_cb(self, msg): ros_pt = msg.x_desi_filtered.pose.position self.l_cep_pos = np.matrix([ros_pt.x, ros_pt.y, ros_pt.z]).T ros_quat = msg.x_desi_filtered.pose.orientation quat = (ros_quat.x, ros_quat.y, ros_quat.z, ros_quat.w) self.l_cep_rot = tr.quaternion_to_matrix(quat) def IK(self, arm, pos, rot, q_guess=[0]*7): ik_req = GetPositionIKRequest() ik_req.timeout = rospy.Duration(5.) if arm == 0: ik_req.ik_request.ik_link_name = 'r_wrist_roll_link' else: ik_req.ik_request.ik_link_name = 'l_wrist_roll_link' ik_req.ik_request.pose_stamped.header.frame_id = 'torso_lift_link' quat = tr.matrix_to_quaternion(rot) ik_req.ik_request.pose_stamped.pose = Pose(Point(*pos), Quaternion(*quat)) ik_req.ik_request.ik_seed_state.joint_state.position = q_guess ik_req.ik_request.ik_seed_state.joint_state.name = self.joint_names_list[arm] ik_resp = self.ik_srv[arm].call(ik_req) return ik_resp.solution.joint_state.position def FK(self, arm, q): fk_req = GetPositionFKRequest() fk_req.header.frame_id = 'torso_lift_link' if arm == 0: fk_req.fk_link_names.append('r_wrist_roll_link') else: fk_req.fk_link_names.append('l_wrist_roll_link') fk_req.robot_state.joint_state.name = self.joint_names_list[arm] fk_req.robot_state.joint_state.position = q fk_resp = self.fk_srv[arm].call(fk_req) if fk_resp.error_code.val == fk_resp.error_code.SUCCESS: x = fk_resp.pose_stamped[0].pose.position.x y = fk_resp.pose_stamped[0].pose.position.y z = fk_resp.pose_stamped[0].pose.position.z pos = [x, y, z] q1 = fk_resp.pose_stamped[0].pose.orientation.x q2 = fk_resp.pose_stamped[0].pose.orientation.y q3 = fk_resp.pose_stamped[0].pose.orientation.z q4 = fk_resp.pose_stamped[0].pose.orientation.w quat = [q1,q2,q3,q4] rot = tr.quaternion_to_matrix(quat) else: rospy.logerr('Forward kinematics failed') return None, None return pos, rot ## Returns the current position, rotation of the arm. # @param arm 0 for right, 1 for left # @return position, rotation def end_effector_pos(self, arm): q = self.get_joint_angles(arm) return self.arms.FK_all(arm, q) ## Returns the list of 7 joint angles # @param arm 0 for right, 1 for left # @return list of 7 joint angles def get_joint_angles(self, arm): if arm != 1: arm = 0 self.arm_state_lock[arm].acquire() q = self.wrap_angles(self.arm_angles[arm]) self.arm_state_lock[arm].release() return q def set_jep(self, arm, q, duration=0.15): if q is None or len(q) != 7: raise RuntimeError("set_jep value is " + str(q)) self.arm_state_lock[arm].acquire() jtg = JointTrajectoryGoal() jtg.trajectory.joint_names = self.joint_names_list[arm] jtp = JointTrajectoryPoint() jtp.positions = q #jtp.velocities = [0 for i in range(len(q))] #jtp.accelerations = [0 for i in range(len(q))] jtp.time_from_start = rospy.Duration(duration) jtg.trajectory.points.append(jtp) self.joint_action_client[arm].send_goal(jtg) self.jep[arm] = q cep, r = self.arms.FK_all(arm, q) self.arm_state_lock[arm].release() o = np.matrix([0.,0.,0.,1.]).T cep_marker = hv.single_marker(cep, o, 'sphere', '/torso_lift_link', color=(0., 0., 1., 1.), scale = (0.02, 0.02, 0.02), m_id = self.cep_marker_id) cep_marker.header.stamp = rospy.Time.now() self.marker_pub.publish(cep_marker) def get_jep(self, arm): self.arm_state_lock[arm].acquire() jep = copy.copy(self.jep[arm]) self.arm_state_lock[arm].release() return jep def get_ee_jtt(self, arm): if arm == 0: return self.r_ee_pos, self.r_ee_rot else: return self.l_ee_pos, self.l_ee_rot def get_cep_jtt(self, arm, hook_tip = False): if arm == 0: if hook_tip: return self.r_cep_pos_hooktip, self.r_cep_rot else: return self.r_cep_pos, self.r_cep_rot else: return self.l_cep_pos, self.l_cep_rot # set a cep using the Jacobian Transpose controller. def set_cep_jtt(self, arm, p, rot=None): if arm != 1: arm = 0 ps = PoseStamped() ps.header.stamp = rospy.rostime.get_rostime() ps.header.frame_id = 'torso_lift_link' ps.pose.position.x = p[0,0] ps.pose.position.y = p[1,0] ps.pose.position.z = p[2,0] if rot == None: if arm == 0: rot = self.r_cep_rot else: rot = self.l_cep_rot quat = tr.matrix_to_quaternion(rot) ps.pose.orientation.x = quat[0] ps.pose.orientation.y = quat[1] ps.pose.orientation.z = quat[2] ps.pose.orientation.w = quat[3] if arm == 0: self.r_arm_cart_pub.publish(ps) else: self.l_arm_cart_pub.publish(ps) # rotational interpolation unimplemented. def go_cep_jtt(self, arm, p): step_size = 0.01 sleep_time = 0.1 cep_p, cep_rot = self.get_cep_jtt(arm) unit_vec = (p-cep_p) unit_vec = unit_vec / np.linalg.norm(unit_vec) while np.linalg.norm(p-cep_p) > step_size: cep_p += unit_vec * step_size self.set_cep_jtt(arm, cep_p) rospy.sleep(sleep_time) self.set_cep_jtt(arm, p) rospy.sleep(sleep_time) #----------- forces ------------ # force that is being applied on the wrist. (estimate as returned # by the cartesian controller) def get_wrist_force_estimate(self, arm, bias = True, base_frame = False): if arm != 0: rospy.logerr('Unsupported arm: %d'%arm) raise RuntimeError('Unimplemented function') f = self.r_arm_ftc_estimate.read(without_bias = not bias) f = f[0:3, :] if base_frame: trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link', '/ft2_estimate', rospy.Time(0)) rot = tr.quaternion_to_matrix(quat) f = rot * f return -f # the negative is intentional (Advait, Nov 24. 2010.) # force that is being applied on the wrist. def get_wrist_force_ati(self, arm, bias = True, base_frame = False): if arm != 0: rospy.logerr('Unsupported arm: %d'%arm) raise RuntimeError('Unimplemented function') f = self.r_arm_ftc.read(without_bias = not bias) f = f[0:3, :] if base_frame: trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link', '/ft2', rospy.Time(0)) rot = tr.quaternion_to_matrix(quat) f = rot * f return -f # the negative is intentional (Advait, Nov 24. 2010.) ## Returns the list of 7 joint angles # @param arm 0 for right, 1 for left # @return list of 7 joint angles def get_force_from_torques(self, arm): if arm != 1: arm = 0 self.arm_state_lock[arm].acquire() q = self.arm_angles[arm] tau = self.arm_efforts[arm] self.arm_state_lock[arm].release() p, _ = self.arms.FK_all(arm, q) J = self.arms.Jacobian(arm, q, p) f = np.linalg.pinv(J.T) * np.matrix(tau).T f = f[0:3,:] return -f def bias_wrist_ft(self, arm): if arm != 0: rospy.logerr('Unsupported arm: %d'%arm) raise RuntimeError('Unimplemented function') self.r_arm_ftc.bias() self.r_arm_ftc_estimate.bias() #-------- gripper functions ------------ def move_gripper(self, arm, amount=0.08, effort = 15): self.gripper_action_client[arm].send_goal(Pr2GripperCommandGoal(Pr2GripperCommand(position=amount, max_effort = effort))) ## Open the gripper # @param arm 0 for right, 1 for left def open_gripper(self, arm): self.move_gripper(arm, 0.08, -1) ## Close the gripper # @param arm 0 for right, 1 for left def close_gripper(self, arm, effort = 15): self.move_gripper(arm, 0.0, effort) def wrap_angles(self, q): for ind in [4, 6]: while q[ind] < -np.pi: q[ind] += 2*np.pi while q[ind] > np.pi: q[ind] -= 2*np.pi return q ## # using KDL for pr2 arm kinematics. class PR2Arms_kdl(): def __init__(self): self.right_chain = self.create_right_chain() fk, ik_v, ik_p, jac = self.create_solvers(self.right_chain) self.right_fk = fk self.right_ik_v = ik_v self.right_ik_p = ik_p self.right_jac = jac self.right_tooltip = np.matrix([0.,0.,0.]).T def create_right_chain(self): ch = kdl.Chain() self.right_arm_base_offset_from_torso_lift_link = np.matrix([0., -0.188, 0.]).T # shoulder pan ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotZ),kdl.Frame(kdl.Vector(0.1,0.,0.)))) # shoulder lift ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,0.)))) # upper arm roll ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.4,0.,0.)))) # elbox flex ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.0,0.,0.)))) # forearm roll ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.321,0.,0.)))) # wrist flex ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,0.)))) # wrist roll ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.,0.,0.)))) return ch def create_solvers(self, ch): fk = kdl.ChainFkSolverPos_recursive(ch) ik_v = kdl.ChainIkSolverVel_pinv(ch) ik_p = kdl.ChainIkSolverPos_NR(ch, fk, ik_v) jac = kdl.ChainJntToJacSolver(ch) return fk, ik_v, ik_p, jac ## define tooltip as a 3x1 np matrix in the wrist coord frame. def set_tooltip(self, arm, p): if arm == 0: self.right_tooltip = p else: rospy.logerr('Arm %d is not supported.'%(arm)) def FK_kdl(self, arm, q, link_number): if arm == 0: fk = self.right_fk endeffec_frame = kdl.Frame() kinematics_status = fk.JntToCart(q, endeffec_frame, link_number) if kinematics_status >= 0: return endeffec_frame else: rospy.loginfo('Could not compute forward kinematics.') return None else: msg = '%s arm not supported.'%(arm) rospy.logerr(msg) raise RuntimeError(msg) ## returns point in torso lift link. def FK_all(self, arm, q, link_number = 7): q = self.pr2_to_kdl(q) frame = self.FK_kdl(arm, q, link_number) pos = frame.p pos = ku.kdl_vec_to_np(pos) pos = pos + self.right_arm_base_offset_from_torso_lift_link m = frame.M rot = ku.kdl_rot_to_np(m) if arm == 0: tooltip_baseframe = rot * self.right_tooltip pos += tooltip_baseframe else: rospy.logerr('Arm %d is not supported.'%(arm)) return None return pos, rot def kdl_to_pr2(self, q): if q == None: return None q_pr2 = [0] * 7 q_pr2[0] = q[0] q_pr2[1] = q[1] q_pr2[2] = q[2] q_pr2[3] = q[3] q_pr2[4] = q[4] q_pr2[5] = q[5] q_pr2[6] = q[6] return q_pr2 def pr2_to_kdl(self, q): if q == None: return None n = len(q) q_kdl = kdl.JntArray(n) for i in range(n): q_kdl[i] = q[i] return q_kdl def Jac_kdl(self, arm, q): J_kdl = kdl.Jacobian(7) if arm != 0: rospy.logerr('Unsupported arm: '+ str(arm)) return None self.right_jac.JntToJac(q,J_kdl) kdl_jac = np.matrix([ [J_kdl[0,0],J_kdl[0,1],J_kdl[0,2],J_kdl[0,3],J_kdl[0,4],J_kdl[0,5],J_kdl[0,6]], [J_kdl[1,0],J_kdl[1,1],J_kdl[1,2],J_kdl[1,3],J_kdl[1,4],J_kdl[1,5],J_kdl[1,6]], [J_kdl[2,0],J_kdl[2,1],J_kdl[2,2],J_kdl[2,3],J_kdl[2,4],J_kdl[2,5],J_kdl[2,6]], [J_kdl[3,0],J_kdl[3,1],J_kdl[3,2],J_kdl[3,3],J_kdl[3,4],J_kdl[3,5],J_kdl[3,6]], [J_kdl[4,0],J_kdl[4,1],J_kdl[4,2],J_kdl[4,3],J_kdl[4,4],J_kdl[4,5],J_kdl[4,6]], [J_kdl[5,0],J_kdl[5,1],J_kdl[5,2],J_kdl[5,3],J_kdl[5,4],J_kdl[5,5],J_kdl[5,6]], ]) return kdl_jac ## compute Jacobian (at wrist). # @param arm - 0 or 1 # @param q - list of 7 joint angles. # @return 6x7 np matrix def Jac(self, arm, q): rospy.logerr('Jac only works for getting the Jacobian at the wrist. Use Jacobian to get the Jacobian at a general location.') jntarr = self.pr2_to_kdl(q) kdl_jac = self.Jac_kdl(arm, jntarr) pr2_jac = kdl_jac return pr2_jac ## compute Jacobian at point pos. # p is in the torso_lift_link coord frame. # this is wrapper function def jacobian(self, arm, q, pos): return self.Jacobian(arm, q, pos) ## compute Jacobian at point pos. # p is in the torso_lift_link coord frame. def Jacobian(self, arm, q, pos): if arm != 0: rospy.logerr('Arm %d is not supported.'%(arm)) return None tooltip = self.right_tooltip self.right_tooltip = np.matrix([0.,0.,0.]).T v_list = [] w_list = [] for i in range(7): p, rot = self.FK_all(arm, q, i) r = pos - p z_idx = self.right_chain.getSegment(i).getJoint().getType() - 1 z = rot[:, z_idx] v_list.append(np.matrix(np.cross(z.A1, r.A1)).T) w_list.append(z) J = np.row_stack((np.column_stack(v_list), np.column_stack(w_list))) self.right_tooltip = tooltip return J def close_to_singularity(self, arm, q): pass def within_joint_limits(self, arm, q, delta_list=[0., 0., 0., 0., 0., 0., 0.]): if arm == 0: # right arm min_arr = np.radians(np.array([-109., -24, -220, -132, -np.inf, -120, -np.inf])) #max_arr = np.radians(np.array([26., 68, 41, 0, np.inf, 0, np.inf])) max_arr = np.radians(np.array([26., 68, 41, 5, np.inf, 5, np.inf])) # 5 to prevent singularity. Need to come up with a better solution. else: raise RuntimeError('within_joint_limits unimplemented for left arm') q_arr = np.array(q) d_arr = np.array(delta_list) return np.all((q_arr <= max_arr+d_arr, q_arr >= min_arr-d_arr)) if __name__ == '__main__': from visualization_msgs.msg import Marker import hrl_lib.viz as hv rospy.init_node('pr2_arms_test') pr2_arms = PR2Arms() pr2_kdl = PR2Arms_kdl() r_arm, l_arm = 0, 1 arm = r_arm if False: np.set_printoptions(precision=2, suppress=True) while not rospy.is_shutdown(): q = pr2_arms.get_joint_angles(arm) print 'q in degrees:', np.degrees(q) rospy.sleep(0.1) if False: jep = [0.] * 7 rospy.loginfo('Going to home location.') raw_input('Hit ENTER to go') pr2_arms.set_jep(arm, jep, duration=2.) if False: # testing FK by publishing a frame marker. marker_pub = rospy.Publisher('/pr2_kdl/ee_marker', Marker) pr2_kdl.set_tooltip(arm, np.matrix([0.15, 0., 0.]).T) rt = rospy.Rate(100) rospy.loginfo('Starting the maker publishing loop.') while not rospy.is_shutdown(): q = pr2_arms.get_joint_angles(arm) p, rot = pr2_kdl.FK_all(arm, q) m = hv.create_frame_marker(p, rot, 0.15, '/torso_lift_link') m.header.stamp = rospy.Time.now() marker_pub.publish(m) rt.sleep() if False: # testing Jacobian by printing KDL and my own Jacobian at the # current configuration. while not rospy.is_shutdown(): q = pr2_arms.get_joint_angles(arm) J_kdl = pr2_kdl.Jac(arm , q) p, rot = pr2_kdl.FK_all(arm, q) J_adv = pr2_kdl.Jacobian(arm, q, p) print J_adv.shape diff_J = J_kdl - J_adv print 'difference between KDL and adv is:' print diff_J print 'Norm of difference matrix:', np.linalg.norm(diff_J) raw_input('Move arm into some configuration and hit enter to get the Jacobian.') if True: while not rospy.is_shutdown(): q = pr2_arms.wrap_angles(pr2_arms.get_joint_angles(arm)) print "actual", q p_ros, rot_ros = pr2_arms.FK(arm, q) p_kdl, rot_kdl = pr2_kdl.FK_all(arm, q) ik_ros = pr2_arms.IK(r_arm, p_ros, rot_ros, q) ik_kdl = pr2_arms.IK(r_arm, p_kdl, rot_kdl, q) diff = np.array(ik_ros) - np.array(ik_kdl) print "IK ros", ik_ros print "IK kdl", ik_kdl if len(ik_ros) == 7: err_ros = np.array(q) - np.array(ik_ros) err_kdl = np.array(q) - np.array(ik_kdl) print "err ros", sum(err_ros**2), "err kdl", sum(err_kdl**2), "diff", sum(diff**2)
ajibawa-2023/Python-Code-Large/train/row_99752
478
740
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Import_L33_C0", "label": "numpy import np, math", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.0446, 0.0014, 0, 0.66, 0.0, 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_99752:ImportFrom_L34_C0", "label": "from threading import RLock, Timer", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0459, 0.0014, 0, 0.66, 0.0323, 83, 0, 2, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["RLock", "Timer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import RLock, Timer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Import_L35_C0", "label": "sys import sys, copy", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.0473, 0.0014, 0, 0.66, 0.0645, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Import_L38_C0", "label": "roslib import roslib", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.0514, 0.0014, 0, 0.66, 0.0968, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('epc_core')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L38_C15", "label": "load_manifest()", "type": "expression", "loc": [38, 38], "level": 0, "parent": null, "vector": [8, 0, 0.0514, 0.0014, 0, 0.66, 0.129, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('epc_core')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L39_C0", "label": "load_manifest()", "type": "expression", "loc": [39, 39], "level": 0, "parent": null, "vector": [8, 0, 0.0527, 0.0014, 0, 0.66, 0.1613, 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('force_torque') # hack by Advait"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Import_L40_C0", "label": "force_torque.FTClient import ftc", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.0541, 0.0014, 0, 0.66, 0.1935, 823, 0, 1, 0, 0, 823, 0, 0], "semantic": {"name": "force_torque.FTClient", "arg_names": [], "import_names": ["ftc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import force_torque.FTClient as ftc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Import_L42_C0", "label": "tf import tf", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.0568, 0.0014, 0, 0.66, 0.2258, 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_99752:Import_L43_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.0581, 0.0014, 0, 0.66, 0.2581, 82, 0, 1, 0, 0, 82, 0, 0], "semantic": {"name": "hrl_lib.transforms", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Import_L44_C0", "label": "hrl_lib.viz import hv", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.0595, 0.0014, 0, 0.66, 0.2903, 48, 0, 1, 0, 0, 48, 0, 0], "semantic": {"name": "hrl_lib.viz", "arg_names": [], "import_names": ["hv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.viz as hv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Import_L46_C0", "label": "rospy import rospy", "type": "import", "loc": [46, 46], "level": 0, "parent": null, "vector": [1, 0, 0.0622, 0.0014, 0, 0.66, 0.3226, 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_99752:Import_L47_C0", "label": "PyKDL import kdl", "type": "import", "loc": [47, 47], "level": 0, "parent": null, "vector": [1, 0, 0.0635, 0.0014, 0, 0.66, 0.3548, 198, 0, 1, 0, 0, 198, 0, 0], "semantic": {"name": "PyKDL", "arg_names": [], "import_names": ["kdl"], "rhs_call_name": "", "annotation": ""}, "snippet": "import PyKDL as kdl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Import_L49_C0", "label": "actionlib import actionlib", "type": "import", "loc": [49, 49], "level": 0, "parent": null, "vector": [1, 0, 0.0662, 0.0014, 0, 0.66, 0.3871, 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_99752:ImportFrom_L50_C0", "label": "from actionlib_msgs.msg import GoalStatus", "type": "import", "loc": [50, 50], "level": 0, "parent": null, "vector": [1, 0, 0.0676, 0.0014, 0, 0.66, 0.4194, 245, 0, 1, 0, 0, 245, 0, 0], "semantic": {"name": "actionlib_msgs.msg", "arg_names": [], "import_names": ["GoalStatus"], "rhs_call_name": "", "annotation": ""}, "snippet": "from actionlib_msgs.msg import GoalStatus"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:ImportFrom_L52_C0", "label": "from pr2_controllers_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal, JointTrajectoryControllerState", "type": "import", "loc": [52, 52], "level": 0, "parent": null, "vector": [1, 0, 0.0703, 0.0014, 0, 0.66, 0.4516, 457, 0, 3, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["JointTrajectoryAction", "JointTrajectoryGoal", "JointTrajectoryControllerState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal, JointTrajectoryControllerState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:ImportFrom_L53_C0", "label": "from pr2_controllers_msgs.msg import Pr2GripperCommandGoal, Pr2GripperCommandAction, Pr2GripperCommand", "type": "import", "loc": [53, 53], "level": 0, "parent": null, "vector": [1, 0, 0.0716, 0.0014, 0, 0.66, 0.4839, 457, 0, 3, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["Pr2GripperCommandGoal", "Pr2GripperCommandAction", "Pr2GripperCommand"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import Pr2GripperCommandGoal, Pr2GripperCommandAction, Pr2GripperCommand"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:ImportFrom_L54_C0", "label": "from kinematics_msgs.srv import GetPositionIK, GetPositionIKRequest, GetPositionIKResponse", "type": "import", "loc": [54, 54], "level": 0, "parent": null, "vector": [1, 0, 0.073, 0.0014, 0, 0.66, 0.5161, 247, 0, 3, 0, 0, 247, 0, 0], "semantic": {"name": "kinematics_msgs.srv", "arg_names": [], "import_names": ["GetPositionIK", "GetPositionIKRequest", "GetPositionIKResponse"], "rhs_call_name": "", "annotation": ""}, "snippet": "from kinematics_msgs.srv import GetPositionIK, GetPositionIKRequest, GetPositionIKResponse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:ImportFrom_L55_C0", "label": "from kinematics_msgs.srv import GetPositionFK, GetPositionFKRequest, GetPositionFKResponse", "type": "import", "loc": [55, 55], "level": 0, "parent": null, "vector": [1, 0, 0.0743, 0.0014, 0, 0.66, 0.5484, 247, 0, 3, 0, 0, 247, 0, 0], "semantic": {"name": "kinematics_msgs.srv", "arg_names": [], "import_names": ["GetPositionFK", "GetPositionFKRequest", "GetPositionFKResponse"], "rhs_call_name": "", "annotation": ""}, "snippet": "from kinematics_msgs.srv import GetPositionFK, GetPositionFKRequest, GetPositionFKResponse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:ImportFrom_L57_C0", "label": "from trajectory_msgs.msg import JointTrajectoryPoint", "type": "import", "loc": [57, 57], "level": 0, "parent": null, "vector": [1, 0, 0.077, 0.0014, 0, 0.66, 0.5806, 485, 0, 1, 0, 0, 485, 0, 0], "semantic": {"name": "trajectory_msgs.msg", "arg_names": [], "import_names": ["JointTrajectoryPoint"], "rhs_call_name": "", "annotation": ""}, "snippet": "from trajectory_msgs.msg import JointTrajectoryPoint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:ImportFrom_L58_C0", "label": "from geometry_msgs.msg import PoseStamped, Pose, Point\u2026", "type": "import", "loc": [58, 58], "level": 0, "parent": null, "vector": [1, 0, 0.0784, 0.0014, 0, 0.66, 0.6129, 951, 0, 4, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["PoseStamped", "Pose", "Point", "Quaternion"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import PoseStamped, Pose, Point, Quaternion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:ImportFrom_L60_C0", "label": "from teleop_controllers.msg import JTTeleopControllerState", "type": "import", "loc": [60, 60], "level": 0, "parent": null, "vector": [1, 0, 0.0811, 0.0014, 0, 0.66, 0.6452, 185, 0, 1, 0, 0, 185, 0, 0], "semantic": {"name": "teleop_controllers.msg", "arg_names": [], "import_names": ["JTTeleopControllerState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from teleop_controllers.msg import JTTeleopControllerState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:ImportFrom_L62_C0", "label": "from std_msgs.msg import Float64", "type": "import", "loc": [62, 62], "level": 0, "parent": null, "vector": [1, 0, 0.0838, 0.0014, 0, 0.66, 0.6774, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Float64"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Float64"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:ImportFrom_L63_C0", "label": "from sensor_msgs.msg import JointState", "type": "import", "loc": [63, 63], "level": 0, "parent": null, "vector": [1, 0, 0.0851, 0.0014, 0, 0.66, 0.7097, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["JointState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import JointState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Import_L65_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [65, 65], "level": 0, "parent": null, "vector": [1, 0, 0.0878, 0.0014, 0, 0.66, 0.7419, 82, 0, 1, 0, 0, 82, 0, 0], "semantic": {"name": "hrl_lib.transforms", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Import_L66_C0", "label": "hrl_lib.kdl_utils import ku", "type": "import", "loc": [66, 66], "level": 0, "parent": null, "vector": [1, 0, 0.0892, 0.0014, 0, 0.66, 0.7742, 33, 0, 1, 0, 0, 33, 0, 0], "semantic": {"name": "hrl_lib.kdl_utils", "arg_names": [], "import_names": ["ku"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.kdl_utils as ku"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Import_L67_C0", "label": "time import time", "type": "import", "loc": [67, 67], "level": 0, "parent": null, "vector": [1, 0, 0.0905, 0.0014, 0, 0.66, 0.8065, 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_99752:ImportFrom_L69_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [69, 69], "level": 0, "parent": null, "vector": [1, 0, 0.0932, 0.0014, 0, 0.66, 0.8387, 124, 0, 1, 0, 0, 124, 0, 0], "semantic": {"name": "visualization_msgs.msg", "arg_names": [], "import_names": ["Marker"], "rhs_call_name": "", "annotation": ""}, "snippet": "from visualization_msgs.msg import Marker"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L72_C0", "label": "node_name =", "type": "assigned_variable", "loc": [72, 72], "level": 0, "parent": null, "vector": [14, 0, 0.0973, 0.0014, 0, 0.66, 0.871, 516, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "node_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "node_name = \"pr2_arms\" "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L74_C0", "label": "log", "type": "function", "loc": [74, 75], "level": 0, "parent": null, "vector": [2, 0, 0.1007, 0.0027, 0, 0.66, 0.9032, 432, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": ["str"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def log(str):\n rospy.loginfo(node_name + \": \" + str)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L75_C4", "label": "loginfo()", "type": "expression", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L74_C0", "vector": [8, 1, 0.1014, 0.0014, 1, 0.87, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(node_name + \": \" + str)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "label": "PR2Arms", "type": "class", "loc": [77, 481], "level": 0, "parent": null, "vector": [3, 0, 0.377, 0.5473, 0, 0.66, 0.9355, 694, 0, 22, 0, 0, 0, 0, 99], "semantic": {"name": "PR2Arms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PR2Arms():\n def __init__(self, primary_ft_sensor=None):\n log(\"Loading PR2Arms\")\n\n self.arms = PR2Arms_kdl() # KDL chain.\n\n self.joint_names_list = [['r_shoulder_pan_joint',\n 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "label": "__init__", "type": "function", "loc": [78, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.15, 0.0905, 1, 0.45, 0.0, 555, 0, 2, 0, 0, 0, 0, 25], "semantic": {"name": "__init__", "arg_names": ["self", "primary_ft_sensor"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, primary_ft_sensor=None):\n log(\"Loading PR2Arms\")\n\n self.arms = PR2Arms_kdl() # KDL chain.\n\n self.joint_names_list = [['r_shoulder_pan_joint',\n 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint',\n 'r_elbow_flex_joint', 'r_forearm_roll_joint',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L79_C8", "label": "log()", "type": "expression", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [8, 2, 0.1068, 0.0014, 2, 0.61, 0.0, 432, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log(\"Loading PR2Arms\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L81_C8", "label": "self.arms = PR2Arms_kdl()", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1095, 0.0014, 2, 0.61, 0.0286, 495, 3, 0, 0, 0, 188, 10, 1], "semantic": {"name": "self.arms", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Arms_kdl", "annotation": ""}, "snippet": " self.arms = PR2Arms_kdl() # KDL chain."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L83_C8", "label": "self.joint_names_list =", "type": "assigned_variable", "loc": [83, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1169, 0.0108, 2, 0.61, 0.0571, 515, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.joint_names_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_names_list = [['r_shoulder_pan_joint',\n 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint',\n 'r_elbow_flex_joint', 'r_forearm_roll_joint',\n 'r_wrist_flex_joint', 'r_wrist_roll_joint'],\n ['l_shoulder_pan_joint',\n 'l_shoulder_lift_joint', 'l_upper_arm_roll_joint',\n 'l_elbow_flex_joint', 'l_forearm_roll_joint',\n 'l_wrist_flex_joint', 'l_wrist_roll_joint']]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L92_C8", "label": "self.arm_state_lock =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1243, 0.0014, 2, 0.61, 0.0857, 845, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "self.arm_state_lock", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_state_lock = [RLock(), RLock()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L93_C8", "label": "self.jep =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1257, 0.0014, 2, 0.61, 0.1143, 580, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.jep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.jep = [None, None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L95_C8", "label": "self.arm_angles =", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1284, 0.0014, 2, 0.61, 0.1429, 980, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.arm_angles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_angles = [None, None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L96_C8", "label": "self.torso_position =", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1297, 0.0014, 2, 0.61, 0.1714, 371, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.torso_position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.torso_position = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L97_C8", "label": "self.arm_efforts =", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1311, 0.0014, 2, 0.61, 0.2, 222, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.arm_efforts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_efforts = [None, None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L99_C8", "label": "self.r_arm_cart_pub = Publisher()", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1338, 0.0014, 2, 0.61, 0.2286, 7, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.r_arm_cart_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.r_arm_cart_pub = rospy.Publisher('/r_cart/command_pose', PoseStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L100_C8", "label": "self.l_arm_cart_pub = Publisher()", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1351, 0.0014, 2, 0.61, 0.2571, 808, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.l_arm_cart_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.l_arm_cart_pub = rospy.Publisher('/l_cart/command_pose', PoseStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L102_C8", "label": "Subscriber()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [8, 2, 0.1378, 0.0014, 2, 0.61, 0.2857, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/r_cart/state', JTTeleopControllerState, self.r_cart_state_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L103_C8", "label": "Subscriber()", "type": "expression", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [8, 2, 0.1392, 0.0014, 2, 0.61, 0.3143, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/l_cart/state', JTTeleopControllerState, self.l_cart_state_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L105_C8", "label": "Subscriber()", "type": "expression", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [8, 2, 0.1419, 0.0014, 2, 0.61, 0.3429, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/joint_states', JointState, self.joint_states_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L106_C8", "label": "self.marker_pub = Publisher()", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1432, 0.0014, 2, 0.61, 0.3714, 368, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.marker_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.marker_pub = rospy.Publisher('/pr2_arms/viz_markers', Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L107_C8", "label": "self.cep_marker_id =", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1446, 0.0014, 2, 0.61, 0.4, 419, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.cep_marker_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cep_marker_id = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L109_C8", "label": "self.r_arm_ftc = FTClient()", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1473, 0.0014, 2, 0.61, 0.4286, 538, 3, 1, 0, 0, 78, 10, 1], "semantic": {"name": "self.r_arm_ftc", "arg_names": [], "import_names": [], "rhs_call_name": "FTClient", "annotation": ""}, "snippet": " self.r_arm_ftc = ftc.FTClient('force_torque_ft2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L110_C8", "label": "self.r_arm_ftc_estimate = FTClient()", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1486, 0.0014, 2, 0.61, 0.4571, 293, 3, 1, 0, 0, 78, 10, 1], "semantic": {"name": "self.r_arm_ftc_estimate", "arg_names": [], "import_names": [], "rhs_call_name": "FTClient", "annotation": ""}, "snippet": " self.r_arm_ftc_estimate = ftc.FTClient('force_torque_ft2_estimate')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L111_C8", "label": "self.tf_lstnr = TransformListener()", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.15, 0.0014, 2, 0.61, 0.4857, 699, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tf_lstnr", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.tf_lstnr = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L113_C8", "label": "if", "type": "if", "loc": [113, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [4, 2, 0.1534, 0.0027, 2, 0.61, 0.5143, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if primary_ft_sensor == 'ati':\n self.get_wrist_force = self.get_wrist_force_ati"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L114_C12", "label": "self.get_wrist_force =", "type": "assigned_variable", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L113_C8", "vector": [14, 3, 0.1541, 0.0014, 3, 0.87, 0.0, 994, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.get_wrist_force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.get_wrist_force = self.get_wrist_force_ati"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L115_C8", "label": "if", "type": "if", "loc": [115, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [4, 2, 0.1561, 0.0027, 2, 0.61, 0.5429, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if primary_ft_sensor == 'estimate':\n self.get_wrist_force = self.get_wrist_force_estimate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L116_C12", "label": "self.get_wrist_force =", "type": "assigned_variable", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L115_C8", "vector": [14, 3, 0.1568, 0.0014, 3, 0.39, 0.0, 994, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.get_wrist_force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.get_wrist_force = self.get_wrist_force_estimate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L118_C8", "label": "r_action_client = SimpleActionClient()", "type": "assigned_variable", "loc": [118, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1601, 0.0027, 2, 0.61, 0.5714, 242, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "r_action_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " r_action_client = actionlib.SimpleActionClient('r_arm_controller/joint_trajectory_action',\n JointTrajectoryAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L120_C8", "label": "l_action_client = SimpleActionClient()", "type": "assigned_variable", "loc": [120, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1628, 0.0027, 2, 0.61, 0.6, 492, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "l_action_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " l_action_client = actionlib.SimpleActionClient('l_arm_controller/joint_trajectory_action',\n JointTrajectoryAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L122_C8", "label": "self.joint_action_client =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1649, 0.0014, 2, 0.61, 0.6286, 369, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.joint_action_client", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_action_client = [r_action_client, l_action_client]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L124_C8", "label": "r_gripper_client = SimpleActionClient()", "type": "assigned_variable", "loc": [124, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1682, 0.0027, 2, 0.61, 0.6571, 204, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "r_gripper_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " r_gripper_client = actionlib.SimpleActionClient('r_gripper_controller/gripper_action',\n Pr2GripperCommandAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L126_C8", "label": "l_gripper_client = SimpleActionClient()", "type": "assigned_variable", "loc": [126, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1709, 0.0027, 2, 0.61, 0.6857, 647, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "l_gripper_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " l_gripper_client = actionlib.SimpleActionClient('l_gripper_controller/gripper_action',\n Pr2GripperCommandAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L128_C8", "label": "self.gripper_action_client =", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.173, 0.0014, 2, 0.61, 0.7143, 87, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.gripper_action_client", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.gripper_action_client = [r_gripper_client, l_gripper_client]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L130_C8", "label": "r_ik_srv = ServiceProxy()", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1757, 0.0014, 2, 0.61, 0.7429, 537, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "r_ik_srv", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " r_ik_srv = rospy.ServiceProxy('pr2_right_arm_kinematics/get_ik', GetPositionIK)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L131_C8", "label": "l_ik_srv = ServiceProxy()", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.177, 0.0014, 2, 0.61, 0.7714, 628, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "l_ik_srv", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " l_ik_srv = rospy.ServiceProxy('pr2_left_arm_kinematics/get_ik', GetPositionIK)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L132_C8", "label": "self.ik_srv =", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1784, 0.0014, 2, 0.61, 0.8, 144, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ik_srv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ik_srv = [r_ik_srv, l_ik_srv]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L133_C8", "label": "r_fk_srv = ServiceProxy()", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1797, 0.0014, 2, 0.61, 0.8286, 669, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "r_fk_srv", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " r_fk_srv = rospy.ServiceProxy('pr2_right_arm_kinematics/get_fk', GetPositionFK)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L134_C8", "label": "l_fk_srv = ServiceProxy()", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1811, 0.0014, 2, 0.61, 0.8571, 792, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "l_fk_srv", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " l_fk_srv = rospy.ServiceProxy('pr2_left_arm_kinematics/get_fk', GetPositionFK)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L135_C8", "label": "self.fk_srv =", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [14, 2, 0.1824, 0.0014, 2, 0.61, 0.8857, 245, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.fk_srv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.fk_srv = [r_fk_srv, l_fk_srv]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L137_C8", "label": "sleep()", "type": "expression", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [8, 2, 0.1851, 0.0014, 2, 0.61, 0.9143, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(2.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L141_C8", "label": "wait_for_server()", "type": "expression", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [8, 2, 0.1905, 0.0014, 2, 0.61, 0.9429, 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.gripper_action_client[0].wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L142_C8", "label": "wait_for_server()", "type": "expression", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [8, 2, 0.1919, 0.0014, 2, 0.61, 0.9714, 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.gripper_action_client[1].wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L144_C8", "label": "log()", "type": "expression", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "vector": [8, 2, 0.1946, 0.0014, 2, 0.61, 1.0, 432, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log(\"Finished loading SimpleArmManger\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "label": "joint_states_cb", "type": "function", "loc": [150, 188], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.2284, 0.0527, 1, 0.45, 0.0476, 800, 0, 2, 0, 0, 0, 0, 14], "semantic": {"name": "joint_states_cb", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def joint_states_cb(self, data):\n arm_angles = [[], []]\n arm_efforts = [[], []]\n r_jt_idx_list = [0]*7\n l_jt_idx_list = [0]*7\n for i, jt_nm in enumerate(self.joint_names_list[0]):\n r_jt_idx_list[i] = data.name.index(jt_nm)\n for i, jt_nm in enumerate(self.joint_names_list[1]):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L151_C8", "label": "arm_angles =", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "vector": [14, 2, 0.2041, 0.0014, 2, 0.42, 0.0, 148, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arm_angles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm_angles = [[], []]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L152_C8", "label": "arm_efforts =", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "vector": [14, 2, 0.2054, 0.0014, 2, 0.42, 0.0625, 394, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arm_efforts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm_efforts = [[], []]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L153_C8", "label": "r_jt_idx_list =", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "vector": [14, 2, 0.2068, 0.0014, 2, 0.42, 0.125, 924, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r_jt_idx_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_jt_idx_list = [0]*7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L154_C8", "label": "l_jt_idx_list =", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "vector": [14, 2, 0.2081, 0.0014, 2, 0.42, 0.1875, 974, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "l_jt_idx_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l_jt_idx_list = [0]*7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L155_C8", "label": "for i, jt_nm", "type": "for", "loc": [155, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "vector": [6, 2, 0.2101, 0.0027, 2, 0.42, 0.25, 122, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i, jt_nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, jt_nm in enumerate(self.joint_names_list[0]):\n r_jt_idx_list[i] = data.name.index(jt_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L156_C12", "label": " = index()", "type": "assigned_variable", "loc": [156, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L155_C8", "vector": [14, 3, 0.2108, 0.0014, 3, 0.58, 0.0, 0, 3, 1, 0, 0, 780, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "index", "annotation": ""}, "snippet": " r_jt_idx_list[i] = data.name.index(jt_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L157_C8", "label": "for i, jt_nm", "type": "for", "loc": [157, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "vector": [6, 2, 0.2128, 0.0027, 2, 0.42, 0.3125, 122, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i, jt_nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, jt_nm in enumerate(self.joint_names_list[1]):\n l_jt_idx_list[i] = data.name.index(jt_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L158_C12", "label": " = index()", "type": "assigned_variable", "loc": [158, 158], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L157_C8", "vector": [14, 3, 0.2135, 0.0014, 3, 0.82, 0.0, 0, 3, 1, 0, 0, 780, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "index", "annotation": ""}, "snippet": " l_jt_idx_list[i] = data.name.index(jt_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L161_C8", "label": "for i", "type": "for", "loc": [161, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "vector": [6, 2, 0.2264, 0.0189, 2, 0.42, 0.375, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(7):\n idx = r_jt_idx_list[i]\n if data.name[idx] != self.joint_names_list[0][i]:\n raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', data.name[idx], i))\n arm_angles[0].append(data.position[idx])\n arm_efforts[0].append(data.effort[idx])\n\n idx = l_jt_idx_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L162_C12", "label": "idx =", "type": "assigned_variable", "loc": [162, 162], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L161_C8", "vector": [14, 3, 0.2189, 0.0014, 3, 0.02, 0.0, 187, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " idx = r_jt_idx_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L163_C12", "label": "if", "type": "if", "loc": [163, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L161_C8", "vector": [4, 3, 0.2209, 0.0027, 3, 0.02, 0.1667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data.name[idx] != self.joint_names_list[0][i]:\n raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', data.name[idx], i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L165_C12", "label": "append()", "type": "expression", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L161_C8", "vector": [8, 3, 0.223, 0.0014, 3, 0.02, 0.3333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " arm_angles[0].append(data.position[idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L166_C12", "label": "append()", "type": "expression", "loc": [166, 166], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L161_C8", "vector": [8, 3, 0.2243, 0.0014, 3, 0.02, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " arm_efforts[0].append(data.effort[idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L168_C12", "label": "idx =", "type": "assigned_variable", "loc": [168, 168], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L161_C8", "vector": [14, 3, 0.227, 0.0014, 3, 0.02, 0.6667, 187, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " idx = l_jt_idx_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L169_C12", "label": "if", "type": "if", "loc": [169, 170], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L161_C8", "vector": [4, 3, 0.2291, 0.0027, 3, 0.02, 0.8333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data.name[idx] != self.joint_names_list[1][i]:\n raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', data.name[idx], i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L172_C12", "label": "ang =", "type": "assigned_variable", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L161_C8", "vector": [14, 3, 0.2324, 0.0014, 3, 0.02, 1.0, 762, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ang = data.position[idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L176_C8", "label": "acquire()", "type": "expression", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "vector": [8, 2, 0.2378, 0.0014, 2, 0.42, 0.4375, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.arm_state_lock[0].acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L177_C8", "label": "assign", "type": "assigned_variable", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "vector": [14, 2, 0.2392, 0.0014, 2, 0.42, 0.5, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_angles[0] = arm_angles[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L178_C8", "label": "assign", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "vector": [14, 2, 0.2405, 0.0014, 2, 0.42, 0.5625, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_efforts[0] = arm_efforts[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L180_C8", "label": "torso_idx = index()", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "vector": [14, 2, 0.2432, 0.0014, 2, 0.42, 0.625, 34, 3, 1, 0, 0, 780, 10, 1], "semantic": {"name": "torso_idx", "arg_names": [], "import_names": [], "rhs_call_name": "index", "annotation": ""}, "snippet": " torso_idx = data.name.index('torso_lift_joint')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L181_C8", "label": "self.torso_position =", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "vector": [14, 2, 0.2446, 0.0014, 2, 0.42, 0.6875, 371, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.torso_position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.torso_position = data.position[torso_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L183_C8", "label": "release()", "type": "expression", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "vector": [8, 2, 0.2473, 0.0014, 2, 0.42, 0.75, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.arm_state_lock[0].release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L185_C8", "label": "acquire()", "type": "expression", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "vector": [8, 2, 0.25, 0.0014, 2, 0.42, 0.8125, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.arm_state_lock[1].acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L186_C8", "label": "assign", "type": "assigned_variable", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "vector": [14, 2, 0.2514, 0.0014, 2, 0.42, 0.875, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_angles[1] = arm_angles[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L187_C8", "label": "assign", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "vector": [14, 2, 0.2527, 0.0014, 2, 0.42, 0.9375, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_efforts[1] = arm_efforts[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L188_C8", "label": "release()", "type": "expression", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "vector": [8, 2, 0.2541, 0.0014, 2, 0.42, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.arm_state_lock[1].release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L190_C4", "label": "r_cart_state_cb", "type": "function", "loc": [190, 239], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.2899, 0.0676, 1, 0.45, 0.0952, 925, 0, 2, 0, 0, 0, 0, 14], "semantic": {"name": "r_cart_state_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def r_cart_state_cb(self, msg):\n try:\n trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',\n 'r_gripper_tool_frame', rospy.Time(0))\n rot = tr.quaternion_to_matrix(quat)\n tip = np.matrix([0.12, 0., 0.]).T\n self.r_ee_pos = rot*tip + np.matrix(trans).T\n self.r_ee_rot = rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "label": "try", "type": "try", "loc": [191, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L190_C4", "vector": [7, 2, 0.2905, 0.0662, 2, 0.53, 0.0, 0, 0, 1, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',\n 'r_gripper_tool_frame', rospy.Time(0))\n rot = tr.quaternion_to_matrix(quat)\n tip = np.matrix([0.12, 0., 0.]).T\n self.r_ee_pos = rot*tip + np.matrix(trans).T\n self.r_ee_rot = rot\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L192_C12", "label": "trans, quat = lookupTransform()", "type": "assigned_variable", "loc": [192, 193], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2601, 0.0027, 3, 0.8, 0.0, 441, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "trans, quat", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',\n 'r_gripper_tool_frame', rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L194_C12", "label": "rot = quaternion_to_matrix()", "type": "assigned_variable", "loc": [194, 194], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2622, 0.0014, 3, 0.8, 0.0256, 812, 3, 1, 0, 0, 149, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_to_matrix", "annotation": ""}, "snippet": " rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L195_C12", "label": "tip =", "type": "assigned_variable", "loc": [195, 195], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2635, 0.0014, 3, 0.8, 0.0513, 726, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tip = np.matrix([0.12, 0., 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L196_C12", "label": "self.r_ee_pos =", "type": "assigned_variable", "loc": [196, 196], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2649, 0.0014, 3, 0.8, 0.0769, 506, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.r_ee_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_ee_pos = rot*tip + np.matrix(trans).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L197_C12", "label": "self.r_ee_rot =", "type": "assigned_variable", "loc": [197, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2662, 0.0014, 3, 0.8, 0.1026, 375, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.r_ee_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_ee_rot = rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L200_C12", "label": "marker = Marker()", "type": "assigned_variable", "loc": [200, 200], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2703, 0.0014, 3, 0.8, 0.1282, 864, 3, 0, 0, 0, 923, 10, 1], "semantic": {"name": "marker", "arg_names": [], "import_names": [], "rhs_call_name": "Marker", "annotation": ""}, "snippet": " marker = Marker()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L201_C12", "label": "marker.header.frame_id =", "type": "assigned_variable", "loc": [201, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2716, 0.0014, 3, 0.8, 0.1538, 22, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "marker.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.header.frame_id = 'torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L202_C12", "label": "time_stamp = now()", "type": "assigned_variable", "loc": [202, 202], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.273, 0.0014, 3, 0.8, 0.1795, 156, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "time_stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " time_stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L203_C12", "label": "marker.header.stamp =", "type": "assigned_variable", "loc": [203, 203], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2743, 0.0014, 3, 0.8, 0.2051, 625, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.header.stamp = time_stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L204_C12", "label": "marker.ns =", "type": "assigned_variable", "loc": [204, 204], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2757, 0.0014, 3, 0.8, 0.2308, 748, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "marker.ns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.ns = 'aloha land'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L205_C12", "label": "marker.type =", "type": "assigned_variable", "loc": [205, 205], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.277, 0.0014, 3, 0.8, 0.2564, 726, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.type = Marker.SPHERE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L206_C12", "label": "marker.action =", "type": "assigned_variable", "loc": [206, 206], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2784, 0.0014, 3, 0.8, 0.2821, 211, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.action = Marker.ADD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L207_C12", "label": "marker.pose.position.x =", "type": "assigned_variable", "loc": [207, 207], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2797, 0.0014, 3, 0.8, 0.3077, 294, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.position.x = self.r_ee_pos[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L208_C12", "label": "marker.pose.position.y =", "type": "assigned_variable", "loc": [208, 208], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2811, 0.0014, 3, 0.8, 0.3333, 911, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.position.y = self.r_ee_pos[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L209_C12", "label": "marker.pose.position.z =", "type": "assigned_variable", "loc": [209, 209], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2824, 0.0014, 3, 0.8, 0.359, 473, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.position.z = self.r_ee_pos[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L210_C12", "label": "size =", "type": "assigned_variable", "loc": [210, 210], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2838, 0.0014, 3, 0.8, 0.3846, 714, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " size = 0.02"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L211_C12", "label": "marker.scale.x =", "type": "assigned_variable", "loc": [211, 211], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2851, 0.0014, 3, 0.8, 0.4103, 887, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.scale.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.x = size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L212_C12", "label": "marker.scale.y =", "type": "assigned_variable", "loc": [212, 212], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2865, 0.0014, 3, 0.8, 0.4359, 730, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.scale.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.y = size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L213_C12", "label": "marker.scale.z =", "type": "assigned_variable", "loc": [213, 213], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2878, 0.0014, 3, 0.8, 0.4615, 969, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.scale.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.z = size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L214_C12", "label": "marker.lifetime = Duration()", "type": "assigned_variable", "loc": [214, 214], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2892, 0.0014, 3, 0.8, 0.4872, 788, 3, 0, 0, 0, 972, 10, 1], "semantic": {"name": "marker.lifetime", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " marker.lifetime = rospy.Duration()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L216_C12", "label": "marker.id =", "type": "assigned_variable", "loc": [216, 216], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2919, 0.0014, 3, 0.8, 0.5128, 570, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "marker.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.id = 71"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L217_C12", "label": "marker.pose.orientation.x =", "type": "assigned_variable", "loc": [217, 217], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2932, 0.0014, 3, 0.8, 0.5385, 831, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "marker.pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.x = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L218_C12", "label": "marker.pose.orientation.y =", "type": "assigned_variable", "loc": [218, 218], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2946, 0.0014, 3, 0.8, 0.5641, 626, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "marker.pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.y = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L219_C12", "label": "marker.pose.orientation.z =", "type": "assigned_variable", "loc": [219, 219], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2959, 0.0014, 3, 0.8, 0.5897, 538, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "marker.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.z = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L220_C12", "label": "marker.pose.orientation.w =", "type": "assigned_variable", "loc": [220, 220], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.2973, 0.0014, 3, 0.8, 0.6154, 522, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "marker.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.w = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L222_C12", "label": "color =", "type": "assigned_variable", "loc": [222, 222], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.3, 0.0014, 3, 0.8, 0.641, 776, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " color = (0.5, 0., 0.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L223_C12", "label": "marker.color.r =", "type": "assigned_variable", "loc": [223, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.3014, 0.0014, 3, 0.8, 0.6667, 486, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.color.r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.r = color[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L224_C12", "label": "marker.color.g =", "type": "assigned_variable", "loc": [224, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.3027, 0.0014, 3, 0.8, 0.6923, 536, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.color.g", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.g = color[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L225_C12", "label": "marker.color.b =", "type": "assigned_variable", "loc": [225, 225], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.3041, 0.0014, 3, 0.8, 0.7179, 744, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.color.b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.b = color[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L226_C12", "label": "marker.color.a =", "type": "assigned_variable", "loc": [226, 226], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.3054, 0.0014, 3, 0.8, 0.7436, 240, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "marker.color.a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.a = 1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L227_C12", "label": "publish()", "type": "expression", "loc": [227, 227], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [8, 3, 0.3068, 0.0014, 3, 0.8, 0.7692, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.marker_pub.publish(marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L229_C12", "label": "ros_pt =", "type": "assigned_variable", "loc": [229, 229], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.3095, 0.0014, 3, 0.8, 0.7949, 874, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ros_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ros_pt = msg.x_desi_filtered.pose.position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L230_C12", "label": "x, y, z =", "type": "assigned_variable", "loc": [230, 230], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.3108, 0.0014, 3, 0.8, 0.8205, 971, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "x, y, z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x, y, z = ros_pt.x, ros_pt.y, ros_pt.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L231_C12", "label": "self.r_cep_pos =", "type": "assigned_variable", "loc": [231, 231], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.3122, 0.0014, 3, 0.8, 0.8462, 277, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.r_cep_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_cep_pos = np.matrix([x, y, z]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L232_C12", "label": "pt =", "type": "assigned_variable", "loc": [232, 232], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.3135, 0.0014, 3, 0.8, 0.8718, 989, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = rot.T * (np.matrix([x,y,z]).T - np.matrix(trans).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L233_C12", "label": "pt =", "type": "assigned_variable", "loc": [233, 233], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.3149, 0.0014, 3, 0.8, 0.8974, 989, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = pt + tip"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L234_C12", "label": "self.r_cep_pos_hooktip =", "type": "assigned_variable", "loc": [234, 234], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.3162, 0.0014, 3, 0.8, 0.9231, 508, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.r_cep_pos_hooktip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_cep_pos_hooktip = rot*pt + np.matrix(trans).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L235_C12", "label": "ros_quat =", "type": "assigned_variable", "loc": [235, 235], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.3176, 0.0014, 3, 0.8, 0.9487, 920, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ros_quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ros_quat = msg.x_desi_filtered.pose.orientation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L236_C12", "label": "quat =", "type": "assigned_variable", "loc": [236, 236], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.3189, 0.0014, 3, 0.8, 0.9744, 367, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " quat = (ros_quat.x, ros_quat.y, ros_quat.z, ros_quat.w)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L237_C12", "label": "self.r_cep_rot = quaternion_to_matrix()", "type": "assigned_variable", "loc": [237, 237], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [14, 3, 0.3203, 0.0014, 3, 0.8, 1.0, 764, 3, 1, 0, 0, 149, 10, 1], "semantic": {"name": "self.r_cep_rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_to_matrix", "annotation": ""}, "snippet": " self.r_cep_rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L239_C12", "label": "return", "type": "return", "loc": [239, 239], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "vector": [13, 3, 0.323, 0.0014, 3, 0.8, 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_99752:FunctionDef_L241_C4", "label": "l_cart_state_cb", "type": "function", "loc": [241, 246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.3291, 0.0081, 1, 0.45, 0.1429, 1, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "l_cart_state_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def l_cart_state_cb(self, msg):\n ros_pt = msg.x_desi_filtered.pose.position\n self.l_cep_pos = np.matrix([ros_pt.x, ros_pt.y, ros_pt.z]).T\n ros_quat = msg.x_desi_filtered.pose.orientation\n quat = (ros_quat.x, ros_quat.y, ros_quat.z, ros_quat.w)\n self.l_cep_rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L242_C8", "label": "ros_pt =", "type": "assigned_variable", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L241_C4", "vector": [14, 2, 0.327, 0.0014, 2, 0.32, 0.0, 874, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ros_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ros_pt = msg.x_desi_filtered.pose.position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L243_C8", "label": "self.l_cep_pos =", "type": "assigned_variable", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L241_C4", "vector": [14, 2, 0.3284, 0.0014, 2, 0.32, 0.25, 973, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.l_cep_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l_cep_pos = np.matrix([ros_pt.x, ros_pt.y, ros_pt.z]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L244_C8", "label": "ros_quat =", "type": "assigned_variable", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L241_C4", "vector": [14, 2, 0.3297, 0.0014, 2, 0.32, 0.5, 920, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ros_quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ros_quat = msg.x_desi_filtered.pose.orientation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L245_C8", "label": "quat =", "type": "assigned_variable", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L241_C4", "vector": [14, 2, 0.3311, 0.0014, 2, 0.32, 0.75, 367, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " quat = (ros_quat.x, ros_quat.y, ros_quat.z, ros_quat.w)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L246_C8", "label": "self.l_cep_rot = quaternion_to_matrix()", "type": "assigned_variable", "loc": [246, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L241_C4", "vector": [14, 2, 0.3324, 0.0014, 2, 0.32, 1.0, 385, 3, 1, 0, 0, 149, 10, 1], "semantic": {"name": "self.l_cep_rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_to_matrix", "annotation": ""}, "snippet": " self.l_cep_rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4", "label": "IK", "type": "function", "loc": [248, 262], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.3446, 0.0203, 1, 0.45, 0.1905, 719, 0, 5, 1, 0, 0, 0, 7], "semantic": {"name": "IK", "arg_names": ["self", "arm", "pos", "rot", "q_guess"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def IK(self, arm, pos, rot, q_guess=[0]*7):\n ik_req = GetPositionIKRequest()\n ik_req.timeout = rospy.Duration(5.)\n if arm == 0:\n ik_req.ik_request.ik_link_name = 'r_wrist_roll_link'\n else:\n ik_req.ik_request.ik_link_name = 'l_wrist_roll_link'\n ik_req.ik_request.pose_stamped.header.frame_id = 'torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L249_C8", "label": "ik_req = GetPositionIKRequest()", "type": "assigned_variable", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4", "vector": [14, 2, 0.3365, 0.0014, 2, 0.87, 0.0, 578, 3, 0, 0, 0, 258, 10, 1], "semantic": {"name": "ik_req", "arg_names": [], "import_names": [], "rhs_call_name": "GetPositionIKRequest", "annotation": ""}, "snippet": " ik_req = GetPositionIKRequest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L250_C8", "label": "ik_req.timeout = Duration()", "type": "assigned_variable", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4", "vector": [14, 2, 0.3378, 0.0014, 2, 0.87, 0.1111, 460, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "ik_req.timeout", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " ik_req.timeout = rospy.Duration(5.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L251_C8", "label": "if", "type": "if", "loc": [251, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4", "vector": [4, 2, 0.3412, 0.0054, 2, 0.87, 0.2222, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n ik_req.ik_request.ik_link_name = 'r_wrist_roll_link'\n else:\n ik_req.ik_request.ik_link_name = 'l_wrist_roll_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L252_C12", "label": "ik_req.ik_request.ik_link_name =", "type": "assigned_variable", "loc": [252, 252], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L251_C8", "vector": [14, 3, 0.3405, 0.0014, 3, 0.49, 0.0, 946, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ik_req.ik_request.ik_link_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.ik_link_name = 'r_wrist_roll_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L254_C12", "label": "ik_req.ik_request.ik_link_name =", "type": "assigned_variable", "loc": [254, 254], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L251_C8", "vector": [14, 3, 0.3432, 0.0014, 3, 0.49, 1.0, 946, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ik_req.ik_request.ik_link_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.ik_link_name = 'l_wrist_roll_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L255_C8", "label": "ik_req.ik_request.pose_stamped.header.frame_id =", "type": "assigned_variable", "loc": [255, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4", "vector": [14, 2, 0.3446, 0.0014, 2, 0.87, 0.3333, 10, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ik_req.ik_request.pose_stamped.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.pose_stamped.header.frame_id = 'torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L256_C8", "label": "quat = matrix_to_quaternion()", "type": "assigned_variable", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4", "vector": [14, 2, 0.3459, 0.0014, 2, 0.87, 0.4444, 367, 3, 1, 0, 0, 615, 10, 1], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_to_quaternion", "annotation": ""}, "snippet": " quat = tr.matrix_to_quaternion(rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L257_C8", "label": "ik_req.ik_request.pose_stamped.pose = Pose()", "type": "assigned_variable", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4", "vector": [14, 2, 0.3473, 0.0014, 2, 0.87, 0.5556, 282, 3, 2, 0, 0, 902, 10, 3], "semantic": {"name": "ik_req.ik_request.pose_stamped.pose", "arg_names": [], "import_names": [], "rhs_call_name": "Pose", "annotation": ""}, "snippet": " ik_req.ik_request.pose_stamped.pose = Pose(Point(*pos), Quaternion(*quat))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L258_C8", "label": "ik_req.ik_request.ik_seed_state.joint_state.position =", "type": "assigned_variable", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4", "vector": [14, 2, 0.3486, 0.0014, 2, 0.87, 0.6667, 864, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_req.ik_request.ik_seed_state.joint_state.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.ik_seed_state.joint_state.position = q_guess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L259_C8", "label": "ik_req.ik_request.ik_seed_state.joint_state.name =", "type": "assigned_variable", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4", "vector": [14, 2, 0.35, 0.0014, 2, 0.87, 0.7778, 736, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_req.ik_request.ik_seed_state.joint_state.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.ik_seed_state.joint_state.name = self.joint_names_list[arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L261_C8", "label": "ik_resp = call()", "type": "assigned_variable", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4", "vector": [14, 2, 0.3527, 0.0014, 2, 0.87, 0.8889, 598, 3, 1, 0, 0, 832, 10, 1], "semantic": {"name": "ik_resp", "arg_names": [], "import_names": [], "rhs_call_name": "call", "annotation": ""}, "snippet": " ik_resp = self.ik_srv[arm].call(ik_req)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L262_C8", "label": "return", "type": "return", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4", "vector": [13, 2, 0.3541, 0.0014, 2, 0.87, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ik_resp.solution.joint_state.position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L264_C4", "label": "FK", "type": "function", "loc": [264, 290], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.3743, 0.0365, 1, 0.45, 0.2381, 252, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "FK", "arg_names": ["self", "arm", "q"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def FK(self, arm, q):\n fk_req = GetPositionFKRequest()\n fk_req.header.frame_id = 'torso_lift_link'\n if arm == 0:\n fk_req.fk_link_names.append('r_wrist_roll_link') \n else:\n fk_req.fk_link_names.append('l_wrist_roll_link')\n fk_req.robot_state.joint_state.name = self.joint_names_list[arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L265_C8", "label": "fk_req = GetPositionFKRequest()", "type": "assigned_variable", "loc": [265, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L264_C4", "vector": [14, 2, 0.3581, 0.0014, 2, 0.64, 0.0, 192, 3, 0, 0, 0, 7, 10, 1], "semantic": {"name": "fk_req", "arg_names": [], "import_names": [], "rhs_call_name": "GetPositionFKRequest", "annotation": ""}, "snippet": " fk_req = GetPositionFKRequest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L266_C8", "label": "fk_req.header.frame_id =", "type": "assigned_variable", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L264_C4", "vector": [14, 2, 0.3595, 0.0014, 2, 0.64, 0.1429, 144, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "fk_req.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fk_req.header.frame_id = 'torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L267_C8", "label": "if", "type": "if", "loc": [267, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L264_C4", "vector": [4, 2, 0.3628, 0.0054, 2, 0.64, 0.2857, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n fk_req.fk_link_names.append('r_wrist_roll_link') \n else:\n fk_req.fk_link_names.append('l_wrist_roll_link')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L268_C12", "label": "append()", "type": "expression", "loc": [268, 268], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L267_C8", "vector": [8, 3, 0.3622, 0.0014, 3, 0.41, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " fk_req.fk_link_names.append('r_wrist_roll_link') "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L270_C12", "label": "append()", "type": "expression", "loc": [270, 270], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L267_C8", "vector": [8, 3, 0.3649, 0.0014, 3, 0.41, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " fk_req.fk_link_names.append('l_wrist_roll_link')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L271_C8", "label": "fk_req.robot_state.joint_state.name =", "type": "assigned_variable", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L264_C4", "vector": [14, 2, 0.3662, 0.0014, 2, 0.64, 0.4286, 345, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fk_req.robot_state.joint_state.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fk_req.robot_state.joint_state.name = self.joint_names_list[arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L272_C8", "label": "fk_req.robot_state.joint_state.position =", "type": "assigned_variable", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L264_C4", "vector": [14, 2, 0.3676, 0.0014, 2, 0.64, 0.5714, 514, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fk_req.robot_state.joint_state.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fk_req.robot_state.joint_state.position = q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L274_C8", "label": "fk_resp = call()", "type": "assigned_variable", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L264_C4", "vector": [14, 2, 0.3703, 0.0014, 2, 0.64, 0.7143, 178, 3, 1, 0, 0, 832, 10, 1], "semantic": {"name": "fk_resp", "arg_names": [], "import_names": [], "rhs_call_name": "call", "annotation": ""}, "snippet": " fk_resp = self.fk_srv[arm].call(fk_req)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "label": "if", "type": "if", "loc": [275, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L264_C4", "vector": [4, 2, 0.3804, 0.0189, 2, 0.64, 0.8571, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fk_resp.error_code.val == fk_resp.error_code.SUCCESS:\n x = fk_resp.pose_stamped[0].pose.position.x\n y = fk_resp.pose_stamped[0].pose.position.y\n z = fk_resp.pose_stamped[0].pose.position.z\n pos = [x, y, z]\n q1 = fk_resp.pose_stamped[0].pose.orientation.x\n q2 = fk_resp.pose_stamped[0].pose.orientation.y\n q3 = fk_resp.pose_stamped[0].pose.orientation.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L276_C12", "label": "x =", "type": "assigned_variable", "loc": [276, 276], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "vector": [14, 3, 0.373, 0.0014, 3, 0.24, 0.0, 190, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = fk_resp.pose_stamped[0].pose.position.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L277_C12", "label": "y =", "type": "assigned_variable", "loc": [277, 277], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "vector": [14, 3, 0.3743, 0.0014, 3, 0.24, 0.0909, 304, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = fk_resp.pose_stamped[0].pose.position.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L278_C12", "label": "z =", "type": "assigned_variable", "loc": [278, 278], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "vector": [14, 3, 0.3757, 0.0014, 3, 0.24, 0.1818, 859, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = fk_resp.pose_stamped[0].pose.position.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L279_C12", "label": "pos =", "type": "assigned_variable", "loc": [279, 279], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "vector": [14, 3, 0.377, 0.0014, 3, 0.24, 0.2727, 627, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = [x, y, z]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L280_C12", "label": "q1 =", "type": "assigned_variable", "loc": [280, 280], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "vector": [14, 3, 0.3784, 0.0014, 3, 0.24, 0.3636, 974, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q1 = fk_resp.pose_stamped[0].pose.orientation.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L281_C12", "label": "q2 =", "type": "assigned_variable", "loc": [281, 281], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "vector": [14, 3, 0.3797, 0.0014, 3, 0.24, 0.4545, 848, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q2 = fk_resp.pose_stamped[0].pose.orientation.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L282_C12", "label": "q3 =", "type": "assigned_variable", "loc": [282, 282], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "vector": [14, 3, 0.3811, 0.0014, 3, 0.24, 0.5455, 718, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q3", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q3 = fk_resp.pose_stamped[0].pose.orientation.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L283_C12", "label": "q4 =", "type": "assigned_variable", "loc": [283, 283], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "vector": [14, 3, 0.3824, 0.0014, 3, 0.24, 0.6364, 552, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q4", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q4 = fk_resp.pose_stamped[0].pose.orientation.w"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L284_C12", "label": "quat =", "type": "assigned_variable", "loc": [284, 284], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "vector": [14, 3, 0.3838, 0.0014, 3, 0.24, 0.7273, 367, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " quat = [q1,q2,q3,q4]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L285_C12", "label": "rot = quaternion_to_matrix()", "type": "assigned_variable", "loc": [285, 285], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "vector": [14, 3, 0.3851, 0.0014, 3, 0.24, 0.8182, 812, 3, 1, 0, 0, 149, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_to_matrix", "annotation": ""}, "snippet": " rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L287_C12", "label": "logerr()", "type": "expression", "loc": [287, 287], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "vector": [8, 3, 0.3878, 0.0014, 3, 0.24, 0.9091, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Forward kinematics failed')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L288_C12", "label": "return", "type": "return", "loc": [288, 288], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "vector": [13, 3, 0.3892, 0.0014, 3, 0.24, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L290_C8", "label": "return", "type": "return", "loc": [290, 290], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L264_C4", "vector": [13, 2, 0.3919, 0.0014, 2, 0.64, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pos, rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L296_C4", "label": "end_effector_pos", "type": "function", "loc": [296, 298], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.4014, 0.0041, 1, 0.45, 0.2857, 889, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "end_effector_pos", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_effector_pos(self, arm):\n q = self.get_joint_angles(arm)\n return self.arms.FK_all(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L297_C8", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [297, 297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L296_C4", "vector": [14, 2, 0.4014, 0.0014, 2, 0.2, 0.0, 516, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " q = self.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L298_C8", "label": "return", "type": "return", "loc": [298, 298], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L296_C4", "vector": [13, 2, 0.4027, 0.0014, 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 self.arms.FK_all(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L303_C4", "label": "get_joint_angles", "type": "function", "loc": [303, 309], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.4135, 0.0095, 1, 0.45, 0.3333, 820, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "get_joint_angles", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_joint_angles(self, arm):\n if arm != 1:\n arm = 0\n self.arm_state_lock[arm].acquire()\n q = self.wrap_angles(self.arm_angles[arm])\n self.arm_state_lock[arm].release()\n return q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L304_C8", "label": "if", "type": "if", "loc": [304, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L303_C4", "vector": [4, 2, 0.4115, 0.0027, 2, 0.17, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 1:\n arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L305_C12", "label": "arm =", "type": "assigned_variable", "loc": [305, 305], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L304_C8", "vector": [14, 3, 0.4122, 0.0014, 3, 0.52, 0.0, 413, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L306_C8", "label": "acquire()", "type": "expression", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L303_C4", "vector": [8, 2, 0.4135, 0.0014, 2, 0.17, 0.25, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.arm_state_lock[arm].acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L307_C8", "label": "q = wrap_angles()", "type": "assigned_variable", "loc": [307, 307], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L303_C4", "vector": [14, 2, 0.4149, 0.0014, 2, 0.17, 0.5, 516, 3, 1, 0, 0, 651, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "wrap_angles", "annotation": ""}, "snippet": " q = self.wrap_angles(self.arm_angles[arm])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L308_C8", "label": "release()", "type": "expression", "loc": [308, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L303_C4", "vector": [8, 2, 0.4162, 0.0014, 2, 0.17, 0.75, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.arm_state_lock[arm].release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L309_C8", "label": "return", "type": "return", "loc": [309, 309], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L303_C4", "vector": [13, 2, 0.4176, 0.0014, 2, 0.17, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "label": "set_jep", "type": "function", "loc": [311, 337], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.4378, 0.0365, 1, 0.45, 0.381, 799, 0, 4, 0, 0, 0, 0, 15], "semantic": {"name": "set_jep", "arg_names": ["self", "arm", "q", "duration"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_jep(self, arm, q, duration=0.15):\n if q is None or len(q) != 7:\n raise RuntimeError(\"set_jep value is \" + str(q))\n self.arm_state_lock[arm].acquire()\n\n jtg = JointTrajectoryGoal()\n jtg.trajectory.joint_names = self.joint_names_list[arm]\n jtp = JointTrajectoryPoint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L312_C8", "label": "if", "type": "if", "loc": [312, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "vector": [4, 2, 0.4223, 0.0027, 2, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if q is None or len(q) != 7:\n raise RuntimeError(\"set_jep value is \" + str(q))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L314_C8", "label": "acquire()", "type": "expression", "loc": [314, 314], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "vector": [8, 2, 0.4243, 0.0014, 2, 0.71, 0.0667, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.arm_state_lock[arm].acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L316_C8", "label": "jtg = JointTrajectoryGoal()", "type": "assigned_variable", "loc": [316, 316], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "vector": [14, 2, 0.427, 0.0014, 2, 0.71, 0.1333, 511, 3, 0, 0, 0, 970, 10, 1], "semantic": {"name": "jtg", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectoryGoal", "annotation": ""}, "snippet": " jtg = JointTrajectoryGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L317_C8", "label": "jtg.trajectory.joint_names =", "type": "assigned_variable", "loc": [317, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "vector": [14, 2, 0.4284, 0.0014, 2, 0.71, 0.2, 747, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jtg.trajectory.joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jtg.trajectory.joint_names = self.joint_names_list[arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L318_C8", "label": "jtp = JointTrajectoryPoint()", "type": "assigned_variable", "loc": [318, 318], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "vector": [14, 2, 0.4297, 0.0014, 2, 0.71, 0.2667, 952, 3, 0, 0, 0, 302, 10, 1], "semantic": {"name": "jtp", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectoryPoint", "annotation": ""}, "snippet": " jtp = JointTrajectoryPoint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L319_C8", "label": "jtp.positions =", "type": "assigned_variable", "loc": [319, 319], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "vector": [14, 2, 0.4311, 0.0014, 2, 0.71, 0.3333, 984, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jtp.positions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jtp.positions = q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L322_C8", "label": "jtp.time_from_start = Duration()", "type": "assigned_variable", "loc": [322, 322], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "vector": [14, 2, 0.4351, 0.0014, 2, 0.71, 0.4, 272, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "jtp.time_from_start", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " jtp.time_from_start = rospy.Duration(duration)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L323_C8", "label": "append()", "type": "expression", "loc": [323, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "vector": [8, 2, 0.4365, 0.0014, 2, 0.71, 0.4667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " jtg.trajectory.points.append(jtp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L324_C8", "label": "send_goal()", "type": "expression", "loc": [324, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "vector": [8, 2, 0.4378, 0.0014, 2, 0.71, 0.5333, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.joint_action_client[arm].send_goal(jtg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L326_C8", "label": "assign", "type": "assigned_variable", "loc": [326, 326], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "vector": [14, 2, 0.4405, 0.0014, 2, 0.71, 0.6, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.jep[arm] = q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L327_C8", "label": "cep, r = FK_all()", "type": "assigned_variable", "loc": [327, 327], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "vector": [14, 2, 0.4419, 0.0014, 2, 0.71, 0.6667, 805, 3, 2, 0, 0, 415, 10, 1], "semantic": {"name": "cep, r", "arg_names": [], "import_names": [], "rhs_call_name": "FK_all", "annotation": ""}, "snippet": " cep, r = self.arms.FK_all(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L328_C8", "label": "release()", "type": "expression", "loc": [328, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "vector": [8, 2, 0.4432, 0.0014, 2, 0.71, 0.7333, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.arm_state_lock[arm].release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L330_C8", "label": "o =", "type": "assigned_variable", "loc": [330, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "vector": [14, 2, 0.4459, 0.0014, 2, 0.71, 0.8, 926, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "o", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " o = np.matrix([0.,0.,0.,1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L331_C8", "label": "cep_marker = single_marker()", "type": "assigned_variable", "loc": [331, 334], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "vector": [14, 2, 0.4493, 0.0054, 2, 0.71, 0.8667, 414, 3, 7, 0, 0, 614, 10, 1], "semantic": {"name": "cep_marker", "arg_names": [], "import_names": [], "rhs_call_name": "single_marker", "annotation": ""}, "snippet": " cep_marker = hv.single_marker(cep, o, 'sphere',\n '/torso_lift_link', color=(0., 0., 1., 1.),\n scale = (0.02, 0.02, 0.02),\n m_id = self.cep_marker_id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L336_C8", "label": "cep_marker.header.stamp = now()", "type": "assigned_variable", "loc": [336, 336], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "vector": [14, 2, 0.4541, 0.0014, 2, 0.71, 0.9333, 772, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "cep_marker.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " cep_marker.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L337_C8", "label": "publish()", "type": "expression", "loc": [337, 337], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "vector": [8, 2, 0.4554, 0.0014, 2, 0.71, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.marker_pub.publish(cep_marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L339_C4", "label": "get_jep", "type": "function", "loc": [339, 343], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.4608, 0.0068, 1, 0.45, 0.4286, 898, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "get_jep", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_jep(self, arm):\n self.arm_state_lock[arm].acquire()\n jep = copy.copy(self.jep[arm])\n self.arm_state_lock[arm].release()\n return jep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L340_C8", "label": "acquire()", "type": "expression", "loc": [340, 340], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L339_C4", "vector": [8, 2, 0.4595, 0.0014, 2, 0.09, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.arm_state_lock[arm].acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L341_C8", "label": "jep = copy()", "type": "assigned_variable", "loc": [341, 341], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L339_C4", "vector": [14, 2, 0.4608, 0.0014, 2, 0.09, 0.3333, 838, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "jep", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " jep = copy.copy(self.jep[arm])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L342_C8", "label": "release()", "type": "expression", "loc": [342, 342], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L339_C4", "vector": [8, 2, 0.4622, 0.0014, 2, 0.09, 0.6667, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.arm_state_lock[arm].release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L343_C8", "label": "return", "type": "return", "loc": [343, 343], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L339_C4", "vector": [13, 2, 0.4635, 0.0014, 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 jep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L345_C4", "label": "get_ee_jtt", "type": "function", "loc": [345, 349], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.4689, 0.0068, 1, 0.45, 0.4762, 15, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "get_ee_jtt", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_ee_jtt(self, arm):\n if arm == 0:\n return self.r_ee_pos, self.r_ee_rot\n else:\n return self.l_ee_pos, self.l_ee_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L346_C8", "label": "if", "type": "if", "loc": [346, 349], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L345_C4", "vector": [4, 2, 0.4696, 0.0054, 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 arm == 0:\n return self.r_ee_pos, self.r_ee_rot\n else:\n return self.l_ee_pos, self.l_ee_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L347_C12", "label": "return", "type": "return", "loc": [347, 347], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L346_C8", "vector": [13, 3, 0.4689, 0.0014, 3, 0.45, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.r_ee_pos, self.r_ee_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L349_C12", "label": "return", "type": "return", "loc": [349, 349], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L346_C8", "vector": [13, 3, 0.4716, 0.0014, 3, 0.45, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.l_ee_pos, self.l_ee_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L351_C4", "label": "get_cep_jtt", "type": "function", "loc": [351, 358], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.4791, 0.0108, 1, 0.45, 0.5238, 532, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "get_cep_jtt", "arg_names": ["self", "arm", "hook_tip"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_cep_jtt(self, arm, hook_tip = False):\n if arm == 0:\n if hook_tip:\n return self.r_cep_pos_hooktip, self.r_cep_rot\n else:\n return self.r_cep_pos, self.r_cep_rot\n else:\n return self.l_cep_pos, self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L352_C8", "label": "if", "type": "if", "loc": [352, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L351_C4", "vector": [4, 2, 0.4797, 0.0095, 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 arm == 0:\n if hook_tip:\n return self.r_cep_pos_hooktip, self.r_cep_rot\n else:\n return self.r_cep_pos, self.r_cep_rot\n else:\n return self.l_cep_pos, self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L353_C12", "label": "if", "type": "if", "loc": [353, 356], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L352_C8", "vector": [4, 3, 0.4791, 0.0054, 3, 0.6, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hook_tip:\n return self.r_cep_pos_hooktip, self.r_cep_rot\n else:\n return self.r_cep_pos, self.r_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L354_C16", "label": "return", "type": "return", "loc": [354, 354], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L353_C12", "vector": [13, 4, 0.4784, 0.0014, 4, 0.26, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.r_cep_pos_hooktip, self.r_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L356_C16", "label": "return", "type": "return", "loc": [356, 356], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L353_C12", "vector": [13, 4, 0.4811, 0.0014, 4, 0.26, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.r_cep_pos, self.r_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L358_C12", "label": "return", "type": "return", "loc": [358, 358], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L352_C8", "vector": [13, 3, 0.4838, 0.0014, 3, 0.6, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.l_cep_pos, self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "label": "set_cep_jtt", "type": "function", "loc": [361, 386], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.5047, 0.0351, 1, 0.45, 0.5714, 820, 0, 4, 0, 0, 0, 0, 5], "semantic": {"name": "set_cep_jtt", "arg_names": ["self", "arm", "p", "rot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_cep_jtt(self, arm, p, rot=None):\n if arm != 1:\n arm = 0\n ps = PoseStamped()\n ps.header.stamp = rospy.rostime.get_rostime()\n ps.header.frame_id = 'torso_lift_link'\n \n ps.pose.position.x = p[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L362_C8", "label": "if", "type": "if", "loc": [362, 363], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "vector": [4, 2, 0.4899, 0.0027, 2, 0.06, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 1:\n arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L363_C12", "label": "arm =", "type": "assigned_variable", "loc": [363, 363], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L362_C8", "vector": [14, 3, 0.4905, 0.0014, 3, 0.01, 0.0, 413, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L364_C8", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [364, 364], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "vector": [14, 2, 0.4919, 0.0014, 2, 0.06, 0.0769, 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_99752:Assign_L365_C8", "label": "ps.header.stamp = get_rostime()", "type": "assigned_variable", "loc": [365, 365], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "vector": [14, 2, 0.4932, 0.0014, 2, 0.06, 0.1538, 161, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " ps.header.stamp = rospy.rostime.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L366_C8", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [366, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "vector": [14, 2, 0.4946, 0.0014, 2, 0.06, 0.2308, 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 = 'torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L368_C8", "label": "ps.pose.position.x =", "type": "assigned_variable", "loc": [368, 368], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "vector": [14, 2, 0.4973, 0.0014, 2, 0.06, 0.3077, 782, 6, 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 = p[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L369_C8", "label": "ps.pose.position.y =", "type": "assigned_variable", "loc": [369, 369], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "vector": [14, 2, 0.4986, 0.0014, 2, 0.06, 0.3846, 661, 6, 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 = p[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L370_C8", "label": "ps.pose.position.z =", "type": "assigned_variable", "loc": [370, 370], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "vector": [14, 2, 0.5, 0.0014, 2, 0.06, 0.4615, 771, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.z = p[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L372_C8", "label": "if", "type": "if", "loc": [372, 376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "vector": [4, 2, 0.5054, 0.0068, 2, 0.06, 0.5385, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rot == None:\n if arm == 0:\n rot = self.r_cep_rot\n else:\n rot = self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L373_C12", "label": "if", "type": "if", "loc": [373, 376], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L372_C8", "vector": [4, 3, 0.5061, 0.0054, 3, 0.7, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n rot = self.r_cep_rot\n else:\n rot = self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L374_C16", "label": "rot =", "type": "assigned_variable", "loc": [374, 374], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L373_C12", "vector": [14, 4, 0.5054, 0.0014, 4, 0.27, 0.0, 812, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot = self.r_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L376_C16", "label": "rot =", "type": "assigned_variable", "loc": [376, 376], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L373_C12", "vector": [14, 4, 0.5081, 0.0014, 4, 0.27, 1.0, 812, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot = self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L378_C8", "label": "quat = matrix_to_quaternion()", "type": "assigned_variable", "loc": [378, 378], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "vector": [14, 2, 0.5108, 0.0014, 2, 0.06, 0.6154, 367, 3, 1, 0, 0, 615, 10, 1], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_to_quaternion", "annotation": ""}, "snippet": " quat = tr.matrix_to_quaternion(rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L379_C8", "label": "ps.pose.orientation.x =", "type": "assigned_variable", "loc": [379, 379], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "vector": [14, 2, 0.5122, 0.0014, 2, 0.06, 0.6923, 628, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.x = quat[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L380_C8", "label": "ps.pose.orientation.y =", "type": "assigned_variable", "loc": [380, 380], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "vector": [14, 2, 0.5135, 0.0014, 2, 0.06, 0.7692, 848, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.y = quat[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L381_C8", "label": "ps.pose.orientation.z =", "type": "assigned_variable", "loc": [381, 381], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "vector": [14, 2, 0.5149, 0.0014, 2, 0.06, 0.8462, 126, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.z = quat[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L382_C8", "label": "ps.pose.orientation.w =", "type": "assigned_variable", "loc": [382, 382], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "vector": [14, 2, 0.5162, 0.0014, 2, 0.06, 0.9231, 163, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.w = quat[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L383_C8", "label": "if", "type": "if", "loc": [383, 386], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "vector": [4, 2, 0.5196, 0.0054, 2, 0.06, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n self.r_arm_cart_pub.publish(ps)\n else:\n self.l_arm_cart_pub.publish(ps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L384_C12", "label": "publish()", "type": "expression", "loc": [384, 384], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L383_C8", "vector": [8, 3, 0.5189, 0.0014, 3, 0.48, 0.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.r_arm_cart_pub.publish(ps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L386_C12", "label": "publish()", "type": "expression", "loc": [386, 386], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L383_C8", "vector": [8, 3, 0.5216, 0.0014, 3, 0.48, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.l_arm_cart_pub.publish(ps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L389_C4", "label": "go_cep_jtt", "type": "function", "loc": [389, 400], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.5331, 0.0162, 1, 0.45, 0.619, 219, 0, 3, 0, 0, 0, 0, 7], "semantic": {"name": "go_cep_jtt", "arg_names": ["self", "arm", "p"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def go_cep_jtt(self, arm, p):\n step_size = 0.01\n sleep_time = 0.1\n cep_p, cep_rot = self.get_cep_jtt(arm)\n unit_vec = (p-cep_p)\n unit_vec = unit_vec / np.linalg.norm(unit_vec)\n while np.linalg.norm(p-cep_p) > step_size:\n cep_p += unit_vec * step_size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L390_C8", "label": "step_size =", "type": "assigned_variable", "loc": [390, 390], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L389_C4", "vector": [14, 2, 0.527, 0.0014, 2, 0.14, 0.0, 764, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "step_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " step_size = 0.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L391_C8", "label": "sleep_time =", "type": "assigned_variable", "loc": [391, 391], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L389_C4", "vector": [14, 2, 0.5284, 0.0014, 2, 0.14, 0.1429, 355, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "sleep_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sleep_time = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L392_C8", "label": "cep_p, cep_rot = get_cep_jtt()", "type": "assigned_variable", "loc": [392, 392], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L389_C4", "vector": [14, 2, 0.5297, 0.0014, 2, 0.14, 0.2857, 891, 3, 1, 0, 0, 532, 10, 1], "semantic": {"name": "cep_p, cep_rot", "arg_names": [], "import_names": [], "rhs_call_name": "get_cep_jtt", "annotation": ""}, "snippet": " cep_p, cep_rot = self.get_cep_jtt(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L393_C8", "label": "unit_vec =", "type": "assigned_variable", "loc": [393, 393], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L389_C4", "vector": [14, 2, 0.5311, 0.0014, 2, 0.14, 0.4286, 372, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "unit_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " unit_vec = (p-cep_p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L394_C8", "label": "unit_vec =", "type": "assigned_variable", "loc": [394, 394], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L389_C4", "vector": [14, 2, 0.5324, 0.0014, 2, 0.14, 0.5714, 372, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unit_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " unit_vec = unit_vec / np.linalg.norm(unit_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L395_C8", "label": "while", "type": "while", "loc": [395, 398], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L389_C4", "vector": [5, 2, 0.5358, 0.0054, 2, 0.14, 0.7143, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while np.linalg.norm(p-cep_p) > step_size:\n cep_p += unit_vec * step_size\n self.set_cep_jtt(arm, cep_p)\n rospy.sleep(sleep_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L397_C12", "label": "set_cep_jtt()", "type": "expression", "loc": [397, 397], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L395_C8", "vector": [8, 3, 0.5365, 0.0014, 3, 0.93, 0.0, 820, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_cep_jtt", "arg_names": [], "import_names": [], "rhs_call_name": "set_cep_jtt", "annotation": ""}, "snippet": " self.set_cep_jtt(arm, cep_p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L398_C12", "label": "sleep()", "type": "expression", "loc": [398, 398], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L395_C8", "vector": [8, 3, 0.5378, 0.0014, 3, 0.93, 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(sleep_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L399_C8", "label": "set_cep_jtt()", "type": "expression", "loc": [399, 399], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L389_C4", "vector": [8, 2, 0.5392, 0.0014, 2, 0.14, 0.8571, 820, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_cep_jtt", "arg_names": [], "import_names": [], "rhs_call_name": "set_cep_jtt", "annotation": ""}, "snippet": " self.set_cep_jtt(arm, p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L400_C8", "label": "sleep()", "type": "expression", "loc": [400, 400], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L389_C4", "vector": [8, 2, 0.5405, 0.0014, 2, 0.14, 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(sleep_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L407_C4", "label": "get_wrist_force_estimate", "type": "function", "loc": [407, 419], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.5581, 0.0176, 1, 0.45, 0.6667, 346, 0, 4, 1, 0, 0, 0, 6], "semantic": {"name": "get_wrist_force_estimate", "arg_names": ["self", "arm", "bias", "base_frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_wrist_force_estimate(self, arm, bias = True, base_frame = False):\n if arm != 0:\n rospy.logerr('Unsupported arm: %d'%arm)\n raise RuntimeError('Unimplemented function')\n \n f = self.r_arm_ftc_estimate.read(without_bias = not bias)\n f = f[0:3, :]\n if base_frame:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L408_C8", "label": "if", "type": "if", "loc": [408, 410], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L407_C4", "vector": [4, 2, 0.5527, 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": " if arm != 0:\n rospy.logerr('Unsupported arm: %d'%arm)\n raise RuntimeError('Unimplemented function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L409_C12", "label": "logerr()", "type": "expression", "loc": [409, 409], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L408_C8", "vector": [8, 3, 0.5527, 0.0014, 3, 0.88, 0.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Unsupported arm: %d'%arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L412_C8", "label": "f = read()", "type": "assigned_variable", "loc": [412, 412], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L407_C4", "vector": [14, 2, 0.5568, 0.0014, 2, 0.97, 0.25, 899, 3, 1, 0, 0, 453, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " f = self.r_arm_ftc_estimate.read(without_bias = not bias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L413_C8", "label": "f =", "type": "assigned_variable", "loc": [413, 413], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L407_C4", "vector": [14, 2, 0.5581, 0.0014, 2, 0.97, 0.5, 899, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = f[0:3, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L414_C8", "label": "if", "type": "if", "loc": [414, 418], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L407_C4", "vector": [4, 2, 0.5622, 0.0068, 2, 0.97, 0.75, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if base_frame:\n trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',\n '/ft2_estimate', rospy.Time(0))\n rot = tr.quaternion_to_matrix(quat)\n f = rot * f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L415_C12", "label": "trans, quat = lookupTransform()", "type": "assigned_variable", "loc": [415, 416], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L414_C8", "vector": [14, 3, 0.5615, 0.0027, 3, 0.18, 0.0, 441, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "trans, quat", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',\n '/ft2_estimate', rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L417_C12", "label": "rot = quaternion_to_matrix()", "type": "assigned_variable", "loc": [417, 417], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L414_C8", "vector": [14, 3, 0.5635, 0.0014, 3, 0.18, 0.5, 812, 3, 1, 0, 0, 149, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_to_matrix", "annotation": ""}, "snippet": " rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L418_C12", "label": "f =", "type": "assigned_variable", "loc": [418, 418], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L414_C8", "vector": [14, 3, 0.5649, 0.0014, 3, 0.18, 1.0, 899, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = rot * f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L419_C8", "label": "return", "type": "return", "loc": [419, 419], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L407_C4", "vector": [13, 2, 0.5662, 0.0014, 2, 0.97, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -f # the negative is intentional (Advait, Nov 24. 2010.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L422_C4", "label": "get_wrist_force_ati", "type": "function", "loc": [422, 434], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.5784, 0.0176, 1, 0.45, 0.7143, 170, 0, 4, 1, 0, 0, 0, 6], "semantic": {"name": "get_wrist_force_ati", "arg_names": ["self", "arm", "bias", "base_frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_wrist_force_ati(self, arm, bias = True, base_frame = False):\n if arm != 0:\n rospy.logerr('Unsupported arm: %d'%arm)\n raise RuntimeError('Unimplemented function')\n \n f = self.r_arm_ftc.read(without_bias = not bias)\n f = f[0:3, :]\n if base_frame:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L423_C8", "label": "if", "type": "if", "loc": [423, 425], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L422_C4", "vector": [4, 2, 0.573, 0.0041, 2, 0.74, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 0:\n rospy.logerr('Unsupported arm: %d'%arm)\n raise RuntimeError('Unimplemented function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L424_C12", "label": "logerr()", "type": "expression", "loc": [424, 424], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L423_C8", "vector": [8, 3, 0.573, 0.0014, 3, 0.48, 0.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Unsupported arm: %d'%arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L427_C8", "label": "f = read()", "type": "assigned_variable", "loc": [427, 427], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L422_C4", "vector": [14, 2, 0.577, 0.0014, 2, 0.74, 0.25, 899, 3, 1, 0, 0, 453, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " f = self.r_arm_ftc.read(without_bias = not bias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L428_C8", "label": "f =", "type": "assigned_variable", "loc": [428, 428], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L422_C4", "vector": [14, 2, 0.5784, 0.0014, 2, 0.74, 0.5, 899, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = f[0:3, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L429_C8", "label": "if", "type": "if", "loc": [429, 433], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L422_C4", "vector": [4, 2, 0.5824, 0.0068, 2, 0.74, 0.75, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if base_frame:\n trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',\n '/ft2', rospy.Time(0))\n rot = tr.quaternion_to_matrix(quat)\n f = rot * f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L430_C12", "label": "trans, quat = lookupTransform()", "type": "assigned_variable", "loc": [430, 431], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L429_C8", "vector": [14, 3, 0.5818, 0.0027, 3, 0.43, 0.0, 441, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "trans, quat", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',\n '/ft2', rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L432_C12", "label": "rot = quaternion_to_matrix()", "type": "assigned_variable", "loc": [432, 432], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L429_C8", "vector": [14, 3, 0.5838, 0.0014, 3, 0.43, 0.5, 812, 3, 1, 0, 0, 149, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_to_matrix", "annotation": ""}, "snippet": " rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L433_C12", "label": "f =", "type": "assigned_variable", "loc": [433, 433], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L429_C8", "vector": [14, 3, 0.5851, 0.0014, 3, 0.43, 1.0, 899, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = rot * f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L434_C8", "label": "return", "type": "return", "loc": [434, 434], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L422_C4", "vector": [13, 2, 0.5865, 0.0014, 2, 0.74, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -f # the negative is intentional (Advait, Nov 24. 2010.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4", "label": "get_force_from_torques", "type": "function", "loc": [439, 450], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.6007, 0.0162, 1, 0.45, 0.7619, 497, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "get_force_from_torques", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_force_from_torques(self, arm):\n if arm != 1:\n arm = 0\n self.arm_state_lock[arm].acquire()\n q = self.arm_angles[arm]\n tau = self.arm_efforts[arm]\n self.arm_state_lock[arm].release()\n p, _ = self.arms.FK_all(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L440_C8", "label": "if", "type": "if", "loc": [440, 441], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4", "vector": [4, 2, 0.5953, 0.0027, 2, 0.48, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 1:\n arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L441_C12", "label": "arm =", "type": "assigned_variable", "loc": [441, 441], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L440_C8", "vector": [14, 3, 0.5959, 0.0014, 3, 0.21, 0.0, 413, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L442_C8", "label": "acquire()", "type": "expression", "loc": [442, 442], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4", "vector": [8, 2, 0.5973, 0.0014, 2, 0.48, 0.1111, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.arm_state_lock[arm].acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L443_C8", "label": "q =", "type": "assigned_variable", "loc": [443, 443], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4", "vector": [14, 2, 0.5986, 0.0014, 2, 0.48, 0.2222, 516, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q = self.arm_angles[arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L444_C8", "label": "tau =", "type": "assigned_variable", "loc": [444, 444], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4", "vector": [14, 2, 0.6, 0.0014, 2, 0.48, 0.3333, 329, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tau", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tau = self.arm_efforts[arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L445_C8", "label": "release()", "type": "expression", "loc": [445, 445], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4", "vector": [8, 2, 0.6014, 0.0014, 2, 0.48, 0.4444, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.arm_state_lock[arm].release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L446_C8", "label": "p, _ = FK_all()", "type": "assigned_variable", "loc": [446, 446], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4", "vector": [14, 2, 0.6027, 0.0014, 2, 0.48, 0.5556, 31, 3, 2, 0, 0, 415, 10, 1], "semantic": {"name": "p, _", "arg_names": [], "import_names": [], "rhs_call_name": "FK_all", "annotation": ""}, "snippet": " p, _ = self.arms.FK_all(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L447_C8", "label": "J = Jacobian()", "type": "assigned_variable", "loc": [447, 447], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4", "vector": [14, 2, 0.6041, 0.0014, 2, 0.48, 0.6667, 946, 3, 3, 0, 0, 182, 10, 1], "semantic": {"name": "J", "arg_names": [], "import_names": [], "rhs_call_name": "Jacobian", "annotation": ""}, "snippet": " J = self.arms.Jacobian(arm, q, p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L448_C8", "label": "f =", "type": "assigned_variable", "loc": [448, 448], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4", "vector": [14, 2, 0.6054, 0.0014, 2, 0.48, 0.7778, 899, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = np.linalg.pinv(J.T) * np.matrix(tau).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L449_C8", "label": "f =", "type": "assigned_variable", "loc": [449, 449], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4", "vector": [14, 2, 0.6068, 0.0014, 2, 0.48, 0.8889, 899, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = f[0:3,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L450_C8", "label": "return", "type": "return", "loc": [450, 450], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4", "vector": [13, 2, 0.6081, 0.0014, 2, 0.48, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L453_C4", "label": "bias_wrist_ft", "type": "function", "loc": [453, 458], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.6155, 0.0081, 1, 0.45, 0.8095, 604, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "bias_wrist_ft", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def bias_wrist_ft(self, arm):\n if arm != 0:\n rospy.logerr('Unsupported arm: %d'%arm)\n raise RuntimeError('Unimplemented function')\n self.r_arm_ftc.bias()\n self.r_arm_ftc_estimate.bias()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L454_C8", "label": "if", "type": "if", "loc": [454, 456], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L453_C4", "vector": [4, 2, 0.6149, 0.0041, 2, 0.69, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 0:\n rospy.logerr('Unsupported arm: %d'%arm)\n raise RuntimeError('Unimplemented function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L455_C12", "label": "logerr()", "type": "expression", "loc": [455, 455], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L454_C8", "vector": [8, 3, 0.6149, 0.0014, 3, 0.05, 0.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Unsupported arm: %d'%arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L457_C8", "label": "bias()", "type": "expression", "loc": [457, 457], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L453_C4", "vector": [8, 2, 0.6176, 0.0014, 2, 0.69, 0.5, 354, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bias", "arg_names": [], "import_names": [], "rhs_call_name": "bias", "annotation": ""}, "snippet": " self.r_arm_ftc.bias()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L458_C8", "label": "bias()", "type": "expression", "loc": [458, 458], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L453_C4", "vector": [8, 2, 0.6189, 0.0014, 2, 0.69, 1.0, 354, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bias", "arg_names": [], "import_names": [], "rhs_call_name": "bias", "annotation": ""}, "snippet": " self.r_arm_ftc_estimate.bias()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L461_C4", "label": "move_gripper", "type": "function", "loc": [461, 463], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.6243, 0.0041, 1, 0.45, 0.8571, 327, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "move_gripper", "arg_names": ["self", "arm", "amount", "effort"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_gripper(self, arm, amount=0.08, effort = 15):\n self.gripper_action_client[arm].send_goal(Pr2GripperCommandGoal(Pr2GripperCommand(position=amount,\n max_effort = effort)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L462_C8", "label": "send_goal()", "type": "expression", "loc": [462, 463], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L461_C4", "vector": [8, 2, 0.625, 0.0027, 2, 0.69, 0.0, 184, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.gripper_action_client[arm].send_goal(Pr2GripperCommandGoal(Pr2GripperCommand(position=amount,\n max_effort = effort)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L467_C4", "label": "open_gripper", "type": "function", "loc": [467, 468], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.6318, 0.0027, 1, 0.45, 0.9048, 833, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "open_gripper", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def open_gripper(self, arm):\n self.move_gripper(arm, 0.08, -1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L468_C8", "label": "move_gripper()", "type": "expression", "loc": [468, 468], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L467_C4", "vector": [8, 2, 0.6324, 0.0014, 2, 0.18, 0.0, 327, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "move_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "move_gripper", "annotation": ""}, "snippet": " self.move_gripper(arm, 0.08, -1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L472_C4", "label": "close_gripper", "type": "function", "loc": [472, 473], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.6385, 0.0027, 1, 0.45, 0.9524, 807, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "close_gripper", "arg_names": ["self", "arm", "effort"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close_gripper(self, arm, effort = 15):\n self.move_gripper(arm, 0.0, effort)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L473_C8", "label": "move_gripper()", "type": "expression", "loc": [473, 473], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L472_C4", "vector": [8, 2, 0.6392, 0.0014, 2, 0.52, 0.0, 327, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "move_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "move_gripper", "annotation": ""}, "snippet": " self.move_gripper(arm, 0.0, effort)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L475_C4", "label": "wrap_angles", "type": "function", "loc": [475, 481], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "vector": [2, 1, 0.6459, 0.0095, 1, 0.45, 1.0, 651, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "wrap_angles", "arg_names": ["self", "q"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def wrap_angles(self, q):\n for ind in [4, 6]:\n while q[ind] < -np.pi:\n q[ind] += 2*np.pi\n while q[ind] > np.pi:\n q[ind] -= 2*np.pi\n return q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L476_C8", "label": "for ind", "type": "for", "loc": [476, 480], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L475_C4", "vector": [6, 2, 0.6459, 0.0068, 2, 0.5, 0.0, 680, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ind", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for ind in [4, 6]:\n while q[ind] < -np.pi:\n q[ind] += 2*np.pi\n while q[ind] > np.pi:\n q[ind] -= 2*np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L477_C12", "label": "while", "type": "while", "loc": [477, 478], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L476_C8", "vector": [5, 3, 0.6453, 0.0027, 3, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while q[ind] < -np.pi:\n q[ind] += 2*np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L479_C12", "label": "while", "type": "while", "loc": [479, 480], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L476_C8", "vector": [5, 3, 0.648, 0.0027, 3, 0.02, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while q[ind] > np.pi:\n q[ind] -= 2*np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L481_C8", "label": "return", "type": "return", "loc": [481, 481], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L475_C4", "vector": [13, 2, 0.65, 0.0014, 2, 0.5, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "label": "PR2Arms_kdl", "type": "class", "loc": [486, 656], "level": 0, "parent": null, "vector": [3, 0, 0.7716, 0.2311, 0, 0.66, 0.9677, 188, 0, 14, 0, 0, 0, 0, 89], "semantic": {"name": "PR2Arms_kdl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PR2Arms_kdl():\n def __init__(self):\n self.right_chain = self.create_right_chain()\n fk, ik_v, ik_p, jac = self.create_solvers(self.right_chain)\n self.right_fk = fk\n self.right_ik_v = ik_v\n self.right_ik_p = ik_p\n self.right_jac = jac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L487_C4", "label": "__init__", "type": "function", "loc": [487, 494], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "vector": [2, 1, 0.6628, 0.0108, 1, 0.83, 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 self.right_chain = self.create_right_chain()\n fk, ik_v, ik_p, jac = self.create_solvers(self.right_chain)\n self.right_fk = fk\n self.right_ik_v = ik_v\n self.right_ik_p = ik_p\n self.right_jac = jac\n self.right_tooltip = np.matrix([0.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L488_C8", "label": "self.right_chain = create_right_chain()", "type": "assigned_variable", "loc": [488, 488], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L487_C4", "vector": [14, 2, 0.6595, 0.0014, 2, 0.49, 0.0, 233, 3, 0, 0, 0, 956, 10, 1], "semantic": {"name": "self.right_chain", "arg_names": [], "import_names": [], "rhs_call_name": "create_right_chain", "annotation": ""}, "snippet": " self.right_chain = self.create_right_chain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L489_C8", "label": "fk, ik_v, ik_p, jac = create_solvers()", "type": "assigned_variable", "loc": [489, 489], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L487_C4", "vector": [14, 2, 0.6608, 0.0014, 2, 0.49, 0.1667, 737, 3, 1, 0, 0, 845, 10, 1], "semantic": {"name": "fk, ik_v, ik_p, jac", "arg_names": [], "import_names": [], "rhs_call_name": "create_solvers", "annotation": ""}, "snippet": " fk, ik_v, ik_p, jac = self.create_solvers(self.right_chain)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L490_C8", "label": "self.right_fk =", "type": "assigned_variable", "loc": [490, 490], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L487_C4", "vector": [14, 2, 0.6622, 0.0014, 2, 0.49, 0.3333, 700, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.right_fk", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_fk = fk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L491_C8", "label": "self.right_ik_v =", "type": "assigned_variable", "loc": [491, 491], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L487_C4", "vector": [14, 2, 0.6635, 0.0014, 2, 0.49, 0.5, 402, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.right_ik_v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_ik_v = ik_v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L492_C8", "label": "self.right_ik_p =", "type": "assigned_variable", "loc": [492, 492], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L487_C4", "vector": [14, 2, 0.6649, 0.0014, 2, 0.49, 0.6667, 101, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.right_ik_p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_ik_p = ik_p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L493_C8", "label": "self.right_jac =", "type": "assigned_variable", "loc": [493, 493], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L487_C4", "vector": [14, 2, 0.6662, 0.0014, 2, 0.49, 0.8333, 574, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.right_jac", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_jac = jac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L494_C8", "label": "self.right_tooltip =", "type": "assigned_variable", "loc": [494, 494], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L487_C4", "vector": [14, 2, 0.6676, 0.0014, 2, 0.49, 1.0, 402, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.right_tooltip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_tooltip = np.matrix([0.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4", "label": "create_right_chain", "type": "function", "loc": [496, 513], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "vector": [2, 1, 0.6818, 0.0243, 1, 0.83, 0.0769, 956, 0, 1, 1, 0, 0, 0, 37], "semantic": {"name": "create_right_chain", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_right_chain(self):\n ch = kdl.Chain()\n self.right_arm_base_offset_from_torso_lift_link = np.matrix([0., -0.188, 0.]).T\n # shoulder pan\n ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotZ),kdl.Frame(kdl.Vector(0.1,0.,0.))))\n # shoulder lift\n ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,0.))))\n # upper arm roll"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L497_C8", "label": "ch = Chain()", "type": "assigned_variable", "loc": [497, 497], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4", "vector": [14, 2, 0.6716, 0.0014, 2, 0.71, 0.0, 263, 3, 0, 0, 0, 629, 10, 1], "semantic": {"name": "ch", "arg_names": [], "import_names": [], "rhs_call_name": "Chain", "annotation": ""}, "snippet": " ch = kdl.Chain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L498_C8", "label": "self.right_arm_base_offset_from_torso_lift_link =", "type": "assigned_variable", "loc": [498, 498], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4", "vector": [14, 2, 0.673, 0.0014, 2, 0.71, 0.1111, 255, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.right_arm_base_offset_from_torso_lift_link", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_arm_base_offset_from_torso_lift_link = np.matrix([0., -0.188, 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L500_C8", "label": "addSegment()", "type": "expression", "loc": [500, 500], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4", "vector": [8, 2, 0.6757, 0.0014, 2, 0.71, 0.2222, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotZ),kdl.Frame(kdl.Vector(0.1,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L502_C8", "label": "addSegment()", "type": "expression", "loc": [502, 502], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4", "vector": [8, 2, 0.6784, 0.0014, 2, 0.71, 0.3333, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L504_C8", "label": "addSegment()", "type": "expression", "loc": [504, 504], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4", "vector": [8, 2, 0.6811, 0.0014, 2, 0.71, 0.4444, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.4,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L506_C8", "label": "addSegment()", "type": "expression", "loc": [506, 506], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4", "vector": [8, 2, 0.6838, 0.0014, 2, 0.71, 0.5556, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.0,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L508_C8", "label": "addSegment()", "type": "expression", "loc": [508, 508], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4", "vector": [8, 2, 0.6865, 0.0014, 2, 0.71, 0.6667, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.321,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L510_C8", "label": "addSegment()", "type": "expression", "loc": [510, 510], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4", "vector": [8, 2, 0.6892, 0.0014, 2, 0.71, 0.7778, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L512_C8", "label": "addSegment()", "type": "expression", "loc": [512, 512], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4", "vector": [8, 2, 0.6919, 0.0014, 2, 0.71, 0.8889, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L513_C8", "label": "return", "type": "return", "loc": [513, 513], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4", "vector": [13, 2, 0.6932, 0.0014, 2, 0.71, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ch"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L515_C4", "label": "create_solvers", "type": "function", "loc": [515, 520], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "vector": [2, 1, 0.6993, 0.0081, 1, 0.83, 0.1538, 845, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "create_solvers", "arg_names": ["self", "ch"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_solvers(self, ch):\n fk = kdl.ChainFkSolverPos_recursive(ch)\n ik_v = kdl.ChainIkSolverVel_pinv(ch)\n ik_p = kdl.ChainIkSolverPos_NR(ch, fk, ik_v)\n jac = kdl.ChainJntToJacSolver(ch)\n return fk, ik_v, ik_p, jac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L516_C9", "label": "fk = ChainFkSolverPos_recursive()", "type": "assigned_variable", "loc": [516, 516], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L515_C4", "vector": [14, 2, 0.6973, 0.0014, 2, 0.55, 0.0, 714, 3, 1, 0, 0, 489, 10, 1], "semantic": {"name": "fk", "arg_names": [], "import_names": [], "rhs_call_name": "ChainFkSolverPos_recursive", "annotation": ""}, "snippet": " fk = kdl.ChainFkSolverPos_recursive(ch)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L517_C9", "label": "ik_v = ChainIkSolverVel_pinv()", "type": "assigned_variable", "loc": [517, 517], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L515_C4", "vector": [14, 2, 0.6986, 0.0014, 2, 0.55, 0.25, 976, 3, 1, 0, 0, 507, 10, 1], "semantic": {"name": "ik_v", "arg_names": [], "import_names": [], "rhs_call_name": "ChainIkSolverVel_pinv", "annotation": ""}, "snippet": " ik_v = kdl.ChainIkSolverVel_pinv(ch)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L518_C9", "label": "ik_p = ChainIkSolverPos_NR()", "type": "assigned_variable", "loc": [518, 518], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L515_C4", "vector": [14, 2, 0.7, 0.0014, 2, 0.55, 0.5, 796, 3, 3, 0, 0, 440, 10, 1], "semantic": {"name": "ik_p", "arg_names": [], "import_names": [], "rhs_call_name": "ChainIkSolverPos_NR", "annotation": ""}, "snippet": " ik_p = kdl.ChainIkSolverPos_NR(ch, fk, ik_v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L519_C9", "label": "jac = ChainJntToJacSolver()", "type": "assigned_variable", "loc": [519, 519], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L515_C4", "vector": [14, 2, 0.7014, 0.0014, 2, 0.55, 0.75, 812, 3, 1, 0, 0, 672, 10, 1], "semantic": {"name": "jac", "arg_names": [], "import_names": [], "rhs_call_name": "ChainJntToJacSolver", "annotation": ""}, "snippet": " jac = kdl.ChainJntToJacSolver(ch)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L520_C9", "label": "return", "type": "return", "loc": [520, 520], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L515_C4", "vector": [13, 2, 0.7027, 0.0014, 2, 0.55, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return fk, ik_v, ik_p, jac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L523_C4", "label": "set_tooltip", "type": "function", "loc": [523, 527], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "vector": [2, 1, 0.7095, 0.0068, 1, 0.83, 0.2308, 350, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_tooltip", "arg_names": ["self", "arm", "p"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_tooltip(self, arm, p):\n if arm == 0:\n self.right_tooltip = p\n else:\n rospy.logerr('Arm %d is not supported.'%(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L524_C8", "label": "if", "type": "if", "loc": [524, 527], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L523_C4", "vector": [4, 2, 0.7101, 0.0054, 2, 0.21, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n self.right_tooltip = p\n else:\n rospy.logerr('Arm %d is not supported.'%(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L525_C12", "label": "self.right_tooltip =", "type": "assigned_variable", "loc": [525, 525], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L524_C8", "vector": [14, 3, 0.7095, 0.0014, 3, 0.42, 0.0, 402, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.right_tooltip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_tooltip = p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L527_C12", "label": "logerr()", "type": "expression", "loc": [527, 527], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L524_C8", "vector": [8, 3, 0.7122, 0.0014, 3, 0.42, 1.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Arm %d is not supported.'%(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L529_C4", "label": "FK_kdl", "type": "function", "loc": [529, 543], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "vector": [2, 1, 0.7243, 0.0203, 1, 0.83, 0.3077, 929, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "FK_kdl", "arg_names": ["self", "arm", "q", "link_number"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def FK_kdl(self, arm, q, link_number):\n if arm == 0:\n fk = self.right_fk\n endeffec_frame = kdl.Frame()\n kinematics_status = fk.JntToCart(q, endeffec_frame,\n link_number)\n if kinematics_status >= 0:\n return endeffec_frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L530_C8", "label": "if", "type": "if", "loc": [530, 543], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L529_C4", "vector": [4, 2, 0.725, 0.0189, 2, 0.67, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n fk = self.right_fk\n endeffec_frame = kdl.Frame()\n kinematics_status = fk.JntToCart(q, endeffec_frame,\n link_number)\n if kinematics_status >= 0:\n return endeffec_frame\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L531_C12", "label": "fk =", "type": "assigned_variable", "loc": [531, 531], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L530_C8", "vector": [14, 3, 0.7176, 0.0014, 3, 0.48, 0.0, 714, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fk", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fk = self.right_fk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L532_C12", "label": "endeffec_frame = Frame()", "type": "assigned_variable", "loc": [532, 532], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L530_C8", "vector": [14, 3, 0.7189, 0.0014, 3, 0.48, 0.2, 271, 3, 0, 0, 0, 342, 10, 1], "semantic": {"name": "endeffec_frame", "arg_names": [], "import_names": [], "rhs_call_name": "Frame", "annotation": ""}, "snippet": " endeffec_frame = kdl.Frame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L533_C12", "label": "kinematics_status = JntToCart()", "type": "assigned_variable", "loc": [533, 534], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L530_C8", "vector": [14, 3, 0.7209, 0.0027, 3, 0.48, 0.4, 714, 3, 3, 0, 0, 79, 10, 1], "semantic": {"name": "kinematics_status", "arg_names": [], "import_names": [], "rhs_call_name": "JntToCart", "annotation": ""}, "snippet": " kinematics_status = fk.JntToCart(q, endeffec_frame,\n link_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L535_C12", "label": "if", "type": "if", "loc": [535, 539], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L530_C8", "vector": [4, 3, 0.7257, 0.0068, 3, 0.48, 0.6, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if kinematics_status >= 0:\n return endeffec_frame\n else:\n rospy.loginfo('Could not compute forward kinematics.')\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L536_C16", "label": "return", "type": "return", "loc": [536, 536], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L535_C12", "vector": [13, 4, 0.7243, 0.0014, 4, 0.09, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return endeffec_frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L538_C16", "label": "loginfo()", "type": "expression", "loc": [538, 538], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L535_C12", "vector": [8, 4, 0.727, 0.0014, 4, 0.09, 0.5, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Could not compute forward kinematics.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L539_C16", "label": "return", "type": "return", "loc": [539, 539], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L535_C12", "vector": [13, 4, 0.7284, 0.0014, 4, 0.09, 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_99752:Assign_L541_C12", "label": "msg =", "type": "assigned_variable", "loc": [541, 541], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L530_C8", "vector": [14, 3, 0.7311, 0.0014, 3, 0.48, 0.8, 712, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = '%s arm not supported.'%(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L542_C12", "label": "logerr()", "type": "expression", "loc": [542, 542], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L530_C8", "vector": [8, 3, 0.7324, 0.0014, 3, 0.48, 1.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L546_C4", "label": "FK_all", "type": "function", "loc": [546, 560], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "vector": [2, 1, 0.7473, 0.0203, 1, 0.83, 0.3846, 415, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "FK_all", "arg_names": ["self", "arm", "q", "link_number"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def FK_all(self, arm, q, link_number = 7):\n q = self.pr2_to_kdl(q)\n frame = self.FK_kdl(arm, q, link_number)\n pos = frame.p\n pos = ku.kdl_vec_to_np(pos)\n pos = pos + self.right_arm_base_offset_from_torso_lift_link\n m = frame.M\n rot = ku.kdl_rot_to_np(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L547_C8", "label": "q = pr2_to_kdl()", "type": "assigned_variable", "loc": [547, 547], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L546_C4", "vector": [14, 2, 0.7392, 0.0014, 2, 0.16, 0.0, 516, 3, 1, 0, 0, 85, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "pr2_to_kdl", "annotation": ""}, "snippet": " q = self.pr2_to_kdl(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L548_C8", "label": "frame = FK_kdl()", "type": "assigned_variable", "loc": [548, 548], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L546_C4", "vector": [14, 2, 0.7405, 0.0014, 2, 0.16, 0.125, 313, 3, 3, 0, 0, 929, 10, 1], "semantic": {"name": "frame", "arg_names": [], "import_names": [], "rhs_call_name": "FK_kdl", "annotation": ""}, "snippet": " frame = self.FK_kdl(arm, q, link_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L549_C8", "label": "pos =", "type": "assigned_variable", "loc": [549, 549], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L546_C4", "vector": [14, 2, 0.7419, 0.0014, 2, 0.16, 0.25, 627, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = frame.p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L550_C8", "label": "pos = kdl_vec_to_np()", "type": "assigned_variable", "loc": [550, 550], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L546_C4", "vector": [14, 2, 0.7432, 0.0014, 2, 0.16, 0.375, 627, 3, 1, 0, 0, 707, 10, 1], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "kdl_vec_to_np", "annotation": ""}, "snippet": " pos = ku.kdl_vec_to_np(pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L551_C8", "label": "pos =", "type": "assigned_variable", "loc": [551, 551], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L546_C4", "vector": [14, 2, 0.7446, 0.0014, 2, 0.16, 0.5, 627, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = pos + self.right_arm_base_offset_from_torso_lift_link"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L552_C8", "label": "m =", "type": "assigned_variable", "loc": [552, 552], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L546_C4", "vector": [14, 2, 0.7459, 0.0014, 2, 0.16, 0.625, 711, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m = frame.M"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L553_C8", "label": "rot = kdl_rot_to_np()", "type": "assigned_variable", "loc": [553, 553], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L546_C4", "vector": [14, 2, 0.7473, 0.0014, 2, 0.16, 0.75, 812, 3, 1, 0, 0, 380, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "kdl_rot_to_np", "annotation": ""}, "snippet": " rot = ku.kdl_rot_to_np(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L554_C8", "label": "if", "type": "if", "loc": [554, 559], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L546_C4", "vector": [4, 2, 0.752, 0.0081, 2, 0.16, 0.875, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n tooltip_baseframe = rot * self.right_tooltip\n pos += tooltip_baseframe\n else:\n rospy.logerr('Arm %d is not supported.'%(arm))\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L555_C12", "label": "tooltip_baseframe =", "type": "assigned_variable", "loc": [555, 555], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L554_C8", "vector": [14, 3, 0.75, 0.0014, 3, 0.67, 0.0, 649, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tooltip_baseframe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tooltip_baseframe = rot * self.right_tooltip"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L558_C12", "label": "logerr()", "type": "expression", "loc": [558, 558], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L554_C8", "vector": [8, 3, 0.7541, 0.0014, 3, 0.67, 0.5, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Arm %d is not supported.'%(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L559_C12", "label": "return", "type": "return", "loc": [559, 559], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L554_C8", "vector": [13, 3, 0.7554, 0.0014, 3, 0.67, 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_99752:Return_L560_C8", "label": "return", "type": "return", "loc": [560, 560], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L546_C4", "vector": [13, 2, 0.7568, 0.0014, 2, 0.16, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pos, rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4", "label": "kdl_to_pr2", "type": "function", "loc": [562, 574], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "vector": [2, 1, 0.7676, 0.0176, 1, 0.83, 0.4615, 288, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "kdl_to_pr2", "arg_names": ["self", "q"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def kdl_to_pr2(self, q):\n if q == None:\n return None\n\n q_pr2 = [0] * 7\n q_pr2[0] = q[0]\n q_pr2[1] = q[1]\n q_pr2[2] = q[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L563_C8", "label": "if", "type": "if", "loc": [563, 564], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4", "vector": [4, 2, 0.7615, 0.0027, 2, 0.79, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if q == None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L564_C12", "label": "return", "type": "return", "loc": [564, 564], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L563_C8", "vector": [13, 3, 0.7622, 0.0014, 3, 0.27, 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_99752:Assign_L566_C8", "label": "q_pr2 =", "type": "assigned_variable", "loc": [566, 566], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4", "vector": [14, 2, 0.7649, 0.0014, 2, 0.79, 0.1111, 714, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q_pr2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2 = [0] * 7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L567_C8", "label": "assign", "type": "assigned_variable", "loc": [567, 567], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4", "vector": [14, 2, 0.7662, 0.0014, 2, 0.79, 0.2222, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2[0] = q[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L568_C8", "label": "assign", "type": "assigned_variable", "loc": [568, 568], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4", "vector": [14, 2, 0.7676, 0.0014, 2, 0.79, 0.3333, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2[1] = q[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L569_C8", "label": "assign", "type": "assigned_variable", "loc": [569, 569], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4", "vector": [14, 2, 0.7689, 0.0014, 2, 0.79, 0.4444, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2[2] = q[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L570_C8", "label": "assign", "type": "assigned_variable", "loc": [570, 570], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4", "vector": [14, 2, 0.7703, 0.0014, 2, 0.79, 0.5556, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2[3] = q[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L571_C8", "label": "assign", "type": "assigned_variable", "loc": [571, 571], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4", "vector": [14, 2, 0.7716, 0.0014, 2, 0.79, 0.6667, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2[4] = q[4]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L572_C8", "label": "assign", "type": "assigned_variable", "loc": [572, 572], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4", "vector": [14, 2, 0.773, 0.0014, 2, 0.79, 0.7778, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2[5] = q[5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L573_C8", "label": "assign", "type": "assigned_variable", "loc": [573, 573], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4", "vector": [14, 2, 0.7743, 0.0014, 2, 0.79, 0.8889, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2[6] = q[6]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L574_C8", "label": "return", "type": "return", "loc": [574, 574], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4", "vector": [13, 2, 0.7757, 0.0014, 2, 0.79, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return q_pr2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L576_C4", "label": "pr2_to_kdl", "type": "function", "loc": [576, 583], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "vector": [2, 1, 0.7831, 0.0108, 1, 0.83, 0.5385, 85, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "pr2_to_kdl", "arg_names": ["self", "q"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pr2_to_kdl(self, q):\n if q == None:\n return None\n n = len(q)\n q_kdl = kdl.JntArray(n)\n for i in range(n):\n q_kdl[i] = q[i]\n return q_kdl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L577_C8", "label": "if", "type": "if", "loc": [577, 578], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L576_C4", "vector": [4, 2, 0.7804, 0.0027, 2, 0.2, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if q == None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L578_C12", "label": "return", "type": "return", "loc": [578, 578], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L577_C8", "vector": [13, 3, 0.7811, 0.0014, 3, 0.82, 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_99752:Assign_L579_C8", "label": "n = len()", "type": "assigned_variable", "loc": [579, 579], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L576_C4", "vector": [14, 2, 0.7824, 0.0014, 2, 0.2, 0.25, 773, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n = len(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L580_C8", "label": "q_kdl = JntArray()", "type": "assigned_variable", "loc": [580, 580], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L576_C4", "vector": [14, 2, 0.7838, 0.0014, 2, 0.2, 0.5, 784, 3, 1, 0, 0, 115, 10, 1], "semantic": {"name": "q_kdl", "arg_names": [], "import_names": [], "rhs_call_name": "JntArray", "annotation": ""}, "snippet": " q_kdl = kdl.JntArray(n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L581_C8", "label": "for i", "type": "for", "loc": [581, 582], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L576_C4", "vector": [6, 2, 0.7858, 0.0027, 2, 0.2, 0.75, 826, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(n):\n q_kdl[i] = q[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L582_C12", "label": "assign", "type": "assigned_variable", "loc": [582, 582], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L581_C8", "vector": [14, 3, 0.7865, 0.0014, 3, 0.83, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_kdl[i] = q[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L583_C8", "label": "return", "type": "return", "loc": [583, 583], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L576_C4", "vector": [13, 2, 0.7878, 0.0014, 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 q_kdl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L585_C4", "label": "Jac_kdl", "type": "function", "loc": [585, 601], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "vector": [2, 1, 0.8014, 0.023, 1, 0.83, 0.6154, 295, 0, 3, 1, 0, 0, 0, 5], "semantic": {"name": "Jac_kdl", "arg_names": ["self", "arm", "q"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def Jac_kdl(self, arm, q):\n J_kdl = kdl.Jacobian(7)\n if arm != 0:\n rospy.logerr('Unsupported arm: '+ str(arm))\n return None\n\n self.right_jac.JntToJac(q,J_kdl)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L586_C8", "label": "J_kdl = Jacobian()", "type": "assigned_variable", "loc": [586, 586], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L585_C4", "vector": [14, 2, 0.7919, 0.0014, 2, 0.65, 0.0, 652, 3, 1, 0, 0, 182, 10, 1], "semantic": {"name": "J_kdl", "arg_names": [], "import_names": [], "rhs_call_name": "Jacobian", "annotation": ""}, "snippet": " J_kdl = kdl.Jacobian(7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L587_C8", "label": "if", "type": "if", "loc": [587, 589], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L585_C4", "vector": [4, 2, 0.7946, 0.0041, 2, 0.65, 0.25, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 0:\n rospy.logerr('Unsupported arm: '+ str(arm))\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L588_C12", "label": "logerr()", "type": "expression", "loc": [588, 588], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L587_C8", "vector": [8, 3, 0.7946, 0.0014, 3, 0.84, 0.0, 747, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Unsupported arm: '+ str(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L589_C12", "label": "return", "type": "return", "loc": [589, 589], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L587_C8", "vector": [13, 3, 0.7959, 0.0014, 3, 0.84, 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_99752:Expr_L591_C8", "label": "JntToJac()", "type": "expression", "loc": [591, 591], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L585_C4", "vector": [8, 2, 0.7986, 0.0014, 2, 0.65, 0.5, 953, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "JntToJac", "arg_names": [], "import_names": [], "rhs_call_name": "JntToJac", "annotation": ""}, "snippet": " self.right_jac.JntToJac(q,J_kdl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L593_C8", "label": "kdl_jac = matrix()", "type": "assigned_variable", "loc": [593, 600], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L585_C4", "vector": [14, 2, 0.8061, 0.0108, 2, 0.65, 0.75, 33, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "kdl_jac", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " kdl_jac = np.matrix([\n [J_kdl[0,0],J_kdl[0,1],J_kdl[0,2],J_kdl[0,3],J_kdl[0,4],J_kdl[0,5],J_kdl[0,6]],\n [J_kdl[1,0],J_kdl[1,1],J_kdl[1,2],J_kdl[1,3],J_kdl[1,4],J_kdl[1,5],J_kdl[1,6]],\n [J_kdl[2,0],J_kdl[2,1],J_kdl[2,2],J_kdl[2,3],J_kdl[2,4],J_kdl[2,5],J_kdl[2,6]],\n [J_kdl[3,0],J_kdl[3,1],J_kdl[3,2],J_kdl[3,3],J_kdl[3,4],J_kdl[3,5],J_kdl[3,6]],\n [J_kdl[4,0],J_kdl[4,1],J_kdl[4,2],J_kdl[4,3],J_kdl[4,4],J_kdl[4,5],J_kdl[4,6]],\n [J_kdl[5,0],J_kdl[5,1],J_kdl[5,2],J_kdl[5,3],J_kdl[5,4],J_kdl[5,5],J_kdl[5,6]],\n ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L601_C8", "label": "return", "type": "return", "loc": [601, 601], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L585_C4", "vector": [13, 2, 0.8122, 0.0014, 2, 0.65, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return kdl_jac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L607_C4", "label": "Jac", "type": "function", "loc": [607, 612], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "vector": [2, 1, 0.8236, 0.0081, 1, 0.83, 0.6923, 115, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "Jac", "arg_names": ["self", "arm", "q"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def Jac(self, arm, q):\n rospy.logerr('Jac only works for getting the Jacobian at the wrist. Use Jacobian to get the Jacobian at a general location.')\n jntarr = self.pr2_to_kdl(q)\n kdl_jac = self.Jac_kdl(arm, jntarr)\n pr2_jac = kdl_jac\n return pr2_jac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L608_C8", "label": "logerr()", "type": "expression", "loc": [608, 608], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L607_C4", "vector": [8, 2, 0.8216, 0.0014, 2, 0.65, 0.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Jac only works for getting the Jacobian at the wrist. Use Jacobian to get the Jacobian at a general location.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L609_C8", "label": "jntarr = pr2_to_kdl()", "type": "assigned_variable", "loc": [609, 609], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L607_C4", "vector": [14, 2, 0.823, 0.0014, 2, 0.65, 0.25, 140, 3, 1, 0, 0, 85, 10, 1], "semantic": {"name": "jntarr", "arg_names": [], "import_names": [], "rhs_call_name": "pr2_to_kdl", "annotation": ""}, "snippet": " jntarr = self.pr2_to_kdl(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L610_C8", "label": "kdl_jac = Jac_kdl()", "type": "assigned_variable", "loc": [610, 610], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L607_C4", "vector": [14, 2, 0.8243, 0.0014, 2, 0.65, 0.5, 33, 3, 2, 0, 0, 295, 10, 1], "semantic": {"name": "kdl_jac", "arg_names": [], "import_names": [], "rhs_call_name": "Jac_kdl", "annotation": ""}, "snippet": " kdl_jac = self.Jac_kdl(arm, jntarr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L611_C8", "label": "pr2_jac =", "type": "assigned_variable", "loc": [611, 611], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L607_C4", "vector": [14, 2, 0.8257, 0.0014, 2, 0.65, 0.75, 513, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pr2_jac", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pr2_jac = kdl_jac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L612_C8", "label": "return", "type": "return", "loc": [612, 612], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L607_C4", "vector": [13, 2, 0.827, 0.0014, 2, 0.65, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pr2_jac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L617_C4", "label": "jacobian", "type": "function", "loc": [617, 618], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "vector": [2, 1, 0.8345, 0.0027, 1, 0.83, 0.7692, 8, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "jacobian", "arg_names": ["self", "arm", "q", "pos"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def jacobian(self, arm, q, pos):\n return self.Jacobian(arm, q, pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L618_C8", "label": "return", "type": "return", "loc": [618, 618], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L617_C4", "vector": [13, 2, 0.8351, 0.0014, 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.Jacobian(arm, q, pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L622_C4", "label": "Jacobian", "type": "function", "loc": [622, 641], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "vector": [2, 1, 0.8534, 0.027, 1, 0.83, 0.8462, 182, 0, 4, 1, 0, 0, 0, 14], "semantic": {"name": "Jacobian", "arg_names": ["self", "arm", "q", "pos"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def Jacobian(self, arm, q, pos):\n if arm != 0:\n rospy.logerr('Arm %d is not supported.'%(arm))\n return None\n\n tooltip = self.right_tooltip\n self.right_tooltip = np.matrix([0.,0.,0.]).T\n v_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L623_C8", "label": "if", "type": "if", "loc": [623, 625], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L622_C4", "vector": [4, 2, 0.8432, 0.0041, 2, 0.39, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 0:\n rospy.logerr('Arm %d is not supported.'%(arm))\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L624_C12", "label": "logerr()", "type": "expression", "loc": [624, 624], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L623_C8", "vector": [8, 3, 0.8432, 0.0014, 3, 0.36, 0.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Arm %d is not supported.'%(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L625_C12", "label": "return", "type": "return", "loc": [625, 625], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L623_C8", "vector": [13, 3, 0.8446, 0.0014, 3, 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_99752:Assign_L627_C8", "label": "tooltip =", "type": "assigned_variable", "loc": [627, 627], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L622_C4", "vector": [14, 2, 0.8473, 0.0014, 2, 0.39, 0.125, 568, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tooltip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tooltip = self.right_tooltip"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L628_C8", "label": "self.right_tooltip =", "type": "assigned_variable", "loc": [628, 628], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L622_C4", "vector": [14, 2, 0.8486, 0.0014, 2, 0.39, 0.25, 402, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.right_tooltip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_tooltip = np.matrix([0.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L629_C8", "label": "v_list =", "type": "assigned_variable", "loc": [629, 629], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L622_C4", "vector": [14, 2, 0.85, 0.0014, 2, 0.39, 0.375, 218, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "v_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L630_C8", "label": "w_list =", "type": "assigned_variable", "loc": [630, 630], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L622_C4", "vector": [14, 2, 0.8514, 0.0014, 2, 0.39, 0.5, 821, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "w_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " w_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L631_C8", "label": "for i", "type": "for", "loc": [631, 637], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L622_C4", "vector": [6, 2, 0.8568, 0.0095, 2, 0.39, 0.625, 826, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(7):\n p, rot = self.FK_all(arm, q, i)\n r = pos - p\n z_idx = self.right_chain.getSegment(i).getJoint().getType() - 1\n z = rot[:, z_idx]\n v_list.append(np.matrix(np.cross(z.A1, r.A1)).T)\n w_list.append(z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L632_C12", "label": "p, rot = FK_all()", "type": "assigned_variable", "loc": [632, 632], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L631_C8", "vector": [14, 3, 0.8541, 0.0014, 3, 0.54, 0.0, 466, 3, 3, 0, 0, 415, 10, 1], "semantic": {"name": "p, rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK_all", "annotation": ""}, "snippet": " p, rot = self.FK_all(arm, q, i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L633_C12", "label": "r =", "type": "assigned_variable", "loc": [633, 633], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L631_C8", "vector": [14, 3, 0.8554, 0.0014, 3, 0.54, 0.2, 436, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = pos - p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L634_C12", "label": "z_idx =", "type": "assigned_variable", "loc": [634, 634], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L631_C8", "vector": [14, 3, 0.8568, 0.0014, 3, 0.54, 0.4, 160, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "z_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_idx = self.right_chain.getSegment(i).getJoint().getType() - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L635_C12", "label": "z =", "type": "assigned_variable", "loc": [635, 635], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L631_C8", "vector": [14, 3, 0.8581, 0.0014, 3, 0.54, 0.6, 859, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = rot[:, z_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L636_C12", "label": "append()", "type": "expression", "loc": [636, 636], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L631_C8", "vector": [8, 3, 0.8595, 0.0014, 3, 0.54, 0.8, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " v_list.append(np.matrix(np.cross(z.A1, r.A1)).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L637_C12", "label": "append()", "type": "expression", "loc": [637, 637], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L631_C8", "vector": [8, 3, 0.8608, 0.0014, 3, 0.54, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " w_list.append(z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L639_C8", "label": "J = row_stack()", "type": "assigned_variable", "loc": [639, 639], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L622_C4", "vector": [14, 2, 0.8635, 0.0014, 2, 0.39, 0.75, 946, 3, 1, 0, 0, 612, 10, 3], "semantic": {"name": "J", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " J = np.row_stack((np.column_stack(v_list), np.column_stack(w_list)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L640_C8", "label": "self.right_tooltip =", "type": "assigned_variable", "loc": [640, 640], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L622_C4", "vector": [14, 2, 0.8649, 0.0014, 2, 0.39, 0.875, 402, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.right_tooltip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_tooltip = tooltip"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L641_C8", "label": "return", "type": "return", "loc": [641, 641], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L622_C4", "vector": [13, 2, 0.8662, 0.0014, 2, 0.39, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return J"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L643_C4", "label": "close_to_singularity", "type": "function", "loc": [643, 644], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "vector": [2, 1, 0.8696, 0.0027, 1, 0.83, 0.9231, 738, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "close_to_singularity", "arg_names": ["self", "arm", "q"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close_to_singularity(self, arm, q):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L646_C4", "label": "within_joint_limits", "type": "function", "loc": [646, 656], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "vector": [2, 1, 0.8797, 0.0149, 1, 0.83, 1.0, 596, 0, 4, 1, 0, 0, 0, 8], "semantic": {"name": "within_joint_limits", "arg_names": ["self", "arm", "q", "delta_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def within_joint_limits(self, arm, q, delta_list=[0., 0., 0., 0., 0., 0., 0.]):\n if arm == 0: # right arm\n min_arr = np.radians(np.array([-109., -24, -220, -132, -np.inf, -120, -np.inf]))\n #max_arr = np.radians(np.array([26., 68, 41, 0, np.inf, 0, np.inf]))\n max_arr = np.radians(np.array([26., 68, 41, 5, np.inf, 5, np.inf])) # 5 to prevent singularity. Need to come up with a better solution.\n else:\n raise RuntimeError('within_joint_limits unimplemented for left arm')\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L647_C8", "label": "if", "type": "if", "loc": [647, 652], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L646_C4", "vector": [4, 2, 0.8777, 0.0081, 2, 0.68, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0: # right arm\n min_arr = np.radians(np.array([-109., -24, -220, -132, -np.inf, -120, -np.inf]))\n #max_arr = np.radians(np.array([26., 68, 41, 0, np.inf, 0, np.inf]))\n max_arr = np.radians(np.array([26., 68, 41, 5, np.inf, 5, np.inf])) # 5 to prevent singularity. Need to come up with a better solution.\n else:\n raise RuntimeError('within_joint_limits unimplemented for left arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L648_C12", "label": "min_arr = radians()", "type": "assigned_variable", "loc": [648, 648], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L647_C8", "vector": [14, 3, 0.8757, 0.0014, 3, 0.92, 0.0, 34, 3, 1, 0, 0, 383, 10, 2], "semantic": {"name": "min_arr", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " min_arr = np.radians(np.array([-109., -24, -220, -132, -np.inf, -120, -np.inf]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L650_C12", "label": "max_arr = radians()", "type": "assigned_variable", "loc": [650, 650], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L647_C8", "vector": [14, 3, 0.8784, 0.0014, 3, 0.92, 1.0, 605, 3, 1, 0, 0, 383, 10, 2], "semantic": {"name": "max_arr", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " max_arr = np.radians(np.array([26., 68, 41, 5, np.inf, 5, np.inf])) # 5 to prevent singularity. Need to come up with a better solution."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L654_C8", "label": "q_arr = array()", "type": "assigned_variable", "loc": [654, 654], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L646_C4", "vector": [14, 2, 0.8838, 0.0014, 2, 0.68, 0.3333, 918, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "q_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " q_arr = np.array(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L655_C8", "label": "d_arr = array()", "type": "assigned_variable", "loc": [655, 655], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L646_C4", "vector": [14, 2, 0.8851, 0.0014, 2, 0.68, 0.6667, 301, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "d_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " d_arr = np.array(delta_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L656_C8", "label": "return", "type": "return", "loc": [656, 656], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L646_C4", "vector": [13, 2, 0.8865, 0.0014, 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 np.all((q_arr <= max_arr+d_arr, q_arr >= min_arr-d_arr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "label": "if", "type": "if", "loc": [659, 727], "level": 0, "parent": null, "vector": [4, 0, 0.9365, 0.0932, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 56], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n from visualization_msgs.msg import Marker\n import hrl_lib.viz as hv\n\n rospy.init_node('pr2_arms_test')\n\n pr2_arms = PR2Arms()\n pr2_kdl = PR2Arms_kdl()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:ImportFrom_L660_C4", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [660, 660], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "vector": [1, 1, 0.8919, 0.0014, 1, 0.75, 0.0, 124, 0, 1, 0, 0, 124, 0, 0], "semantic": {"name": "visualization_msgs.msg", "arg_names": [], "import_names": ["Marker"], "rhs_call_name": "", "annotation": ""}, "snippet": " from visualization_msgs.msg import Marker"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Import_L661_C4", "label": "hrl_lib.viz import hv", "type": "import", "loc": [661, 661], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "vector": [1, 1, 0.8932, 0.0014, 1, 0.75, 0.0909, 48, 0, 1, 0, 0, 48, 0, 0], "semantic": {"name": "hrl_lib.viz", "arg_names": [], "import_names": ["hv"], "rhs_call_name": "", "annotation": ""}, "snippet": " import hrl_lib.viz as hv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L663_C4", "label": "init_node()", "type": "expression", "loc": [663, 663], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "vector": [8, 1, 0.8959, 0.0014, 1, 0.75, 0.1818, 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('pr2_arms_test')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L665_C4", "label": "pr2_arms = PR2Arms()", "type": "assigned_variable", "loc": [665, 665], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "vector": [14, 1, 0.8986, 0.0014, 1, 0.75, 0.2727, 369, 3, 0, 0, 0, 694, 10, 1], "semantic": {"name": "pr2_arms", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Arms", "annotation": ""}, "snippet": " pr2_arms = PR2Arms()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L666_C4", "label": "pr2_kdl = PR2Arms_kdl()", "type": "assigned_variable", "loc": [666, 666], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "vector": [14, 1, 0.9, 0.0014, 1, 0.75, 0.3636, 561, 3, 0, 0, 0, 188, 10, 1], "semantic": {"name": "pr2_kdl", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Arms_kdl", "annotation": ""}, "snippet": " pr2_kdl = PR2Arms_kdl()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L667_C4", "label": "r_arm, l_arm =", "type": "assigned_variable", "loc": [667, 667], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "vector": [14, 1, 0.9014, 0.0014, 1, 0.75, 0.4545, 451, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "r_arm, l_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_arm, l_arm = 0, 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L668_C4", "label": "arm =", "type": "assigned_variable", "loc": [668, 668], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "vector": [14, 1, 0.9027, 0.0014, 1, 0.75, 0.5455, 413, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = r_arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L670_C4", "label": "if", "type": "if", "loc": [670, 675], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "vector": [4, 1, 0.9088, 0.0081, 1, 0.75, 0.6364, 0, 1, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n np.set_printoptions(precision=2, suppress=True)\n while not rospy.is_shutdown():\n q = pr2_arms.get_joint_angles(arm)\n print('q in degrees:', np.degrees(q))\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L671_C8", "label": "set_printoptions()", "type": "expression", "loc": [671, 671], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L670_C4", "vector": [8, 2, 0.9068, 0.0014, 2, 0.43, 0.0, 763, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_printoptions", "arg_names": [], "import_names": [], "rhs_call_name": "set_printoptions", "annotation": ""}, "snippet": " np.set_printoptions(precision=2, suppress=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L672_C8", "label": "while", "type": "while", "loc": [672, 675], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L670_C4", "vector": [5, 2, 0.9101, 0.0054, 2, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n q = pr2_arms.get_joint_angles(arm)\n print('q in degrees:', np.degrees(q))\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L673_C12", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [673, 673], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L672_C8", "vector": [14, 3, 0.9095, 0.0014, 3, 0.8, 0.0, 516, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " q = pr2_arms.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L674_C12", "label": "print()", "type": "expression", "loc": [674, 674], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L672_C8", "vector": [8, 3, 0.9108, 0.0014, 3, 0.8, 0.5, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('q in degrees:', np.degrees(q))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L675_C12", "label": "sleep()", "type": "expression", "loc": [675, 675], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L672_C8", "vector": [8, 3, 0.9122, 0.0014, 3, 0.8, 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.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L677_C4", "label": "if", "type": "if", "loc": [677, 681], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "vector": [4, 1, 0.9176, 0.0068, 1, 0.75, 0.7273, 0, 1, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n jep = [0.] * 7\n rospy.loginfo('Going to home location.')\n raw_input('Hit ENTER to go')\n pr2_arms.set_jep(arm, jep, duration=2.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L678_C8", "label": "jep =", "type": "assigned_variable", "loc": [678, 678], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L677_C4", "vector": [14, 2, 0.9162, 0.0014, 2, 0.08, 0.0, 838, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jep = [0.] * 7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L679_C8", "label": "loginfo()", "type": "expression", "loc": [679, 679], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L677_C4", "vector": [8, 2, 0.9176, 0.0014, 2, 0.08, 0.3333, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Going to home location.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L680_C8", "label": "raw_input()", "type": "expression", "loc": [680, 680], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L677_C4", "vector": [8, 2, 0.9189, 0.0014, 2, 0.08, 0.6667, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Hit ENTER to go')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L681_C8", "label": "set_jep()", "type": "expression", "loc": [681, 681], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L677_C4", "vector": [8, 2, 0.9203, 0.0014, 2, 0.08, 1.0, 799, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_jep", "arg_names": [], "import_names": [], "rhs_call_name": "set_jep", "annotation": ""}, "snippet": " pr2_arms.set_jep(arm, jep, duration=2.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L683_C4", "label": "if", "type": "if", "loc": [683, 695], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "vector": [4, 1, 0.9311, 0.0176, 1, 0.75, 0.8182, 0, 1, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n # testing FK by publishing a frame marker.\n marker_pub = rospy.Publisher('/pr2_kdl/ee_marker', Marker)\n pr2_kdl.set_tooltip(arm, np.matrix([0.15, 0., 0.]).T)\n rt = rospy.Rate(100)\n rospy.loginfo('Starting the maker publishing loop.')\n while not rospy.is_shutdown():\n q = pr2_arms.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L685_C8", "label": "marker_pub = Publisher()", "type": "assigned_variable", "loc": [685, 685], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L683_C4", "vector": [14, 2, 0.9257, 0.0014, 2, 0.75, 0.0, 918, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "marker_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " marker_pub = rospy.Publisher('/pr2_kdl/ee_marker', Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L686_C8", "label": "set_tooltip()", "type": "expression", "loc": [686, 686], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L683_C4", "vector": [8, 2, 0.927, 0.0014, 2, 0.75, 0.25, 350, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "set_tooltip", "arg_names": [], "import_names": [], "rhs_call_name": "set_tooltip", "annotation": ""}, "snippet": " pr2_kdl.set_tooltip(arm, np.matrix([0.15, 0., 0.]).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L687_C8", "label": "rt = Rate()", "type": "assigned_variable", "loc": [687, 687], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L683_C4", "vector": [14, 2, 0.9284, 0.0014, 2, 0.75, 0.5, 991, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "rt", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " rt = rospy.Rate(100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L688_C8", "label": "loginfo()", "type": "expression", "loc": [688, 688], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L683_C4", "vector": [8, 2, 0.9297, 0.0014, 2, 0.75, 0.75, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Starting the maker publishing loop.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L689_C8", "label": "while", "type": "while", "loc": [689, 695], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L683_C4", "vector": [5, 2, 0.9351, 0.0095, 2, 0.75, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n q = pr2_arms.get_joint_angles(arm)\n p, rot = pr2_kdl.FK_all(arm, q)\n m = hv.create_frame_marker(p, rot, 0.15, '/torso_lift_link')\n m.header.stamp = rospy.Time.now()\n marker_pub.publish(m)\n rt.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L690_C12", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [690, 690], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L689_C8", "vector": [14, 3, 0.9324, 0.0014, 3, 0.14, 0.0, 516, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " q = pr2_arms.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L691_C12", "label": "p, rot = FK_all()", "type": "assigned_variable", "loc": [691, 691], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L689_C8", "vector": [14, 3, 0.9338, 0.0014, 3, 0.14, 0.2, 466, 3, 2, 0, 0, 415, 10, 1], "semantic": {"name": "p, rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK_all", "annotation": ""}, "snippet": " p, rot = pr2_kdl.FK_all(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L692_C12", "label": "m = create_frame_marker()", "type": "assigned_variable", "loc": [692, 692], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L689_C8", "vector": [14, 3, 0.9351, 0.0014, 3, 0.14, 0.4, 711, 3, 4, 0, 0, 345, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "create_frame_marker", "annotation": ""}, "snippet": " m = hv.create_frame_marker(p, rot, 0.15, '/torso_lift_link')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L693_C12", "label": "m.header.stamp = now()", "type": "assigned_variable", "loc": [693, 693], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L689_C8", "vector": [14, 3, 0.9365, 0.0014, 3, 0.14, 0.6, 726, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "m.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " m.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L694_C12", "label": "publish()", "type": "expression", "loc": [694, 694], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L689_C8", "vector": [8, 3, 0.9378, 0.0014, 3, 0.14, 0.8, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " marker_pub.publish(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L695_C12", "label": "sleep()", "type": "expression", "loc": [695, 695], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L689_C8", "vector": [8, 3, 0.9392, 0.0014, 3, 0.14, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rt.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L697_C4", "label": "if", "type": "if", "loc": [697, 710], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "vector": [4, 1, 0.9507, 0.0189, 1, 0.75, 0.9091, 0, 1, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n # testing Jacobian by printing KDL and my own Jacobian at the\n # current configuration.\n while not rospy.is_shutdown():\n q = pr2_arms.get_joint_angles(arm)\n J_kdl = pr2_kdl.Jac(arm , q)\n p, rot = pr2_kdl.FK_all(arm, q)\n J_adv = pr2_kdl.Jacobian(arm, q, p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8", "label": "while", "type": "while", "loc": [700, 710], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L697_C4", "vector": [5, 2, 0.9527, 0.0149, 2, 0.82, 0.0, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n q = pr2_arms.get_joint_angles(arm)\n J_kdl = pr2_kdl.Jac(arm , q)\n p, rot = pr2_kdl.FK_all(arm, q)\n J_adv = pr2_kdl.Jacobian(arm, q, p)\n print(J_adv.shape)\n diff_J = J_kdl - J_adv\n print('difference between KDL and adv is:')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L701_C12", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [701, 701], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8", "vector": [14, 3, 0.9473, 0.0014, 3, 0.26, 0.0, 516, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " q = pr2_arms.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L702_C12", "label": "J_kdl = Jac()", "type": "assigned_variable", "loc": [702, 702], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8", "vector": [14, 3, 0.9486, 0.0014, 3, 0.26, 0.1111, 652, 3, 2, 0, 0, 115, 10, 1], "semantic": {"name": "J_kdl", "arg_names": [], "import_names": [], "rhs_call_name": "Jac", "annotation": ""}, "snippet": " J_kdl = pr2_kdl.Jac(arm , q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L703_C12", "label": "p, rot = FK_all()", "type": "assigned_variable", "loc": [703, 703], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8", "vector": [14, 3, 0.95, 0.0014, 3, 0.26, 0.2222, 466, 3, 2, 0, 0, 415, 10, 1], "semantic": {"name": "p, rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK_all", "annotation": ""}, "snippet": " p, rot = pr2_kdl.FK_all(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L704_C12", "label": "J_adv = Jacobian()", "type": "assigned_variable", "loc": [704, 704], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8", "vector": [14, 3, 0.9514, 0.0014, 3, 0.26, 0.3333, 267, 3, 3, 0, 0, 182, 10, 1], "semantic": {"name": "J_adv", "arg_names": [], "import_names": [], "rhs_call_name": "Jacobian", "annotation": ""}, "snippet": " J_adv = pr2_kdl.Jacobian(arm, q, p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L705_C12", "label": "print()", "type": "expression", "loc": [705, 705], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8", "vector": [8, 3, 0.9527, 0.0014, 3, 0.26, 0.4444, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(J_adv.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L706_C12", "label": "diff_J =", "type": "assigned_variable", "loc": [706, 706], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8", "vector": [14, 3, 0.9541, 0.0014, 3, 0.26, 0.5556, 66, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "diff_J", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diff_J = J_kdl - J_adv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L707_C12", "label": "print()", "type": "expression", "loc": [707, 707], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8", "vector": [8, 3, 0.9554, 0.0014, 3, 0.26, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('difference between KDL and adv is:')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L708_C12", "label": "print()", "type": "expression", "loc": [708, 708], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8", "vector": [8, 3, 0.9568, 0.0014, 3, 0.26, 0.7778, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(diff_J)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L709_C12", "label": "print()", "type": "expression", "loc": [709, 709], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8", "vector": [8, 3, 0.9581, 0.0014, 3, 0.26, 0.8889, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Norm of difference matrix:', np.linalg.norm(diff_J))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L710_C12", "label": "raw_input()", "type": "expression", "loc": [710, 710], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8", "vector": [8, 3, 0.9595, 0.0014, 3, 0.26, 1.0, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Move arm into some configuration and hit enter to get the Jacobian.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L713_C4", "label": "if", "type": "if", "loc": [713, 727], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "vector": [4, 1, 0.973, 0.0203, 1, 0.75, 1.0, 0, 1, 0, 0, 0, 0, 0, 21], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if True:\n while not rospy.is_shutdown():\n q = pr2_arms.wrap_angles(pr2_arms.get_joint_angles(arm))\n print(\"actual\", q)\n p_ros, rot_ros = pr2_arms.FK(arm, q)\n p_kdl, rot_kdl = pr2_kdl.FK_all(arm, q)\n ik_ros = pr2_arms.IK(r_arm, p_ros, rot_ros, q)\n ik_kdl = pr2_arms.IK(r_arm, p_kdl, rot_kdl, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8", "label": "while", "type": "while", "loc": [714, 727], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L713_C4", "vector": [5, 2, 0.9736, 0.0189, 2, 0.54, 0.0, 0, 0, 0, 0, 0, 0, 0, 21], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n q = pr2_arms.wrap_angles(pr2_arms.get_joint_angles(arm))\n print(\"actual\", q)\n p_ros, rot_ros = pr2_arms.FK(arm, q)\n p_kdl, rot_kdl = pr2_kdl.FK_all(arm, q)\n ik_ros = pr2_arms.IK(r_arm, p_ros, rot_ros, q)\n ik_kdl = pr2_arms.IK(r_arm, p_kdl, rot_kdl, q)\n diff = np.array(ik_ros) - np.array(ik_kdl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L715_C12", "label": "q = wrap_angles()", "type": "assigned_variable", "loc": [715, 715], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8", "vector": [14, 3, 0.9662, 0.0014, 3, 0.4, 0.0, 516, 3, 1, 0, 0, 651, 10, 2], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "wrap_angles", "annotation": ""}, "snippet": " q = pr2_arms.wrap_angles(pr2_arms.get_joint_angles(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L716_C12", "label": "print()", "type": "expression", "loc": [716, 716], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8", "vector": [8, 3, 0.9676, 0.0014, 3, 0.4, 0.1111, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"actual\", q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L717_C12", "label": "p_ros, rot_ros = FK()", "type": "assigned_variable", "loc": [717, 717], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8", "vector": [14, 3, 0.9689, 0.0014, 3, 0.4, 0.2222, 693, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "p_ros, rot_ros", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " p_ros, rot_ros = pr2_arms.FK(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L718_C12", "label": "p_kdl, rot_kdl = FK_all()", "type": "assigned_variable", "loc": [718, 718], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8", "vector": [14, 3, 0.9703, 0.0014, 3, 0.4, 0.3333, 125, 3, 2, 0, 0, 415, 10, 1], "semantic": {"name": "p_kdl, rot_kdl", "arg_names": [], "import_names": [], "rhs_call_name": "FK_all", "annotation": ""}, "snippet": " p_kdl, rot_kdl = pr2_kdl.FK_all(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L719_C12", "label": "ik_ros = IK()", "type": "assigned_variable", "loc": [719, 719], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8", "vector": [14, 3, 0.9716, 0.0014, 3, 0.4, 0.4444, 587, 3, 4, 0, 0, 719, 10, 1], "semantic": {"name": "ik_ros", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " ik_ros = pr2_arms.IK(r_arm, p_ros, rot_ros, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L720_C12", "label": "ik_kdl = IK()", "type": "assigned_variable", "loc": [720, 720], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8", "vector": [14, 3, 0.973, 0.0014, 3, 0.4, 0.5556, 407, 3, 4, 0, 0, 719, 10, 1], "semantic": {"name": "ik_kdl", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " ik_kdl = pr2_arms.IK(r_arm, p_kdl, rot_kdl, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L721_C12", "label": "diff =", "type": "assigned_variable", "loc": [721, 721], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8", "vector": [14, 3, 0.9743, 0.0014, 3, 0.4, 0.6667, 833, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diff = np.array(ik_ros) - np.array(ik_kdl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L722_C12", "label": "print()", "type": "expression", "loc": [722, 722], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8", "vector": [8, 3, 0.9757, 0.0014, 3, 0.4, 0.7778, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"IK ros\", ik_ros)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L723_C12", "label": "print()", "type": "expression", "loc": [723, 723], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8", "vector": [8, 3, 0.977, 0.0014, 3, 0.4, 0.8889, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"IK kdl\", ik_kdl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L724_C12", "label": "if", "type": "if", "loc": [724, 727], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8", "vector": [4, 3, 0.9804, 0.0054, 3, 0.4, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(ik_ros) == 7:\n err_ros = np.array(q) - np.array(ik_ros)\n err_kdl = np.array(q) - np.array(ik_kdl)\n print(\"err ros\", sum(err_ros**2), \"err kdl\", sum(err_kdl**2), \"diff\", sum(diff**2))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L725_C16", "label": "err_ros =", "type": "assigned_variable", "loc": [725, 725], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L724_C12", "vector": [14, 4, 0.9797, 0.0014, 4, 0.18, 0.0, 394, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "err_ros", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err_ros = np.array(q) - np.array(ik_ros)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L726_C16", "label": "err_kdl =", "type": "assigned_variable", "loc": [726, 726], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L724_C12", "vector": [14, 4, 0.9811, 0.0014, 4, 0.18, 0.5, 922, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "err_kdl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err_kdl = np.array(q) - np.array(ik_kdl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L727_C16", "label": "print()", "type": "expression", "loc": [727, 727], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L724_C12", "vector": [8, 4, 0.9824, 0.0014, 4, 0.18, 1.0, 535, 3, 6, 0, 0, 0, 0, 4], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"err ros\", sum(err_ros**2), \"err kdl\", sum(err_kdl**2), \"diff\", sum(diff**2))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L113_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L157_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L162_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L163_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L166_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L168_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L190_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L190_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L192_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L194_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L195_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L196_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L197_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L200_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L201_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L202_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L203_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L204_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L205_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L206_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L207_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L208_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L209_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L210_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L211_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L212_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L213_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L214_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L216_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L217_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L218_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L219_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L220_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L222_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L223_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L224_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L225_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L226_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L227_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L229_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L230_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L231_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L232_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L233_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L234_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L235_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L236_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L237_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:Try_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L239_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L241_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L241_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L241_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L241_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L241_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L241_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L251_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L252_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L251_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L254_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L264_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L264_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L264_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L264_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L267_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L267_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L268_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L267_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L270_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L264_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L264_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L264_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L264_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L276_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L277_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L278_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L279_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L280_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L281_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L282_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L283_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L284_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L285_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L287_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L288_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L264_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L290_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L296_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L296_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L297_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L296_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L298_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L303_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L303_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L304_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L304_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L305_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L303_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L303_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L303_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L308_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L303_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L312_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L314_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L316_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L317_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L318_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L319_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L322_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L323_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L324_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L326_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L327_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L328_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L330_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L331_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L336_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L311_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L337_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L339_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L339_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L340_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L339_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L341_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L339_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L342_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L339_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L343_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L345_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L346_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L346_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L347_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L346_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L349_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L351_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L351_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L352_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L352_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L353_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L353_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L354_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L353_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L356_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L352_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L358_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L362_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L362_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L363_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L364_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L365_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L366_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L368_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L369_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L370_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L372_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L373_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L373_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L374_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L373_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L376_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L378_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L380_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L381_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L382_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L383_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L383_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L384_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L383_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L386_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L389_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L389_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L390_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L389_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L391_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L389_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L392_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L389_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L393_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L389_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L394_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L389_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L395_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L395_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L397_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L395_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L398_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L389_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L399_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L389_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L400_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L407_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L407_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L408_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L408_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L409_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L407_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L412_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L407_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L413_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L407_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L414_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L414_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L415_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L414_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L417_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L414_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L418_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L407_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L419_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L422_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L422_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L423_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L423_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L424_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L422_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L427_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L422_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L428_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L422_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L429_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L429_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L430_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L429_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L432_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L429_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L433_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L422_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L434_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L440_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L440_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L441_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L442_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L443_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L444_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L445_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L446_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L447_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L448_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L449_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L439_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L450_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L453_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L454_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L454_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L455_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L457_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L458_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L461_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L461_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L462_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L467_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L467_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L468_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L472_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L472_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L473_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L475_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L475_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L476_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L476_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L477_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L476_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L479_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L475_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L481_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L487_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L487_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L488_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L487_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L489_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L487_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L490_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L487_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L491_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L487_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L492_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L487_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L493_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L487_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L494_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L497_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L498_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L500_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L502_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L504_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L506_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L508_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L510_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L512_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L496_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L513_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L515_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L515_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L516_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L515_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L517_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L515_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L518_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L515_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L519_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L515_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L520_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L523_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L523_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L524_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L524_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L525_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L524_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L527_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L529_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L529_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L530_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L530_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L531_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L530_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L532_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L530_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L533_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L530_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L535_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L535_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L536_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L535_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L538_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L535_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L539_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L530_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L541_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L530_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L542_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L546_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L546_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L547_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L546_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L548_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L546_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L549_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L546_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L550_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L546_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L551_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L546_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L552_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L546_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L553_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L546_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L554_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L554_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L555_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L554_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L558_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L554_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L559_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L546_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L560_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L563_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L563_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L564_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L566_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L567_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L568_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L569_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L570_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L571_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L572_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L573_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L574_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L576_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L577_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L577_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L578_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L579_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L580_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L581_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L581_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L582_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L583_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L585_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L585_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L586_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L585_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L587_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L587_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L588_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L587_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L589_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L585_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L591_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L585_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L593_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L585_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L601_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L607_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L607_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L608_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L607_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L609_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L607_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L610_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L607_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L611_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L607_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L612_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L617_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L617_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L618_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L622_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L622_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L623_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L623_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L624_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L623_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L625_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L622_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L627_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L622_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L628_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L622_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L629_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L622_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L630_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L622_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L631_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L631_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L632_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L631_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L633_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L631_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L634_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L631_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L635_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L631_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L636_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:For_L631_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L637_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L622_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L639_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L622_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L640_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L622_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L641_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L643_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:ClassDef_L486_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L646_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L647_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L647_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L648_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L647_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L650_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L654_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L655_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:FunctionDef_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Return_L656_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:ImportFrom_L660_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Import_L661_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L663_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L665_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L666_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L667_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L668_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L670_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L670_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L671_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L670_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L672_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L672_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L673_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L672_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L674_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L672_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L675_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L677_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L677_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L678_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L677_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L679_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L677_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L680_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L677_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L681_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L683_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L683_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L685_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L683_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L686_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L683_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L687_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L683_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L688_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L683_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L689_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L689_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L690_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L689_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L691_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L689_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L692_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L689_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L693_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L689_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L694_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L689_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L695_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L697_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L697_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L701_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L702_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L703_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L704_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L705_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L706_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L707_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L708_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L709_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L700_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L710_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L659_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L713_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L713_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L715_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L716_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L717_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L718_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L719_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L720_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L721_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L722_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L723_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:While_L714_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L724_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L724_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L725_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L724_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Assign_L726_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99752:If_L724_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99752:Expr_L727_C16"}]